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