github.com/diadata-org/diadata@v1.4.593/internal/pkg/supplyService/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 supplyservice 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 = "[{\"constant\":true,\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_spender\",\"type\":\"address\"},{\"name\":\"_value\",\"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\":\"_from\",\"type\":\"address\"},{\"name\":\"_to\",\"type\":\"address\"},{\"name\":\"_value\",\"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\":\"_owner\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"name\":\"balance\",\"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\":\"_to\",\"type\":\"address\"},{\"name\":\"_value\",\"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\"},{\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"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\"},{\"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\"}]" 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 _owner) view returns(uint256 balance) 208 func (_ERC20 *ERC20Caller) BalanceOf(opts *bind.CallOpts, _owner common.Address) (*big.Int, error) { 209 var out []interface{} 210 err := _ERC20.contract.Call(opts, &out, "balanceOf", _owner) 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 _owner) view returns(uint256 balance) 225 func (_ERC20 *ERC20Session) BalanceOf(_owner common.Address) (*big.Int, error) { 226 return _ERC20.Contract.BalanceOf(&_ERC20.CallOpts, _owner) 227 } 228 229 // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. 230 // 231 // Solidity: function balanceOf(address _owner) view returns(uint256 balance) 232 func (_ERC20 *ERC20CallerSession) BalanceOf(_owner common.Address) (*big.Int, error) { 233 return _ERC20.Contract.BalanceOf(&_ERC20.CallOpts, _owner) 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 _value) returns(bool) 363 func (_ERC20 *ERC20Transactor) Approve(opts *bind.TransactOpts, _spender common.Address, _value *big.Int) (*types.Transaction, error) { 364 return _ERC20.contract.Transact(opts, "approve", _spender, _value) 365 } 366 367 // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. 368 // 369 // Solidity: function approve(address _spender, uint256 _value) returns(bool) 370 func (_ERC20 *ERC20Session) Approve(_spender common.Address, _value *big.Int) (*types.Transaction, error) { 371 return _ERC20.Contract.Approve(&_ERC20.TransactOpts, _spender, _value) 372 } 373 374 // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. 375 // 376 // Solidity: function approve(address _spender, uint256 _value) returns(bool) 377 func (_ERC20 *ERC20TransactorSession) Approve(_spender common.Address, _value *big.Int) (*types.Transaction, error) { 378 return _ERC20.Contract.Approve(&_ERC20.TransactOpts, _spender, _value) 379 } 380 381 // Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. 382 // 383 // Solidity: function transfer(address _to, uint256 _value) returns(bool) 384 func (_ERC20 *ERC20Transactor) Transfer(opts *bind.TransactOpts, _to common.Address, _value *big.Int) (*types.Transaction, error) { 385 return _ERC20.contract.Transact(opts, "transfer", _to, _value) 386 } 387 388 // Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. 389 // 390 // Solidity: function transfer(address _to, uint256 _value) returns(bool) 391 func (_ERC20 *ERC20Session) Transfer(_to common.Address, _value *big.Int) (*types.Transaction, error) { 392 return _ERC20.Contract.Transfer(&_ERC20.TransactOpts, _to, _value) 393 } 394 395 // Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. 396 // 397 // Solidity: function transfer(address _to, uint256 _value) returns(bool) 398 func (_ERC20 *ERC20TransactorSession) Transfer(_to common.Address, _value *big.Int) (*types.Transaction, error) { 399 return _ERC20.Contract.Transfer(&_ERC20.TransactOpts, _to, _value) 400 } 401 402 // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. 403 // 404 // Solidity: function transferFrom(address _from, address _to, uint256 _value) returns(bool) 405 func (_ERC20 *ERC20Transactor) TransferFrom(opts *bind.TransactOpts, _from common.Address, _to common.Address, _value *big.Int) (*types.Transaction, error) { 406 return _ERC20.contract.Transact(opts, "transferFrom", _from, _to, _value) 407 } 408 409 // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. 410 // 411 // Solidity: function transferFrom(address _from, address _to, uint256 _value) returns(bool) 412 func (_ERC20 *ERC20Session) TransferFrom(_from common.Address, _to common.Address, _value *big.Int) (*types.Transaction, error) { 413 return _ERC20.Contract.TransferFrom(&_ERC20.TransactOpts, _from, _to, _value) 414 } 415 416 // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. 417 // 418 // Solidity: function transferFrom(address _from, address _to, uint256 _value) returns(bool) 419 func (_ERC20 *ERC20TransactorSession) TransferFrom(_from common.Address, _to common.Address, _value *big.Int) (*types.Transaction, error) { 420 return _ERC20.Contract.TransferFrom(&_ERC20.TransactOpts, _from, _to, _value) 421 } 422 423 // Fallback is a paid mutator transaction binding the contract fallback function. 424 // 425 // Solidity: fallback() payable returns() 426 func (_ERC20 *ERC20Transactor) Fallback(opts *bind.TransactOpts, calldata []byte) (*types.Transaction, error) { 427 return _ERC20.contract.RawTransact(opts, calldata) 428 } 429 430 // Fallback is a paid mutator transaction binding the contract fallback function. 431 // 432 // Solidity: fallback() payable returns() 433 func (_ERC20 *ERC20Session) Fallback(calldata []byte) (*types.Transaction, error) { 434 return _ERC20.Contract.Fallback(&_ERC20.TransactOpts, calldata) 435 } 436 437 // Fallback is a paid mutator transaction binding the contract fallback function. 438 // 439 // Solidity: fallback() payable returns() 440 func (_ERC20 *ERC20TransactorSession) Fallback(calldata []byte) (*types.Transaction, error) { 441 return _ERC20.Contract.Fallback(&_ERC20.TransactOpts, calldata) 442 } 443 444 // 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. 445 type ERC20ApprovalIterator struct { 446 Event *ERC20Approval // Event containing the contract specifics and raw log 447 448 contract *bind.BoundContract // Generic contract to use for unpacking event data 449 event string // Event name to use for unpacking event data 450 451 logs chan types.Log // Log channel receiving the found contract events 452 sub ethereum.Subscription // Subscription for errors, completion and termination 453 done bool // Whether the subscription completed delivering logs 454 fail error // Occurred error to stop iteration 455 } 456 457 // Next advances the iterator to the subsequent event, returning whether there 458 // are any more events found. In case of a retrieval or parsing error, false is 459 // returned and Error() can be queried for the exact failure. 460 func (it *ERC20ApprovalIterator) Next() bool { 461 // If the iterator failed, stop iterating 462 if it.fail != nil { 463 return false 464 } 465 // If the iterator completed, deliver directly whatever's available 466 if it.done { 467 select { 468 case log := <-it.logs: 469 it.Event = new(ERC20Approval) 470 if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { 471 it.fail = err 472 return false 473 } 474 it.Event.Raw = log 475 return true 476 477 default: 478 return false 479 } 480 } 481 // Iterator still in progress, wait for either a data or an error event 482 select { 483 case log := <-it.logs: 484 it.Event = new(ERC20Approval) 485 if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { 486 it.fail = err 487 return false 488 } 489 it.Event.Raw = log 490 return true 491 492 case err := <-it.sub.Err(): 493 it.done = true 494 it.fail = err 495 return it.Next() 496 } 497 } 498 499 // Error returns any retrieval or parsing error occurred during filtering. 500 func (it *ERC20ApprovalIterator) Error() error { 501 return it.fail 502 } 503 504 // Close terminates the iteration process, releasing any pending underlying 505 // resources. 506 func (it *ERC20ApprovalIterator) Close() error { 507 it.sub.Unsubscribe() 508 return nil 509 } 510 511 // ERC20Approval represents a Approval event raised by the ERC20 contract. 512 type ERC20Approval struct { 513 Owner common.Address 514 Spender common.Address 515 Value *big.Int 516 Raw types.Log // Blockchain specific contextual infos 517 } 518 519 // FilterApproval is a free log retrieval operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. 520 // 521 // Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) 522 func (_ERC20 *ERC20Filterer) FilterApproval(opts *bind.FilterOpts, owner []common.Address, spender []common.Address) (*ERC20ApprovalIterator, error) { 523 524 var ownerRule []interface{} 525 for _, ownerItem := range owner { 526 ownerRule = append(ownerRule, ownerItem) 527 } 528 var spenderRule []interface{} 529 for _, spenderItem := range spender { 530 spenderRule = append(spenderRule, spenderItem) 531 } 532 533 logs, sub, err := _ERC20.contract.FilterLogs(opts, "Approval", ownerRule, spenderRule) 534 if err != nil { 535 return nil, err 536 } 537 return &ERC20ApprovalIterator{contract: _ERC20.contract, event: "Approval", logs: logs, sub: sub}, nil 538 } 539 540 // WatchApproval is a free log subscription operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. 541 // 542 // Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) 543 func (_ERC20 *ERC20Filterer) WatchApproval(opts *bind.WatchOpts, sink chan<- *ERC20Approval, owner []common.Address, spender []common.Address) (event.Subscription, 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.WatchLogs(opts, "Approval", ownerRule, spenderRule) 555 if err != nil { 556 return nil, err 557 } 558 return event.NewSubscription(func(quit <-chan struct{}) error { 559 defer sub.Unsubscribe() 560 for { 561 select { 562 case log := <-logs: 563 // New log arrived, parse the event and forward to the user 564 event := new(ERC20Approval) 565 if err := _ERC20.contract.UnpackLog(event, "Approval", log); err != nil { 566 return err 567 } 568 event.Raw = log 569 570 select { 571 case sink <- event: 572 case err := <-sub.Err(): 573 return err 574 case <-quit: 575 return nil 576 } 577 case err := <-sub.Err(): 578 return err 579 case <-quit: 580 return nil 581 } 582 } 583 }), nil 584 } 585 586 // ParseApproval is a log parse operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. 587 // 588 // Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) 589 func (_ERC20 *ERC20Filterer) ParseApproval(log types.Log) (*ERC20Approval, error) { 590 event := new(ERC20Approval) 591 if err := _ERC20.contract.UnpackLog(event, "Approval", log); err != nil { 592 return nil, err 593 } 594 return event, nil 595 } 596 597 // 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. 598 type ERC20TransferIterator struct { 599 Event *ERC20Transfer // Event containing the contract specifics and raw log 600 601 contract *bind.BoundContract // Generic contract to use for unpacking event data 602 event string // Event name to use for unpacking event data 603 604 logs chan types.Log // Log channel receiving the found contract events 605 sub ethereum.Subscription // Subscription for errors, completion and termination 606 done bool // Whether the subscription completed delivering logs 607 fail error // Occurred error to stop iteration 608 } 609 610 // Next advances the iterator to the subsequent event, returning whether there 611 // are any more events found. In case of a retrieval or parsing error, false is 612 // returned and Error() can be queried for the exact failure. 613 func (it *ERC20TransferIterator) Next() bool { 614 // If the iterator failed, stop iterating 615 if it.fail != nil { 616 return false 617 } 618 // If the iterator completed, deliver directly whatever's available 619 if it.done { 620 select { 621 case log := <-it.logs: 622 it.Event = new(ERC20Transfer) 623 if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { 624 it.fail = err 625 return false 626 } 627 it.Event.Raw = log 628 return true 629 630 default: 631 return false 632 } 633 } 634 // Iterator still in progress, wait for either a data or an error event 635 select { 636 case log := <-it.logs: 637 it.Event = new(ERC20Transfer) 638 if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { 639 it.fail = err 640 return false 641 } 642 it.Event.Raw = log 643 return true 644 645 case err := <-it.sub.Err(): 646 it.done = true 647 it.fail = err 648 return it.Next() 649 } 650 } 651 652 // Error returns any retrieval or parsing error occurred during filtering. 653 func (it *ERC20TransferIterator) Error() error { 654 return it.fail 655 } 656 657 // Close terminates the iteration process, releasing any pending underlying 658 // resources. 659 func (it *ERC20TransferIterator) Close() error { 660 it.sub.Unsubscribe() 661 return nil 662 } 663 664 // ERC20Transfer represents a Transfer event raised by the ERC20 contract. 665 type ERC20Transfer struct { 666 From common.Address 667 To common.Address 668 Value *big.Int 669 Raw types.Log // Blockchain specific contextual infos 670 } 671 672 // FilterTransfer is a free log retrieval operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. 673 // 674 // Solidity: event Transfer(address indexed from, address indexed to, uint256 value) 675 func (_ERC20 *ERC20Filterer) FilterTransfer(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*ERC20TransferIterator, error) { 676 677 var fromRule []interface{} 678 for _, fromItem := range from { 679 fromRule = append(fromRule, fromItem) 680 } 681 var toRule []interface{} 682 for _, toItem := range to { 683 toRule = append(toRule, toItem) 684 } 685 686 logs, sub, err := _ERC20.contract.FilterLogs(opts, "Transfer", fromRule, toRule) 687 if err != nil { 688 return nil, err 689 } 690 return &ERC20TransferIterator{contract: _ERC20.contract, event: "Transfer", logs: logs, sub: sub}, nil 691 } 692 693 // WatchTransfer is a free log subscription operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. 694 // 695 // Solidity: event Transfer(address indexed from, address indexed to, uint256 value) 696 func (_ERC20 *ERC20Filterer) WatchTransfer(opts *bind.WatchOpts, sink chan<- *ERC20Transfer, from []common.Address, to []common.Address) (event.Subscription, error) { 697 698 var fromRule []interface{} 699 for _, fromItem := range from { 700 fromRule = append(fromRule, fromItem) 701 } 702 var toRule []interface{} 703 for _, toItem := range to { 704 toRule = append(toRule, toItem) 705 } 706 707 logs, sub, err := _ERC20.contract.WatchLogs(opts, "Transfer", fromRule, toRule) 708 if err != nil { 709 return nil, err 710 } 711 return event.NewSubscription(func(quit <-chan struct{}) error { 712 defer sub.Unsubscribe() 713 for { 714 select { 715 case log := <-logs: 716 // New log arrived, parse the event and forward to the user 717 event := new(ERC20Transfer) 718 if err := _ERC20.contract.UnpackLog(event, "Transfer", log); err != nil { 719 return err 720 } 721 event.Raw = log 722 723 select { 724 case sink <- event: 725 case err := <-sub.Err(): 726 return err 727 case <-quit: 728 return nil 729 } 730 case err := <-sub.Err(): 731 return err 732 case <-quit: 733 return nil 734 } 735 } 736 }), nil 737 } 738 739 // ParseTransfer is a log parse operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. 740 // 741 // Solidity: event Transfer(address indexed from, address indexed to, uint256 value) 742 func (_ERC20 *ERC20Filterer) ParseTransfer(log types.Log) (*ERC20Transfer, error) { 743 event := new(ERC20Transfer) 744 if err := _ERC20.contract.UnpackLog(event, "Transfer", log); err != nil { 745 return nil, err 746 } 747 return event, nil 748 }