github.com/0xPolygon/supernets2-node@v0.0.0-20230711153321-2fe574524eaa/test/contracts/bin/ERC20/ERC20.go (about) 1 // Code generated - DO NOT EDIT. 2 // This file is a generated binding and any manual changes will be lost. 3 4 package ERC20 5 6 import ( 7 "errors" 8 "math/big" 9 "strings" 10 11 ethereum "github.com/ethereum/go-ethereum" 12 "github.com/ethereum/go-ethereum/accounts/abi" 13 "github.com/ethereum/go-ethereum/accounts/abi/bind" 14 "github.com/ethereum/go-ethereum/common" 15 "github.com/ethereum/go-ethereum/core/types" 16 "github.com/ethereum/go-ethereum/event" 17 ) 18 19 // Reference imports to suppress errors if they are not otherwise used. 20 var ( 21 _ = errors.New 22 _ = big.NewInt 23 _ = strings.NewReader 24 _ = ethereum.NotFound 25 _ = bind.Bind 26 _ = common.Big1 27 _ = types.BloomLookup 28 _ = event.NewSubscription 29 _ = abi.ConvertType 30 ) 31 32 // ERC20MetaData contains all meta data concerning the ERC20 contract. 33 var ERC20MetaData = &bind.MetaData{ 34 ABI: "[{\"inputs\":[{\"internalType\":\"string\",\"name\":\"n\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"s\",\"type\":\"string\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"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\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"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\":\"\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"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\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"mint\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"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\":\"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\"}]", 35 Bin: "0x60806040526005805460ff191660121790553480156200001e57600080fd5b50604051620009a5380380620009a58339810160408190526200004191620001e8565b81516200005690600390602085019062000075565b5080516200006c90600490602084019062000075565b5050506200028f565b828054620000839062000252565b90600052602060002090601f016020900481019282620000a75760008555620000f2565b82601f10620000c257805160ff1916838001178555620000f2565b82800160010185558215620000f2579182015b82811115620000f2578251825591602001919060010190620000d5565b506200010092915062000104565b5090565b5b8082111562000100576000815560010162000105565b634e487b7160e01b600052604160045260246000fd5b600082601f8301126200014357600080fd5b81516001600160401b03808211156200016057620001606200011b565b604051601f8301601f19908116603f011681019082821181831017156200018b576200018b6200011b565b81604052838152602092508683858801011115620001a857600080fd5b600091505b83821015620001cc5785820183015181830184015290820190620001ad565b83821115620001de5760008385830101525b9695505050505050565b60008060408385031215620001fc57600080fd5b82516001600160401b03808211156200021457600080fd5b620002228683870162000131565b935060208501519150808211156200023957600080fd5b50620002488582860162000131565b9150509250929050565b600181811c908216806200026757607f821691505b602082108114156200028957634e487b7160e01b600052602260045260246000fd5b50919050565b610706806200029f6000396000f3fe608060405234801561001057600080fd5b50600436106100a95760003560e01c806342966c681161007157806342966c681461013857806370a082311461014d57806395d89b411461016d578063a0712d6814610175578063a9059cbb14610188578063dd62ed3e1461019b57600080fd5b806306fdde03146100ae578063095ea7b3146100cc57806318160ddd146100ef57806323b872dd14610106578063313ce56714610119575b600080fd5b6100b66101c6565b6040516100c391906104eb565b60405180910390f35b6100df6100da36600461055c565b610254565b60405190151581526020016100c3565b6100f860005481565b6040519081526020016100c3565b6100df610114366004610586565b6102c0565b6005546101269060ff1681565b60405160ff90911681526020016100c3565b61014b6101463660046105c2565b61039b565b005b6100f861015b3660046105db565b60016020526000908152604090205481565b6100b6610401565b61014b6101833660046105c2565b61040e565b6100df61019636600461055c565b61046d565b6100f86101a93660046105fd565b600260209081526000928352604080842090915290825290205481565b600380546101d390610630565b80601f01602080910402602001604051908101604052809291908181526020018280546101ff90610630565b801561024c5780601f106102215761010080835404028352916020019161024c565b820191906000526020600020905b81548152906001019060200180831161022f57829003601f168201915b505050505081565b3360008181526002602090815260408083206001600160a01b038716808552925280832085905551919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906102af9086815260200190565b60405180910390a350600192915050565b6001600160a01b03831660009081526002602090815260408083203384529091528120805483919083906102f5908490610681565b90915550506001600160a01b03841660009081526001602052604081208054849290610322908490610681565b90915550506001600160a01b0383166000908152600160205260408120805484929061034f908490610698565b92505081905550826001600160a01b0316846001600160a01b03166000805160206106b18339815191528460405161038991815260200190565b60405180910390a35060019392505050565b33600090815260016020526040812080548392906103ba908490610681565b92505081905550806000808282546103d29190610681565b909155505060405181815260009033906000805160206106b1833981519152906020015b60405180910390a350565b600480546101d390610630565b336000908152600160205260408120805483929061042d908490610698565b92505081905550806000808282546104459190610698565b909155505060405181815233906000906000805160206106b1833981519152906020016103f6565b3360009081526001602052604081208054839190839061048e908490610681565b90915550506001600160a01b038316600090815260016020526040812080548492906104bb908490610698565b90915550506040518281526001600160a01b0384169033906000805160206106b1833981519152906020016102af565b600060208083528351808285015260005b81811015610518578581018301518582016040015282016104fc565b8181111561052a576000604083870101525b50601f01601f1916929092016040019392505050565b80356001600160a01b038116811461055757600080fd5b919050565b6000806040838503121561056f57600080fd5b61057883610540565b946020939093013593505050565b60008060006060848603121561059b57600080fd5b6105a484610540565b92506105b260208501610540565b9150604084013590509250925092565b6000602082840312156105d457600080fd5b5035919050565b6000602082840312156105ed57600080fd5b6105f682610540565b9392505050565b6000806040838503121561061057600080fd5b61061983610540565b915061062760208401610540565b90509250929050565b600181811c9082168061064457607f821691505b6020821081141561066557634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b6000828210156106935761069361066b565b500390565b600082198211156106ab576106ab61066b565b50019056feddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa26469706673582212200bc4422a3c70571f82d7aff8ad633b2be9f8e29ff037eaead009019ed70ed47864736f6c634300080c0033", 36 } 37 38 // ERC20ABI is the input ABI used to generate the binding from. 39 // Deprecated: Use ERC20MetaData.ABI instead. 40 var ERC20ABI = ERC20MetaData.ABI 41 42 // ERC20Bin is the compiled bytecode used for deploying new contracts. 43 // Deprecated: Use ERC20MetaData.Bin instead. 44 var ERC20Bin = ERC20MetaData.Bin 45 46 // DeployERC20 deploys a new Ethereum contract, binding an instance of ERC20 to it. 47 func DeployERC20(auth *bind.TransactOpts, backend bind.ContractBackend, n string, s string) (common.Address, *types.Transaction, *ERC20, error) { 48 parsed, err := ERC20MetaData.GetAbi() 49 if err != nil { 50 return common.Address{}, nil, nil, err 51 } 52 if parsed == nil { 53 return common.Address{}, nil, nil, errors.New("GetABI returned nil") 54 } 55 56 address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(ERC20Bin), backend, n, s) 57 if err != nil { 58 return common.Address{}, nil, nil, err 59 } 60 return address, tx, &ERC20{ERC20Caller: ERC20Caller{contract: contract}, ERC20Transactor: ERC20Transactor{contract: contract}, ERC20Filterer: ERC20Filterer{contract: contract}}, nil 61 } 62 63 // ERC20 is an auto generated Go binding around an Ethereum contract. 64 type ERC20 struct { 65 ERC20Caller // Read-only binding to the contract 66 ERC20Transactor // Write-only binding to the contract 67 ERC20Filterer // Log filterer for contract events 68 } 69 70 // ERC20Caller is an auto generated read-only Go binding around an Ethereum contract. 71 type ERC20Caller struct { 72 contract *bind.BoundContract // Generic contract wrapper for the low level calls 73 } 74 75 // ERC20Transactor is an auto generated write-only Go binding around an Ethereum contract. 76 type ERC20Transactor struct { 77 contract *bind.BoundContract // Generic contract wrapper for the low level calls 78 } 79 80 // ERC20Filterer is an auto generated log filtering Go binding around an Ethereum contract events. 81 type ERC20Filterer struct { 82 contract *bind.BoundContract // Generic contract wrapper for the low level calls 83 } 84 85 // ERC20Session is an auto generated Go binding around an Ethereum contract, 86 // with pre-set call and transact options. 87 type ERC20Session struct { 88 Contract *ERC20 // Generic contract binding to set the session for 89 CallOpts bind.CallOpts // Call options to use throughout this session 90 TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session 91 } 92 93 // ERC20CallerSession is an auto generated read-only Go binding around an Ethereum contract, 94 // with pre-set call options. 95 type ERC20CallerSession struct { 96 Contract *ERC20Caller // Generic contract caller binding to set the session for 97 CallOpts bind.CallOpts // Call options to use throughout this session 98 } 99 100 // ERC20TransactorSession is an auto generated write-only Go binding around an Ethereum contract, 101 // with pre-set transact options. 102 type ERC20TransactorSession struct { 103 Contract *ERC20Transactor // Generic contract transactor binding to set the session for 104 TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session 105 } 106 107 // ERC20Raw is an auto generated low-level Go binding around an Ethereum contract. 108 type ERC20Raw struct { 109 Contract *ERC20 // Generic contract binding to access the raw methods on 110 } 111 112 // ERC20CallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. 113 type ERC20CallerRaw struct { 114 Contract *ERC20Caller // Generic read-only contract binding to access the raw methods on 115 } 116 117 // ERC20TransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. 118 type ERC20TransactorRaw struct { 119 Contract *ERC20Transactor // Generic write-only contract binding to access the raw methods on 120 } 121 122 // NewERC20 creates a new instance of ERC20, bound to a specific deployed contract. 123 func NewERC20(address common.Address, backend bind.ContractBackend) (*ERC20, error) { 124 contract, err := bindERC20(address, backend, backend, backend) 125 if err != nil { 126 return nil, err 127 } 128 return &ERC20{ERC20Caller: ERC20Caller{contract: contract}, ERC20Transactor: ERC20Transactor{contract: contract}, ERC20Filterer: ERC20Filterer{contract: contract}}, nil 129 } 130 131 // NewERC20Caller creates a new read-only instance of ERC20, bound to a specific deployed contract. 132 func NewERC20Caller(address common.Address, caller bind.ContractCaller) (*ERC20Caller, error) { 133 contract, err := bindERC20(address, caller, nil, nil) 134 if err != nil { 135 return nil, err 136 } 137 return &ERC20Caller{contract: contract}, nil 138 } 139 140 // NewERC20Transactor creates a new write-only instance of ERC20, bound to a specific deployed contract. 141 func NewERC20Transactor(address common.Address, transactor bind.ContractTransactor) (*ERC20Transactor, error) { 142 contract, err := bindERC20(address, nil, transactor, nil) 143 if err != nil { 144 return nil, err 145 } 146 return &ERC20Transactor{contract: contract}, nil 147 } 148 149 // NewERC20Filterer creates a new log filterer instance of ERC20, bound to a specific deployed contract. 150 func NewERC20Filterer(address common.Address, filterer bind.ContractFilterer) (*ERC20Filterer, error) { 151 contract, err := bindERC20(address, nil, nil, filterer) 152 if err != nil { 153 return nil, err 154 } 155 return &ERC20Filterer{contract: contract}, nil 156 } 157 158 // bindERC20 binds a generic wrapper to an already deployed contract. 159 func bindERC20(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { 160 parsed, err := ERC20MetaData.GetAbi() 161 if err != nil { 162 return nil, err 163 } 164 return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil 165 } 166 167 // Call invokes the (constant) contract method with params as input values and 168 // sets the output to result. The result type might be a single field for simple 169 // returns, a slice of interfaces for anonymous returns and a struct for named 170 // returns. 171 func (_ERC20 *ERC20Raw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { 172 return _ERC20.Contract.ERC20Caller.contract.Call(opts, result, method, params...) 173 } 174 175 // Transfer initiates a plain transaction to move funds to the contract, calling 176 // its default method if one is available. 177 func (_ERC20 *ERC20Raw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { 178 return _ERC20.Contract.ERC20Transactor.contract.Transfer(opts) 179 } 180 181 // Transact invokes the (paid) contract method with params as input values. 182 func (_ERC20 *ERC20Raw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { 183 return _ERC20.Contract.ERC20Transactor.contract.Transact(opts, method, params...) 184 } 185 186 // Call invokes the (constant) contract method with params as input values and 187 // sets the output to result. The result type might be a single field for simple 188 // returns, a slice of interfaces for anonymous returns and a struct for named 189 // returns. 190 func (_ERC20 *ERC20CallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { 191 return _ERC20.Contract.contract.Call(opts, result, method, params...) 192 } 193 194 // Transfer initiates a plain transaction to move funds to the contract, calling 195 // its default method if one is available. 196 func (_ERC20 *ERC20TransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { 197 return _ERC20.Contract.contract.Transfer(opts) 198 } 199 200 // Transact invokes the (paid) contract method with params as input values. 201 func (_ERC20 *ERC20TransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { 202 return _ERC20.Contract.contract.Transact(opts, method, params...) 203 } 204 205 // Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. 206 // 207 // Solidity: function allowance(address , address ) view returns(uint256) 208 func (_ERC20 *ERC20Caller) Allowance(opts *bind.CallOpts, arg0 common.Address, arg1 common.Address) (*big.Int, error) { 209 var out []interface{} 210 err := _ERC20.contract.Call(opts, &out, "allowance", arg0, arg1) 211 212 if err != nil { 213 return *new(*big.Int), err 214 } 215 216 out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) 217 218 return out0, err 219 220 } 221 222 // Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. 223 // 224 // Solidity: function allowance(address , address ) view returns(uint256) 225 func (_ERC20 *ERC20Session) Allowance(arg0 common.Address, arg1 common.Address) (*big.Int, error) { 226 return _ERC20.Contract.Allowance(&_ERC20.CallOpts, arg0, arg1) 227 } 228 229 // Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. 230 // 231 // Solidity: function allowance(address , address ) view returns(uint256) 232 func (_ERC20 *ERC20CallerSession) Allowance(arg0 common.Address, arg1 common.Address) (*big.Int, error) { 233 return _ERC20.Contract.Allowance(&_ERC20.CallOpts, arg0, arg1) 234 } 235 236 // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. 237 // 238 // Solidity: function balanceOf(address ) view returns(uint256) 239 func (_ERC20 *ERC20Caller) BalanceOf(opts *bind.CallOpts, arg0 common.Address) (*big.Int, error) { 240 var out []interface{} 241 err := _ERC20.contract.Call(opts, &out, "balanceOf", arg0) 242 243 if err != nil { 244 return *new(*big.Int), err 245 } 246 247 out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) 248 249 return out0, err 250 251 } 252 253 // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. 254 // 255 // Solidity: function balanceOf(address ) view returns(uint256) 256 func (_ERC20 *ERC20Session) BalanceOf(arg0 common.Address) (*big.Int, error) { 257 return _ERC20.Contract.BalanceOf(&_ERC20.CallOpts, arg0) 258 } 259 260 // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. 261 // 262 // Solidity: function balanceOf(address ) view returns(uint256) 263 func (_ERC20 *ERC20CallerSession) BalanceOf(arg0 common.Address) (*big.Int, error) { 264 return _ERC20.Contract.BalanceOf(&_ERC20.CallOpts, arg0) 265 } 266 267 // Decimals is a free data retrieval call binding the contract method 0x313ce567. 268 // 269 // Solidity: function decimals() view returns(uint8) 270 func (_ERC20 *ERC20Caller) Decimals(opts *bind.CallOpts) (uint8, error) { 271 var out []interface{} 272 err := _ERC20.contract.Call(opts, &out, "decimals") 273 274 if err != nil { 275 return *new(uint8), err 276 } 277 278 out0 := *abi.ConvertType(out[0], new(uint8)).(*uint8) 279 280 return out0, err 281 282 } 283 284 // Decimals is a free data retrieval call binding the contract method 0x313ce567. 285 // 286 // Solidity: function decimals() view returns(uint8) 287 func (_ERC20 *ERC20Session) Decimals() (uint8, error) { 288 return _ERC20.Contract.Decimals(&_ERC20.CallOpts) 289 } 290 291 // Decimals is a free data retrieval call binding the contract method 0x313ce567. 292 // 293 // Solidity: function decimals() view returns(uint8) 294 func (_ERC20 *ERC20CallerSession) Decimals() (uint8, error) { 295 return _ERC20.Contract.Decimals(&_ERC20.CallOpts) 296 } 297 298 // Name is a free data retrieval call binding the contract method 0x06fdde03. 299 // 300 // Solidity: function name() view returns(string) 301 func (_ERC20 *ERC20Caller) Name(opts *bind.CallOpts) (string, error) { 302 var out []interface{} 303 err := _ERC20.contract.Call(opts, &out, "name") 304 305 if err != nil { 306 return *new(string), err 307 } 308 309 out0 := *abi.ConvertType(out[0], new(string)).(*string) 310 311 return out0, err 312 313 } 314 315 // Name is a free data retrieval call binding the contract method 0x06fdde03. 316 // 317 // Solidity: function name() view returns(string) 318 func (_ERC20 *ERC20Session) Name() (string, error) { 319 return _ERC20.Contract.Name(&_ERC20.CallOpts) 320 } 321 322 // Name is a free data retrieval call binding the contract method 0x06fdde03. 323 // 324 // Solidity: function name() view returns(string) 325 func (_ERC20 *ERC20CallerSession) Name() (string, error) { 326 return _ERC20.Contract.Name(&_ERC20.CallOpts) 327 } 328 329 // Symbol is a free data retrieval call binding the contract method 0x95d89b41. 330 // 331 // Solidity: function symbol() view returns(string) 332 func (_ERC20 *ERC20Caller) Symbol(opts *bind.CallOpts) (string, error) { 333 var out []interface{} 334 err := _ERC20.contract.Call(opts, &out, "symbol") 335 336 if err != nil { 337 return *new(string), err 338 } 339 340 out0 := *abi.ConvertType(out[0], new(string)).(*string) 341 342 return out0, err 343 344 } 345 346 // Symbol is a free data retrieval call binding the contract method 0x95d89b41. 347 // 348 // Solidity: function symbol() view returns(string) 349 func (_ERC20 *ERC20Session) Symbol() (string, error) { 350 return _ERC20.Contract.Symbol(&_ERC20.CallOpts) 351 } 352 353 // Symbol is a free data retrieval call binding the contract method 0x95d89b41. 354 // 355 // Solidity: function symbol() view returns(string) 356 func (_ERC20 *ERC20CallerSession) Symbol() (string, error) { 357 return _ERC20.Contract.Symbol(&_ERC20.CallOpts) 358 } 359 360 // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. 361 // 362 // Solidity: function totalSupply() view returns(uint256) 363 func (_ERC20 *ERC20Caller) TotalSupply(opts *bind.CallOpts) (*big.Int, error) { 364 var out []interface{} 365 err := _ERC20.contract.Call(opts, &out, "totalSupply") 366 367 if err != nil { 368 return *new(*big.Int), err 369 } 370 371 out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) 372 373 return out0, err 374 375 } 376 377 // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. 378 // 379 // Solidity: function totalSupply() view returns(uint256) 380 func (_ERC20 *ERC20Session) TotalSupply() (*big.Int, error) { 381 return _ERC20.Contract.TotalSupply(&_ERC20.CallOpts) 382 } 383 384 // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. 385 // 386 // Solidity: function totalSupply() view returns(uint256) 387 func (_ERC20 *ERC20CallerSession) TotalSupply() (*big.Int, error) { 388 return _ERC20.Contract.TotalSupply(&_ERC20.CallOpts) 389 } 390 391 // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. 392 // 393 // Solidity: function approve(address spender, uint256 amount) returns(bool) 394 func (_ERC20 *ERC20Transactor) Approve(opts *bind.TransactOpts, spender common.Address, amount *big.Int) (*types.Transaction, error) { 395 return _ERC20.contract.Transact(opts, "approve", spender, amount) 396 } 397 398 // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. 399 // 400 // Solidity: function approve(address spender, uint256 amount) returns(bool) 401 func (_ERC20 *ERC20Session) Approve(spender common.Address, amount *big.Int) (*types.Transaction, error) { 402 return _ERC20.Contract.Approve(&_ERC20.TransactOpts, spender, amount) 403 } 404 405 // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. 406 // 407 // Solidity: function approve(address spender, uint256 amount) returns(bool) 408 func (_ERC20 *ERC20TransactorSession) Approve(spender common.Address, amount *big.Int) (*types.Transaction, error) { 409 return _ERC20.Contract.Approve(&_ERC20.TransactOpts, spender, amount) 410 } 411 412 // Burn is a paid mutator transaction binding the contract method 0x42966c68. 413 // 414 // Solidity: function burn(uint256 amount) returns() 415 func (_ERC20 *ERC20Transactor) Burn(opts *bind.TransactOpts, amount *big.Int) (*types.Transaction, error) { 416 return _ERC20.contract.Transact(opts, "burn", amount) 417 } 418 419 // Burn is a paid mutator transaction binding the contract method 0x42966c68. 420 // 421 // Solidity: function burn(uint256 amount) returns() 422 func (_ERC20 *ERC20Session) Burn(amount *big.Int) (*types.Transaction, error) { 423 return _ERC20.Contract.Burn(&_ERC20.TransactOpts, amount) 424 } 425 426 // Burn is a paid mutator transaction binding the contract method 0x42966c68. 427 // 428 // Solidity: function burn(uint256 amount) returns() 429 func (_ERC20 *ERC20TransactorSession) Burn(amount *big.Int) (*types.Transaction, error) { 430 return _ERC20.Contract.Burn(&_ERC20.TransactOpts, amount) 431 } 432 433 // Mint is a paid mutator transaction binding the contract method 0xa0712d68. 434 // 435 // Solidity: function mint(uint256 amount) returns() 436 func (_ERC20 *ERC20Transactor) Mint(opts *bind.TransactOpts, amount *big.Int) (*types.Transaction, error) { 437 return _ERC20.contract.Transact(opts, "mint", amount) 438 } 439 440 // Mint is a paid mutator transaction binding the contract method 0xa0712d68. 441 // 442 // Solidity: function mint(uint256 amount) returns() 443 func (_ERC20 *ERC20Session) Mint(amount *big.Int) (*types.Transaction, error) { 444 return _ERC20.Contract.Mint(&_ERC20.TransactOpts, amount) 445 } 446 447 // Mint is a paid mutator transaction binding the contract method 0xa0712d68. 448 // 449 // Solidity: function mint(uint256 amount) returns() 450 func (_ERC20 *ERC20TransactorSession) Mint(amount *big.Int) (*types.Transaction, error) { 451 return _ERC20.Contract.Mint(&_ERC20.TransactOpts, amount) 452 } 453 454 // Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. 455 // 456 // Solidity: function transfer(address recipient, uint256 amount) returns(bool) 457 func (_ERC20 *ERC20Transactor) Transfer(opts *bind.TransactOpts, recipient common.Address, amount *big.Int) (*types.Transaction, error) { 458 return _ERC20.contract.Transact(opts, "transfer", recipient, amount) 459 } 460 461 // Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. 462 // 463 // Solidity: function transfer(address recipient, uint256 amount) returns(bool) 464 func (_ERC20 *ERC20Session) Transfer(recipient common.Address, amount *big.Int) (*types.Transaction, error) { 465 return _ERC20.Contract.Transfer(&_ERC20.TransactOpts, recipient, amount) 466 } 467 468 // Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. 469 // 470 // Solidity: function transfer(address recipient, uint256 amount) returns(bool) 471 func (_ERC20 *ERC20TransactorSession) Transfer(recipient common.Address, amount *big.Int) (*types.Transaction, error) { 472 return _ERC20.Contract.Transfer(&_ERC20.TransactOpts, recipient, amount) 473 } 474 475 // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. 476 // 477 // Solidity: function transferFrom(address sender, address recipient, uint256 amount) returns(bool) 478 func (_ERC20 *ERC20Transactor) TransferFrom(opts *bind.TransactOpts, sender common.Address, recipient common.Address, amount *big.Int) (*types.Transaction, error) { 479 return _ERC20.contract.Transact(opts, "transferFrom", sender, recipient, amount) 480 } 481 482 // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. 483 // 484 // Solidity: function transferFrom(address sender, address recipient, uint256 amount) returns(bool) 485 func (_ERC20 *ERC20Session) TransferFrom(sender common.Address, recipient common.Address, amount *big.Int) (*types.Transaction, error) { 486 return _ERC20.Contract.TransferFrom(&_ERC20.TransactOpts, sender, recipient, amount) 487 } 488 489 // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. 490 // 491 // Solidity: function transferFrom(address sender, address recipient, uint256 amount) returns(bool) 492 func (_ERC20 *ERC20TransactorSession) TransferFrom(sender common.Address, recipient common.Address, amount *big.Int) (*types.Transaction, error) { 493 return _ERC20.Contract.TransferFrom(&_ERC20.TransactOpts, sender, recipient, amount) 494 } 495 496 // ERC20ApprovalIterator is returned from FilterApproval and is used to iterate over the raw logs and unpacked data for Approval events raised by the ERC20 contract. 497 type ERC20ApprovalIterator struct { 498 Event *ERC20Approval // Event containing the contract specifics and raw log 499 500 contract *bind.BoundContract // Generic contract to use for unpacking event data 501 event string // Event name to use for unpacking event data 502 503 logs chan types.Log // Log channel receiving the found contract events 504 sub ethereum.Subscription // Subscription for errors, completion and termination 505 done bool // Whether the subscription completed delivering logs 506 fail error // Occurred error to stop iteration 507 } 508 509 // Next advances the iterator to the subsequent event, returning whether there 510 // are any more events found. In case of a retrieval or parsing error, false is 511 // returned and Error() can be queried for the exact failure. 512 func (it *ERC20ApprovalIterator) Next() bool { 513 // If the iterator failed, stop iterating 514 if it.fail != nil { 515 return false 516 } 517 // If the iterator completed, deliver directly whatever's available 518 if it.done { 519 select { 520 case log := <-it.logs: 521 it.Event = new(ERC20Approval) 522 if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { 523 it.fail = err 524 return false 525 } 526 it.Event.Raw = log 527 return true 528 529 default: 530 return false 531 } 532 } 533 // Iterator still in progress, wait for either a data or an error event 534 select { 535 case log := <-it.logs: 536 it.Event = new(ERC20Approval) 537 if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { 538 it.fail = err 539 return false 540 } 541 it.Event.Raw = log 542 return true 543 544 case err := <-it.sub.Err(): 545 it.done = true 546 it.fail = err 547 return it.Next() 548 } 549 } 550 551 // Error returns any retrieval or parsing error occurred during filtering. 552 func (it *ERC20ApprovalIterator) Error() error { 553 return it.fail 554 } 555 556 // Close terminates the iteration process, releasing any pending underlying 557 // resources. 558 func (it *ERC20ApprovalIterator) Close() error { 559 it.sub.Unsubscribe() 560 return nil 561 } 562 563 // ERC20Approval represents a Approval event raised by the ERC20 contract. 564 type ERC20Approval struct { 565 Owner common.Address 566 Spender common.Address 567 Value *big.Int 568 Raw types.Log // Blockchain specific contextual infos 569 } 570 571 // FilterApproval is a free log retrieval operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. 572 // 573 // Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) 574 func (_ERC20 *ERC20Filterer) FilterApproval(opts *bind.FilterOpts, owner []common.Address, spender []common.Address) (*ERC20ApprovalIterator, error) { 575 576 var ownerRule []interface{} 577 for _, ownerItem := range owner { 578 ownerRule = append(ownerRule, ownerItem) 579 } 580 var spenderRule []interface{} 581 for _, spenderItem := range spender { 582 spenderRule = append(spenderRule, spenderItem) 583 } 584 585 logs, sub, err := _ERC20.contract.FilterLogs(opts, "Approval", ownerRule, spenderRule) 586 if err != nil { 587 return nil, err 588 } 589 return &ERC20ApprovalIterator{contract: _ERC20.contract, event: "Approval", logs: logs, sub: sub}, nil 590 } 591 592 // WatchApproval is a free log subscription operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. 593 // 594 // Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) 595 func (_ERC20 *ERC20Filterer) WatchApproval(opts *bind.WatchOpts, sink chan<- *ERC20Approval, owner []common.Address, spender []common.Address) (event.Subscription, error) { 596 597 var ownerRule []interface{} 598 for _, ownerItem := range owner { 599 ownerRule = append(ownerRule, ownerItem) 600 } 601 var spenderRule []interface{} 602 for _, spenderItem := range spender { 603 spenderRule = append(spenderRule, spenderItem) 604 } 605 606 logs, sub, err := _ERC20.contract.WatchLogs(opts, "Approval", ownerRule, spenderRule) 607 if err != nil { 608 return nil, err 609 } 610 return event.NewSubscription(func(quit <-chan struct{}) error { 611 defer sub.Unsubscribe() 612 for { 613 select { 614 case log := <-logs: 615 // New log arrived, parse the event and forward to the user 616 event := new(ERC20Approval) 617 if err := _ERC20.contract.UnpackLog(event, "Approval", log); err != nil { 618 return err 619 } 620 event.Raw = log 621 622 select { 623 case sink <- event: 624 case err := <-sub.Err(): 625 return err 626 case <-quit: 627 return nil 628 } 629 case err := <-sub.Err(): 630 return err 631 case <-quit: 632 return nil 633 } 634 } 635 }), nil 636 } 637 638 // ParseApproval is a log parse operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. 639 // 640 // Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) 641 func (_ERC20 *ERC20Filterer) ParseApproval(log types.Log) (*ERC20Approval, error) { 642 event := new(ERC20Approval) 643 if err := _ERC20.contract.UnpackLog(event, "Approval", log); err != nil { 644 return nil, err 645 } 646 event.Raw = log 647 return event, nil 648 } 649 650 // ERC20TransferIterator is returned from FilterTransfer and is used to iterate over the raw logs and unpacked data for Transfer events raised by the ERC20 contract. 651 type ERC20TransferIterator struct { 652 Event *ERC20Transfer // Event containing the contract specifics and raw log 653 654 contract *bind.BoundContract // Generic contract to use for unpacking event data 655 event string // Event name to use for unpacking event data 656 657 logs chan types.Log // Log channel receiving the found contract events 658 sub ethereum.Subscription // Subscription for errors, completion and termination 659 done bool // Whether the subscription completed delivering logs 660 fail error // Occurred error to stop iteration 661 } 662 663 // Next advances the iterator to the subsequent event, returning whether there 664 // are any more events found. In case of a retrieval or parsing error, false is 665 // returned and Error() can be queried for the exact failure. 666 func (it *ERC20TransferIterator) Next() bool { 667 // If the iterator failed, stop iterating 668 if it.fail != nil { 669 return false 670 } 671 // If the iterator completed, deliver directly whatever's available 672 if it.done { 673 select { 674 case log := <-it.logs: 675 it.Event = new(ERC20Transfer) 676 if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { 677 it.fail = err 678 return false 679 } 680 it.Event.Raw = log 681 return true 682 683 default: 684 return false 685 } 686 } 687 // Iterator still in progress, wait for either a data or an error event 688 select { 689 case log := <-it.logs: 690 it.Event = new(ERC20Transfer) 691 if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { 692 it.fail = err 693 return false 694 } 695 it.Event.Raw = log 696 return true 697 698 case err := <-it.sub.Err(): 699 it.done = true 700 it.fail = err 701 return it.Next() 702 } 703 } 704 705 // Error returns any retrieval or parsing error occurred during filtering. 706 func (it *ERC20TransferIterator) Error() error { 707 return it.fail 708 } 709 710 // Close terminates the iteration process, releasing any pending underlying 711 // resources. 712 func (it *ERC20TransferIterator) Close() error { 713 it.sub.Unsubscribe() 714 return nil 715 } 716 717 // ERC20Transfer represents a Transfer event raised by the ERC20 contract. 718 type ERC20Transfer struct { 719 From common.Address 720 To common.Address 721 Value *big.Int 722 Raw types.Log // Blockchain specific contextual infos 723 } 724 725 // FilterTransfer is a free log retrieval operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. 726 // 727 // Solidity: event Transfer(address indexed from, address indexed to, uint256 value) 728 func (_ERC20 *ERC20Filterer) FilterTransfer(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*ERC20TransferIterator, error) { 729 730 var fromRule []interface{} 731 for _, fromItem := range from { 732 fromRule = append(fromRule, fromItem) 733 } 734 var toRule []interface{} 735 for _, toItem := range to { 736 toRule = append(toRule, toItem) 737 } 738 739 logs, sub, err := _ERC20.contract.FilterLogs(opts, "Transfer", fromRule, toRule) 740 if err != nil { 741 return nil, err 742 } 743 return &ERC20TransferIterator{contract: _ERC20.contract, event: "Transfer", logs: logs, sub: sub}, nil 744 } 745 746 // WatchTransfer is a free log subscription operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. 747 // 748 // Solidity: event Transfer(address indexed from, address indexed to, uint256 value) 749 func (_ERC20 *ERC20Filterer) WatchTransfer(opts *bind.WatchOpts, sink chan<- *ERC20Transfer, from []common.Address, to []common.Address) (event.Subscription, error) { 750 751 var fromRule []interface{} 752 for _, fromItem := range from { 753 fromRule = append(fromRule, fromItem) 754 } 755 var toRule []interface{} 756 for _, toItem := range to { 757 toRule = append(toRule, toItem) 758 } 759 760 logs, sub, err := _ERC20.contract.WatchLogs(opts, "Transfer", fromRule, toRule) 761 if err != nil { 762 return nil, err 763 } 764 return event.NewSubscription(func(quit <-chan struct{}) error { 765 defer sub.Unsubscribe() 766 for { 767 select { 768 case log := <-logs: 769 // New log arrived, parse the event and forward to the user 770 event := new(ERC20Transfer) 771 if err := _ERC20.contract.UnpackLog(event, "Transfer", log); err != nil { 772 return err 773 } 774 event.Raw = log 775 776 select { 777 case sink <- event: 778 case err := <-sub.Err(): 779 return err 780 case <-quit: 781 return nil 782 } 783 case err := <-sub.Err(): 784 return err 785 case <-quit: 786 return nil 787 } 788 } 789 }), nil 790 } 791 792 // ParseTransfer is a log parse operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. 793 // 794 // Solidity: event Transfer(address indexed from, address indexed to, uint256 value) 795 func (_ERC20 *ERC20Filterer) ParseTransfer(log types.Log) (*ERC20Transfer, error) { 796 event := new(ERC20Transfer) 797 if err := _ERC20.contract.UnpackLog(event, "Transfer", log); err != nil { 798 return nil, err 799 } 800 event.Raw = log 801 return event, nil 802 }