github.com/0chain/gosdk@v1.17.11/zcnbridge/ethereum/zcntoken/zcntoken.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 zcntoken 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 // TokenMetaData contains all meta data concerning the Token contract. 33 var TokenMetaData = &bind.MetaData{ 34 ABI: "[{\"constant\":true,\"inputs\":[],\"name\":\"mintingFinished\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"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\":false,\"inputs\":[{\"name\":\"_to\",\"type\":\"address\"},{\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"mint\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_spender\",\"type\":\"address\"},{\"name\":\"_subtractedValue\",\"type\":\"uint256\"}],\"name\":\"decreaseApproval\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_owner\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"name\":\"balance\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"finishMinting\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"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\":false,\"inputs\":[{\"name\":\"_spender\",\"type\":\"address\"},{\"name\":\"_addedValue\",\"type\":\"uint256\"}],\"name\":\"increaseApproval\",\"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\"},{\"constant\":false,\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Mint\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"MintFinished\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"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\"}]", 35 } 36 37 // TokenABI is the input ABI used to generate the binding from. 38 // Deprecated: Use TokenMetaData.ABI instead. 39 var TokenABI = TokenMetaData.ABI 40 41 // Token is an auto generated Go binding around an Ethereum contract. 42 type Token struct { 43 TokenCaller // Read-only binding to the contract 44 TokenTransactor // Write-only binding to the contract 45 TokenFilterer // Log filterer for contract events 46 } 47 48 // TokenCaller is an auto generated read-only Go binding around an Ethereum contract. 49 type TokenCaller struct { 50 contract *bind.BoundContract // Generic contract wrapper for the low level calls 51 } 52 53 // TokenTransactor is an auto generated write-only Go binding around an Ethereum contract. 54 type TokenTransactor struct { 55 contract *bind.BoundContract // Generic contract wrapper for the low level calls 56 } 57 58 // TokenFilterer is an auto generated log filtering Go binding around an Ethereum contract events. 59 type TokenFilterer struct { 60 contract *bind.BoundContract // Generic contract wrapper for the low level calls 61 } 62 63 // TokenSession is an auto generated Go binding around an Ethereum contract, 64 // with pre-set call and transact options. 65 type TokenSession struct { 66 Contract *Token // Generic contract binding to set the session for 67 CallOpts bind.CallOpts // Call options to use throughout this session 68 TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session 69 } 70 71 // TokenCallerSession is an auto generated read-only Go binding around an Ethereum contract, 72 // with pre-set call options. 73 type TokenCallerSession struct { 74 Contract *TokenCaller // Generic contract caller binding to set the session for 75 CallOpts bind.CallOpts // Call options to use throughout this session 76 } 77 78 // TokenTransactorSession is an auto generated write-only Go binding around an Ethereum contract, 79 // with pre-set transact options. 80 type TokenTransactorSession struct { 81 Contract *TokenTransactor // Generic contract transactor binding to set the session for 82 TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session 83 } 84 85 // TokenRaw is an auto generated low-level Go binding around an Ethereum contract. 86 type TokenRaw struct { 87 Contract *Token // Generic contract binding to access the raw methods on 88 } 89 90 // TokenCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. 91 type TokenCallerRaw struct { 92 Contract *TokenCaller // Generic read-only contract binding to access the raw methods on 93 } 94 95 // TokenTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. 96 type TokenTransactorRaw struct { 97 Contract *TokenTransactor // Generic write-only contract binding to access the raw methods on 98 } 99 100 // NewToken creates a new instance of Token, bound to a specific deployed contract. 101 func NewToken(address common.Address, backend bind.ContractBackend) (*Token, error) { 102 contract, err := bindToken(address, backend, backend, backend) 103 if err != nil { 104 return nil, err 105 } 106 return &Token{TokenCaller: TokenCaller{contract: contract}, TokenTransactor: TokenTransactor{contract: contract}, TokenFilterer: TokenFilterer{contract: contract}}, nil 107 } 108 109 // NewTokenCaller creates a new read-only instance of Token, bound to a specific deployed contract. 110 func NewTokenCaller(address common.Address, caller bind.ContractCaller) (*TokenCaller, error) { 111 contract, err := bindToken(address, caller, nil, nil) 112 if err != nil { 113 return nil, err 114 } 115 return &TokenCaller{contract: contract}, nil 116 } 117 118 // NewTokenTransactor creates a new write-only instance of Token, bound to a specific deployed contract. 119 func NewTokenTransactor(address common.Address, transactor bind.ContractTransactor) (*TokenTransactor, error) { 120 contract, err := bindToken(address, nil, transactor, nil) 121 if err != nil { 122 return nil, err 123 } 124 return &TokenTransactor{contract: contract}, nil 125 } 126 127 // NewTokenFilterer creates a new log filterer instance of Token, bound to a specific deployed contract. 128 func NewTokenFilterer(address common.Address, filterer bind.ContractFilterer) (*TokenFilterer, error) { 129 contract, err := bindToken(address, nil, nil, filterer) 130 if err != nil { 131 return nil, err 132 } 133 return &TokenFilterer{contract: contract}, nil 134 } 135 136 // bindToken binds a generic wrapper to an already deployed contract. 137 func bindToken(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { 138 parsed, err := TokenMetaData.GetAbi() 139 if err != nil { 140 return nil, err 141 } 142 return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil 143 } 144 145 // Call invokes the (constant) contract method with params as input values and 146 // sets the output to result. The result type might be a single field for simple 147 // returns, a slice of interfaces for anonymous returns and a struct for named 148 // returns. 149 func (_Token *TokenRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { 150 return _Token.Contract.TokenCaller.contract.Call(opts, result, method, params...) 151 } 152 153 // Transfer initiates a plain transaction to move funds to the contract, calling 154 // its default method if one is available. 155 func (_Token *TokenRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { 156 return _Token.Contract.TokenTransactor.contract.Transfer(opts) 157 } 158 159 // Transact invokes the (paid) contract method with params as input values. 160 func (_Token *TokenRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { 161 return _Token.Contract.TokenTransactor.contract.Transact(opts, method, params...) 162 } 163 164 // Call invokes the (constant) contract method with params as input values and 165 // sets the output to result. The result type might be a single field for simple 166 // returns, a slice of interfaces for anonymous returns and a struct for named 167 // returns. 168 func (_Token *TokenCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { 169 return _Token.Contract.contract.Call(opts, result, method, params...) 170 } 171 172 // Transfer initiates a plain transaction to move funds to the contract, calling 173 // its default method if one is available. 174 func (_Token *TokenTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { 175 return _Token.Contract.contract.Transfer(opts) 176 } 177 178 // Transact invokes the (paid) contract method with params as input values. 179 func (_Token *TokenTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { 180 return _Token.Contract.contract.Transact(opts, method, params...) 181 } 182 183 // Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. 184 // 185 // Solidity: function allowance(address _owner, address _spender) view returns(uint256) 186 func (_Token *TokenCaller) Allowance(opts *bind.CallOpts, _owner common.Address, _spender common.Address) (*big.Int, error) { 187 var out []interface{} 188 err := _Token.contract.Call(opts, &out, "allowance", _owner, _spender) 189 190 if err != nil { 191 return *new(*big.Int), err 192 } 193 194 out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) 195 196 return out0, err 197 198 } 199 200 // Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. 201 // 202 // Solidity: function allowance(address _owner, address _spender) view returns(uint256) 203 func (_Token *TokenSession) Allowance(_owner common.Address, _spender common.Address) (*big.Int, error) { 204 return _Token.Contract.Allowance(&_Token.CallOpts, _owner, _spender) 205 } 206 207 // Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. 208 // 209 // Solidity: function allowance(address _owner, address _spender) view returns(uint256) 210 func (_Token *TokenCallerSession) Allowance(_owner common.Address, _spender common.Address) (*big.Int, error) { 211 return _Token.Contract.Allowance(&_Token.CallOpts, _owner, _spender) 212 } 213 214 // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. 215 // 216 // Solidity: function balanceOf(address _owner) view returns(uint256 balance) 217 func (_Token *TokenCaller) BalanceOf(opts *bind.CallOpts, _owner common.Address) (*big.Int, error) { 218 var out []interface{} 219 err := _Token.contract.Call(opts, &out, "balanceOf", _owner) 220 221 if err != nil { 222 return *new(*big.Int), err 223 } 224 225 out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) 226 227 return out0, err 228 229 } 230 231 // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. 232 // 233 // Solidity: function balanceOf(address _owner) view returns(uint256 balance) 234 func (_Token *TokenSession) BalanceOf(_owner common.Address) (*big.Int, error) { 235 return _Token.Contract.BalanceOf(&_Token.CallOpts, _owner) 236 } 237 238 // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. 239 // 240 // Solidity: function balanceOf(address _owner) view returns(uint256 balance) 241 func (_Token *TokenCallerSession) BalanceOf(_owner common.Address) (*big.Int, error) { 242 return _Token.Contract.BalanceOf(&_Token.CallOpts, _owner) 243 } 244 245 // Decimals is a free data retrieval call binding the contract method 0x313ce567. 246 // 247 // Solidity: function decimals() view returns(uint8) 248 func (_Token *TokenCaller) Decimals(opts *bind.CallOpts) (uint8, error) { 249 var out []interface{} 250 err := _Token.contract.Call(opts, &out, "decimals") 251 252 if err != nil { 253 return *new(uint8), err 254 } 255 256 out0 := *abi.ConvertType(out[0], new(uint8)).(*uint8) 257 258 return out0, err 259 260 } 261 262 // Decimals is a free data retrieval call binding the contract method 0x313ce567. 263 // 264 // Solidity: function decimals() view returns(uint8) 265 func (_Token *TokenSession) Decimals() (uint8, error) { 266 return _Token.Contract.Decimals(&_Token.CallOpts) 267 } 268 269 // Decimals is a free data retrieval call binding the contract method 0x313ce567. 270 // 271 // Solidity: function decimals() view returns(uint8) 272 func (_Token *TokenCallerSession) Decimals() (uint8, error) { 273 return _Token.Contract.Decimals(&_Token.CallOpts) 274 } 275 276 // MintingFinished is a free data retrieval call binding the contract method 0x05d2035b. 277 // 278 // Solidity: function mintingFinished() view returns(bool) 279 func (_Token *TokenCaller) MintingFinished(opts *bind.CallOpts) (bool, error) { 280 var out []interface{} 281 err := _Token.contract.Call(opts, &out, "mintingFinished") 282 283 if err != nil { 284 return *new(bool), err 285 } 286 287 out0 := *abi.ConvertType(out[0], new(bool)).(*bool) 288 289 return out0, err 290 291 } 292 293 // MintingFinished is a free data retrieval call binding the contract method 0x05d2035b. 294 // 295 // Solidity: function mintingFinished() view returns(bool) 296 func (_Token *TokenSession) MintingFinished() (bool, error) { 297 return _Token.Contract.MintingFinished(&_Token.CallOpts) 298 } 299 300 // MintingFinished is a free data retrieval call binding the contract method 0x05d2035b. 301 // 302 // Solidity: function mintingFinished() view returns(bool) 303 func (_Token *TokenCallerSession) MintingFinished() (bool, error) { 304 return _Token.Contract.MintingFinished(&_Token.CallOpts) 305 } 306 307 // Name is a free data retrieval call binding the contract method 0x06fdde03. 308 // 309 // Solidity: function name() view returns(string) 310 func (_Token *TokenCaller) Name(opts *bind.CallOpts) (string, error) { 311 var out []interface{} 312 err := _Token.contract.Call(opts, &out, "name") 313 314 if err != nil { 315 return *new(string), err 316 } 317 318 out0 := *abi.ConvertType(out[0], new(string)).(*string) 319 320 return out0, err 321 322 } 323 324 // Name is a free data retrieval call binding the contract method 0x06fdde03. 325 // 326 // Solidity: function name() view returns(string) 327 func (_Token *TokenSession) Name() (string, error) { 328 return _Token.Contract.Name(&_Token.CallOpts) 329 } 330 331 // Name is a free data retrieval call binding the contract method 0x06fdde03. 332 // 333 // Solidity: function name() view returns(string) 334 func (_Token *TokenCallerSession) Name() (string, error) { 335 return _Token.Contract.Name(&_Token.CallOpts) 336 } 337 338 // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. 339 // 340 // Solidity: function owner() view returns(address) 341 func (_Token *TokenCaller) Owner(opts *bind.CallOpts) (common.Address, error) { 342 var out []interface{} 343 err := _Token.contract.Call(opts, &out, "owner") 344 345 if err != nil { 346 return *new(common.Address), err 347 } 348 349 out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) 350 351 return out0, err 352 353 } 354 355 // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. 356 // 357 // Solidity: function owner() view returns(address) 358 func (_Token *TokenSession) Owner() (common.Address, error) { 359 return _Token.Contract.Owner(&_Token.CallOpts) 360 } 361 362 // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. 363 // 364 // Solidity: function owner() view returns(address) 365 func (_Token *TokenCallerSession) Owner() (common.Address, error) { 366 return _Token.Contract.Owner(&_Token.CallOpts) 367 } 368 369 // Symbol is a free data retrieval call binding the contract method 0x95d89b41. 370 // 371 // Solidity: function symbol() view returns(string) 372 func (_Token *TokenCaller) Symbol(opts *bind.CallOpts) (string, error) { 373 var out []interface{} 374 err := _Token.contract.Call(opts, &out, "symbol") 375 376 if err != nil { 377 return *new(string), err 378 } 379 380 out0 := *abi.ConvertType(out[0], new(string)).(*string) 381 382 return out0, err 383 384 } 385 386 // Symbol is a free data retrieval call binding the contract method 0x95d89b41. 387 // 388 // Solidity: function symbol() view returns(string) 389 func (_Token *TokenSession) Symbol() (string, error) { 390 return _Token.Contract.Symbol(&_Token.CallOpts) 391 } 392 393 // Symbol is a free data retrieval call binding the contract method 0x95d89b41. 394 // 395 // Solidity: function symbol() view returns(string) 396 func (_Token *TokenCallerSession) Symbol() (string, error) { 397 return _Token.Contract.Symbol(&_Token.CallOpts) 398 } 399 400 // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. 401 // 402 // Solidity: function totalSupply() view returns(uint256) 403 func (_Token *TokenCaller) TotalSupply(opts *bind.CallOpts) (*big.Int, error) { 404 var out []interface{} 405 err := _Token.contract.Call(opts, &out, "totalSupply") 406 407 if err != nil { 408 return *new(*big.Int), err 409 } 410 411 out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) 412 413 return out0, err 414 415 } 416 417 // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. 418 // 419 // Solidity: function totalSupply() view returns(uint256) 420 func (_Token *TokenSession) TotalSupply() (*big.Int, error) { 421 return _Token.Contract.TotalSupply(&_Token.CallOpts) 422 } 423 424 // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. 425 // 426 // Solidity: function totalSupply() view returns(uint256) 427 func (_Token *TokenCallerSession) TotalSupply() (*big.Int, error) { 428 return _Token.Contract.TotalSupply(&_Token.CallOpts) 429 } 430 431 // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. 432 // 433 // Solidity: function approve(address _spender, uint256 _value) returns(bool) 434 func (_Token *TokenTransactor) Approve(opts *bind.TransactOpts, _spender common.Address, _value *big.Int) (*types.Transaction, error) { 435 return _Token.contract.Transact(opts, "approve", _spender, _value) 436 } 437 438 // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. 439 // 440 // Solidity: function approve(address _spender, uint256 _value) returns(bool) 441 func (_Token *TokenSession) Approve(_spender common.Address, _value *big.Int) (*types.Transaction, error) { 442 return _Token.Contract.Approve(&_Token.TransactOpts, _spender, _value) 443 } 444 445 // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. 446 // 447 // Solidity: function approve(address _spender, uint256 _value) returns(bool) 448 func (_Token *TokenTransactorSession) Approve(_spender common.Address, _value *big.Int) (*types.Transaction, error) { 449 return _Token.Contract.Approve(&_Token.TransactOpts, _spender, _value) 450 } 451 452 // DecreaseApproval is a paid mutator transaction binding the contract method 0x66188463. 453 // 454 // Solidity: function decreaseApproval(address _spender, uint256 _subtractedValue) returns(bool) 455 func (_Token *TokenTransactor) DecreaseApproval(opts *bind.TransactOpts, _spender common.Address, _subtractedValue *big.Int) (*types.Transaction, error) { 456 return _Token.contract.Transact(opts, "decreaseApproval", _spender, _subtractedValue) 457 } 458 459 // DecreaseApproval is a paid mutator transaction binding the contract method 0x66188463. 460 // 461 // Solidity: function decreaseApproval(address _spender, uint256 _subtractedValue) returns(bool) 462 func (_Token *TokenSession) DecreaseApproval(_spender common.Address, _subtractedValue *big.Int) (*types.Transaction, error) { 463 return _Token.Contract.DecreaseApproval(&_Token.TransactOpts, _spender, _subtractedValue) 464 } 465 466 // DecreaseApproval is a paid mutator transaction binding the contract method 0x66188463. 467 // 468 // Solidity: function decreaseApproval(address _spender, uint256 _subtractedValue) returns(bool) 469 func (_Token *TokenTransactorSession) DecreaseApproval(_spender common.Address, _subtractedValue *big.Int) (*types.Transaction, error) { 470 return _Token.Contract.DecreaseApproval(&_Token.TransactOpts, _spender, _subtractedValue) 471 } 472 473 // FinishMinting is a paid mutator transaction binding the contract method 0x7d64bcb4. 474 // 475 // Solidity: function finishMinting() returns(bool) 476 func (_Token *TokenTransactor) FinishMinting(opts *bind.TransactOpts) (*types.Transaction, error) { 477 return _Token.contract.Transact(opts, "finishMinting") 478 } 479 480 // FinishMinting is a paid mutator transaction binding the contract method 0x7d64bcb4. 481 // 482 // Solidity: function finishMinting() returns(bool) 483 func (_Token *TokenSession) FinishMinting() (*types.Transaction, error) { 484 return _Token.Contract.FinishMinting(&_Token.TransactOpts) 485 } 486 487 // FinishMinting is a paid mutator transaction binding the contract method 0x7d64bcb4. 488 // 489 // Solidity: function finishMinting() returns(bool) 490 func (_Token *TokenTransactorSession) FinishMinting() (*types.Transaction, error) { 491 return _Token.Contract.FinishMinting(&_Token.TransactOpts) 492 } 493 494 // IncreaseApproval is a paid mutator transaction binding the contract method 0xd73dd623. 495 // 496 // Solidity: function increaseApproval(address _spender, uint256 _addedValue) returns(bool) 497 func (_Token *TokenTransactor) IncreaseApproval(opts *bind.TransactOpts, _spender common.Address, _addedValue *big.Int) (*types.Transaction, error) { 498 return _Token.contract.Transact(opts, "increaseApproval", _spender, _addedValue) 499 } 500 501 // IncreaseApproval is a paid mutator transaction binding the contract method 0xd73dd623. 502 // 503 // Solidity: function increaseApproval(address _spender, uint256 _addedValue) returns(bool) 504 func (_Token *TokenSession) IncreaseApproval(_spender common.Address, _addedValue *big.Int) (*types.Transaction, error) { 505 return _Token.Contract.IncreaseApproval(&_Token.TransactOpts, _spender, _addedValue) 506 } 507 508 // IncreaseApproval is a paid mutator transaction binding the contract method 0xd73dd623. 509 // 510 // Solidity: function increaseApproval(address _spender, uint256 _addedValue) returns(bool) 511 func (_Token *TokenTransactorSession) IncreaseApproval(_spender common.Address, _addedValue *big.Int) (*types.Transaction, error) { 512 return _Token.Contract.IncreaseApproval(&_Token.TransactOpts, _spender, _addedValue) 513 } 514 515 // Mint is a paid mutator transaction binding the contract method 0x40c10f19. 516 // 517 // Solidity: function mint(address _to, uint256 _amount) returns(bool) 518 func (_Token *TokenTransactor) Mint(opts *bind.TransactOpts, _to common.Address, _amount *big.Int) (*types.Transaction, error) { 519 return _Token.contract.Transact(opts, "mint", _to, _amount) 520 } 521 522 // Mint is a paid mutator transaction binding the contract method 0x40c10f19. 523 // 524 // Solidity: function mint(address _to, uint256 _amount) returns(bool) 525 func (_Token *TokenSession) Mint(_to common.Address, _amount *big.Int) (*types.Transaction, error) { 526 return _Token.Contract.Mint(&_Token.TransactOpts, _to, _amount) 527 } 528 529 // Mint is a paid mutator transaction binding the contract method 0x40c10f19. 530 // 531 // Solidity: function mint(address _to, uint256 _amount) returns(bool) 532 func (_Token *TokenTransactorSession) Mint(_to common.Address, _amount *big.Int) (*types.Transaction, error) { 533 return _Token.Contract.Mint(&_Token.TransactOpts, _to, _amount) 534 } 535 536 // Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. 537 // 538 // Solidity: function transfer(address _to, uint256 _value) returns(bool) 539 func (_Token *TokenTransactor) Transfer(opts *bind.TransactOpts, _to common.Address, _value *big.Int) (*types.Transaction, error) { 540 return _Token.contract.Transact(opts, "transfer", _to, _value) 541 } 542 543 // Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. 544 // 545 // Solidity: function transfer(address _to, uint256 _value) returns(bool) 546 func (_Token *TokenSession) Transfer(_to common.Address, _value *big.Int) (*types.Transaction, error) { 547 return _Token.Contract.Transfer(&_Token.TransactOpts, _to, _value) 548 } 549 550 // Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. 551 // 552 // Solidity: function transfer(address _to, uint256 _value) returns(bool) 553 func (_Token *TokenTransactorSession) Transfer(_to common.Address, _value *big.Int) (*types.Transaction, error) { 554 return _Token.Contract.Transfer(&_Token.TransactOpts, _to, _value) 555 } 556 557 // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. 558 // 559 // Solidity: function transferFrom(address _from, address _to, uint256 _value) returns(bool) 560 func (_Token *TokenTransactor) TransferFrom(opts *bind.TransactOpts, _from common.Address, _to common.Address, _value *big.Int) (*types.Transaction, error) { 561 return _Token.contract.Transact(opts, "transferFrom", _from, _to, _value) 562 } 563 564 // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. 565 // 566 // Solidity: function transferFrom(address _from, address _to, uint256 _value) returns(bool) 567 func (_Token *TokenSession) TransferFrom(_from common.Address, _to common.Address, _value *big.Int) (*types.Transaction, error) { 568 return _Token.Contract.TransferFrom(&_Token.TransactOpts, _from, _to, _value) 569 } 570 571 // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. 572 // 573 // Solidity: function transferFrom(address _from, address _to, uint256 _value) returns(bool) 574 func (_Token *TokenTransactorSession) TransferFrom(_from common.Address, _to common.Address, _value *big.Int) (*types.Transaction, error) { 575 return _Token.Contract.TransferFrom(&_Token.TransactOpts, _from, _to, _value) 576 } 577 578 // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. 579 // 580 // Solidity: function transferOwnership(address newOwner) returns() 581 func (_Token *TokenTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) { 582 return _Token.contract.Transact(opts, "transferOwnership", newOwner) 583 } 584 585 // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. 586 // 587 // Solidity: function transferOwnership(address newOwner) returns() 588 func (_Token *TokenSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { 589 return _Token.Contract.TransferOwnership(&_Token.TransactOpts, newOwner) 590 } 591 592 // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. 593 // 594 // Solidity: function transferOwnership(address newOwner) returns() 595 func (_Token *TokenTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { 596 return _Token.Contract.TransferOwnership(&_Token.TransactOpts, newOwner) 597 } 598 599 // TokenApprovalIterator is returned from FilterApproval and is used to iterate over the raw logs and unpacked data for Approval events raised by the Token contract. 600 type TokenApprovalIterator struct { 601 Event *TokenApproval // Event containing the contract specifics and raw log 602 603 contract *bind.BoundContract // Generic contract to use for unpacking event data 604 event string // Event name to use for unpacking event data 605 606 logs chan types.Log // Log channel receiving the found contract events 607 sub ethereum.Subscription // Subscription for errors, completion and termination 608 done bool // Whether the subscription completed delivering logs 609 fail error // Occurred error to stop iteration 610 } 611 612 // Next advances the iterator to the subsequent event, returning whether there 613 // are any more events found. In case of a retrieval or parsing error, false is 614 // returned and Error() can be queried for the exact failure. 615 func (it *TokenApprovalIterator) Next() bool { 616 // If the iterator failed, stop iterating 617 if it.fail != nil { 618 return false 619 } 620 // If the iterator completed, deliver directly whatever's available 621 if it.done { 622 select { 623 case log := <-it.logs: 624 it.Event = new(TokenApproval) 625 if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { 626 it.fail = err 627 return false 628 } 629 it.Event.Raw = log 630 return true 631 632 default: 633 return false 634 } 635 } 636 // Iterator still in progress, wait for either a data or an error event 637 select { 638 case log := <-it.logs: 639 it.Event = new(TokenApproval) 640 if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { 641 it.fail = err 642 return false 643 } 644 it.Event.Raw = log 645 return true 646 647 case err := <-it.sub.Err(): 648 it.done = true 649 it.fail = err 650 return it.Next() 651 } 652 } 653 654 // Error returns any retrieval or parsing error occurred during filtering. 655 func (it *TokenApprovalIterator) Error() error { 656 return it.fail 657 } 658 659 // Close terminates the iteration process, releasing any pending underlying 660 // resources. 661 func (it *TokenApprovalIterator) Close() error { 662 it.sub.Unsubscribe() 663 return nil 664 } 665 666 // TokenApproval represents a Approval event raised by the Token contract. 667 type TokenApproval struct { 668 Owner common.Address 669 Spender common.Address 670 Value *big.Int 671 Raw types.Log // Blockchain specific contextual infos 672 } 673 674 // FilterApproval is a free log retrieval operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. 675 // 676 // Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) 677 func (_Token *TokenFilterer) FilterApproval(opts *bind.FilterOpts, owner []common.Address, spender []common.Address) (*TokenApprovalIterator, error) { 678 679 var ownerRule []interface{} 680 for _, ownerItem := range owner { 681 ownerRule = append(ownerRule, ownerItem) 682 } 683 var spenderRule []interface{} 684 for _, spenderItem := range spender { 685 spenderRule = append(spenderRule, spenderItem) 686 } 687 688 logs, sub, err := _Token.contract.FilterLogs(opts, "Approval", ownerRule, spenderRule) 689 if err != nil { 690 return nil, err 691 } 692 return &TokenApprovalIterator{contract: _Token.contract, event: "Approval", logs: logs, sub: sub}, nil 693 } 694 695 // WatchApproval is a free log subscription operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. 696 // 697 // Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) 698 func (_Token *TokenFilterer) WatchApproval(opts *bind.WatchOpts, sink chan<- *TokenApproval, owner []common.Address, spender []common.Address) (event.Subscription, error) { 699 700 var ownerRule []interface{} 701 for _, ownerItem := range owner { 702 ownerRule = append(ownerRule, ownerItem) 703 } 704 var spenderRule []interface{} 705 for _, spenderItem := range spender { 706 spenderRule = append(spenderRule, spenderItem) 707 } 708 709 logs, sub, err := _Token.contract.WatchLogs(opts, "Approval", ownerRule, spenderRule) 710 if err != nil { 711 return nil, err 712 } 713 return event.NewSubscription(func(quit <-chan struct{}) error { 714 defer sub.Unsubscribe() 715 for { 716 select { 717 case log := <-logs: 718 // New log arrived, parse the event and forward to the user 719 event := new(TokenApproval) 720 if err := _Token.contract.UnpackLog(event, "Approval", log); err != nil { 721 return err 722 } 723 event.Raw = log 724 725 select { 726 case sink <- event: 727 case err := <-sub.Err(): 728 return err 729 case <-quit: 730 return nil 731 } 732 case err := <-sub.Err(): 733 return err 734 case <-quit: 735 return nil 736 } 737 } 738 }), nil 739 } 740 741 // ParseApproval is a log parse operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. 742 // 743 // Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) 744 func (_Token *TokenFilterer) ParseApproval(log types.Log) (*TokenApproval, error) { 745 event := new(TokenApproval) 746 if err := _Token.contract.UnpackLog(event, "Approval", log); err != nil { 747 return nil, err 748 } 749 event.Raw = log 750 return event, nil 751 } 752 753 // TokenMintIterator is returned from FilterMint and is used to iterate over the raw logs and unpacked data for Mint events raised by the Token contract. 754 type TokenMintIterator struct { 755 Event *TokenMint // Event containing the contract specifics and raw log 756 757 contract *bind.BoundContract // Generic contract to use for unpacking event data 758 event string // Event name to use for unpacking event data 759 760 logs chan types.Log // Log channel receiving the found contract events 761 sub ethereum.Subscription // Subscription for errors, completion and termination 762 done bool // Whether the subscription completed delivering logs 763 fail error // Occurred error to stop iteration 764 } 765 766 // Next advances the iterator to the subsequent event, returning whether there 767 // are any more events found. In case of a retrieval or parsing error, false is 768 // returned and Error() can be queried for the exact failure. 769 func (it *TokenMintIterator) Next() bool { 770 // If the iterator failed, stop iterating 771 if it.fail != nil { 772 return false 773 } 774 // If the iterator completed, deliver directly whatever's available 775 if it.done { 776 select { 777 case log := <-it.logs: 778 it.Event = new(TokenMint) 779 if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { 780 it.fail = err 781 return false 782 } 783 it.Event.Raw = log 784 return true 785 786 default: 787 return false 788 } 789 } 790 // Iterator still in progress, wait for either a data or an error event 791 select { 792 case log := <-it.logs: 793 it.Event = new(TokenMint) 794 if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { 795 it.fail = err 796 return false 797 } 798 it.Event.Raw = log 799 return true 800 801 case err := <-it.sub.Err(): 802 it.done = true 803 it.fail = err 804 return it.Next() 805 } 806 } 807 808 // Error returns any retrieval or parsing error occurred during filtering. 809 func (it *TokenMintIterator) Error() error { 810 return it.fail 811 } 812 813 // Close terminates the iteration process, releasing any pending underlying 814 // resources. 815 func (it *TokenMintIterator) Close() error { 816 it.sub.Unsubscribe() 817 return nil 818 } 819 820 // TokenMint represents a Mint event raised by the Token contract. 821 type TokenMint struct { 822 To common.Address 823 Amount *big.Int 824 Raw types.Log // Blockchain specific contextual infos 825 } 826 827 // FilterMint is a free log retrieval operation binding the contract event 0x0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885. 828 // 829 // Solidity: event Mint(address indexed to, uint256 amount) 830 func (_Token *TokenFilterer) FilterMint(opts *bind.FilterOpts, to []common.Address) (*TokenMintIterator, error) { 831 832 var toRule []interface{} 833 for _, toItem := range to { 834 toRule = append(toRule, toItem) 835 } 836 837 logs, sub, err := _Token.contract.FilterLogs(opts, "Mint", toRule) 838 if err != nil { 839 return nil, err 840 } 841 return &TokenMintIterator{contract: _Token.contract, event: "Mint", logs: logs, sub: sub}, nil 842 } 843 844 // WatchMint is a free log subscription operation binding the contract event 0x0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885. 845 // 846 // Solidity: event Mint(address indexed to, uint256 amount) 847 func (_Token *TokenFilterer) WatchMint(opts *bind.WatchOpts, sink chan<- *TokenMint, to []common.Address) (event.Subscription, error) { 848 849 var toRule []interface{} 850 for _, toItem := range to { 851 toRule = append(toRule, toItem) 852 } 853 854 logs, sub, err := _Token.contract.WatchLogs(opts, "Mint", toRule) 855 if err != nil { 856 return nil, err 857 } 858 return event.NewSubscription(func(quit <-chan struct{}) error { 859 defer sub.Unsubscribe() 860 for { 861 select { 862 case log := <-logs: 863 // New log arrived, parse the event and forward to the user 864 event := new(TokenMint) 865 if err := _Token.contract.UnpackLog(event, "Mint", log); err != nil { 866 return err 867 } 868 event.Raw = log 869 870 select { 871 case sink <- event: 872 case err := <-sub.Err(): 873 return err 874 case <-quit: 875 return nil 876 } 877 case err := <-sub.Err(): 878 return err 879 case <-quit: 880 return nil 881 } 882 } 883 }), nil 884 } 885 886 // ParseMint is a log parse operation binding the contract event 0x0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885. 887 // 888 // Solidity: event Mint(address indexed to, uint256 amount) 889 func (_Token *TokenFilterer) ParseMint(log types.Log) (*TokenMint, error) { 890 event := new(TokenMint) 891 if err := _Token.contract.UnpackLog(event, "Mint", log); err != nil { 892 return nil, err 893 } 894 event.Raw = log 895 return event, nil 896 } 897 898 // TokenMintFinishedIterator is returned from FilterMintFinished and is used to iterate over the raw logs and unpacked data for MintFinished events raised by the Token contract. 899 type TokenMintFinishedIterator struct { 900 Event *TokenMintFinished // Event containing the contract specifics and raw log 901 902 contract *bind.BoundContract // Generic contract to use for unpacking event data 903 event string // Event name to use for unpacking event data 904 905 logs chan types.Log // Log channel receiving the found contract events 906 sub ethereum.Subscription // Subscription for errors, completion and termination 907 done bool // Whether the subscription completed delivering logs 908 fail error // Occurred error to stop iteration 909 } 910 911 // Next advances the iterator to the subsequent event, returning whether there 912 // are any more events found. In case of a retrieval or parsing error, false is 913 // returned and Error() can be queried for the exact failure. 914 func (it *TokenMintFinishedIterator) Next() bool { 915 // If the iterator failed, stop iterating 916 if it.fail != nil { 917 return false 918 } 919 // If the iterator completed, deliver directly whatever's available 920 if it.done { 921 select { 922 case log := <-it.logs: 923 it.Event = new(TokenMintFinished) 924 if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { 925 it.fail = err 926 return false 927 } 928 it.Event.Raw = log 929 return true 930 931 default: 932 return false 933 } 934 } 935 // Iterator still in progress, wait for either a data or an error event 936 select { 937 case log := <-it.logs: 938 it.Event = new(TokenMintFinished) 939 if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { 940 it.fail = err 941 return false 942 } 943 it.Event.Raw = log 944 return true 945 946 case err := <-it.sub.Err(): 947 it.done = true 948 it.fail = err 949 return it.Next() 950 } 951 } 952 953 // Error returns any retrieval or parsing error occurred during filtering. 954 func (it *TokenMintFinishedIterator) Error() error { 955 return it.fail 956 } 957 958 // Close terminates the iteration process, releasing any pending underlying 959 // resources. 960 func (it *TokenMintFinishedIterator) Close() error { 961 it.sub.Unsubscribe() 962 return nil 963 } 964 965 // TokenMintFinished represents a MintFinished event raised by the Token contract. 966 type TokenMintFinished struct { 967 Raw types.Log // Blockchain specific contextual infos 968 } 969 970 // FilterMintFinished is a free log retrieval operation binding the contract event 0xae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa08. 971 // 972 // Solidity: event MintFinished() 973 func (_Token *TokenFilterer) FilterMintFinished(opts *bind.FilterOpts) (*TokenMintFinishedIterator, error) { 974 975 logs, sub, err := _Token.contract.FilterLogs(opts, "MintFinished") 976 if err != nil { 977 return nil, err 978 } 979 return &TokenMintFinishedIterator{contract: _Token.contract, event: "MintFinished", logs: logs, sub: sub}, nil 980 } 981 982 // WatchMintFinished is a free log subscription operation binding the contract event 0xae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa08. 983 // 984 // Solidity: event MintFinished() 985 func (_Token *TokenFilterer) WatchMintFinished(opts *bind.WatchOpts, sink chan<- *TokenMintFinished) (event.Subscription, error) { 986 987 logs, sub, err := _Token.contract.WatchLogs(opts, "MintFinished") 988 if err != nil { 989 return nil, err 990 } 991 return event.NewSubscription(func(quit <-chan struct{}) error { 992 defer sub.Unsubscribe() 993 for { 994 select { 995 case log := <-logs: 996 // New log arrived, parse the event and forward to the user 997 event := new(TokenMintFinished) 998 if err := _Token.contract.UnpackLog(event, "MintFinished", log); err != nil { 999 return err 1000 } 1001 event.Raw = log 1002 1003 select { 1004 case sink <- event: 1005 case err := <-sub.Err(): 1006 return err 1007 case <-quit: 1008 return nil 1009 } 1010 case err := <-sub.Err(): 1011 return err 1012 case <-quit: 1013 return nil 1014 } 1015 } 1016 }), nil 1017 } 1018 1019 // ParseMintFinished is a log parse operation binding the contract event 0xae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa08. 1020 // 1021 // Solidity: event MintFinished() 1022 func (_Token *TokenFilterer) ParseMintFinished(log types.Log) (*TokenMintFinished, error) { 1023 event := new(TokenMintFinished) 1024 if err := _Token.contract.UnpackLog(event, "MintFinished", log); err != nil { 1025 return nil, err 1026 } 1027 event.Raw = log 1028 return event, nil 1029 } 1030 1031 // TokenOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the Token contract. 1032 type TokenOwnershipTransferredIterator struct { 1033 Event *TokenOwnershipTransferred // Event containing the contract specifics and raw log 1034 1035 contract *bind.BoundContract // Generic contract to use for unpacking event data 1036 event string // Event name to use for unpacking event data 1037 1038 logs chan types.Log // Log channel receiving the found contract events 1039 sub ethereum.Subscription // Subscription for errors, completion and termination 1040 done bool // Whether the subscription completed delivering logs 1041 fail error // Occurred error to stop iteration 1042 } 1043 1044 // Next advances the iterator to the subsequent event, returning whether there 1045 // are any more events found. In case of a retrieval or parsing error, false is 1046 // returned and Error() can be queried for the exact failure. 1047 func (it *TokenOwnershipTransferredIterator) Next() bool { 1048 // If the iterator failed, stop iterating 1049 if it.fail != nil { 1050 return false 1051 } 1052 // If the iterator completed, deliver directly whatever's available 1053 if it.done { 1054 select { 1055 case log := <-it.logs: 1056 it.Event = new(TokenOwnershipTransferred) 1057 if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { 1058 it.fail = err 1059 return false 1060 } 1061 it.Event.Raw = log 1062 return true 1063 1064 default: 1065 return false 1066 } 1067 } 1068 // Iterator still in progress, wait for either a data or an error event 1069 select { 1070 case log := <-it.logs: 1071 it.Event = new(TokenOwnershipTransferred) 1072 if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { 1073 it.fail = err 1074 return false 1075 } 1076 it.Event.Raw = log 1077 return true 1078 1079 case err := <-it.sub.Err(): 1080 it.done = true 1081 it.fail = err 1082 return it.Next() 1083 } 1084 } 1085 1086 // Error returns any retrieval or parsing error occurred during filtering. 1087 func (it *TokenOwnershipTransferredIterator) Error() error { 1088 return it.fail 1089 } 1090 1091 // Close terminates the iteration process, releasing any pending underlying 1092 // resources. 1093 func (it *TokenOwnershipTransferredIterator) Close() error { 1094 it.sub.Unsubscribe() 1095 return nil 1096 } 1097 1098 // TokenOwnershipTransferred represents a OwnershipTransferred event raised by the Token contract. 1099 type TokenOwnershipTransferred struct { 1100 PreviousOwner common.Address 1101 NewOwner common.Address 1102 Raw types.Log // Blockchain specific contextual infos 1103 } 1104 1105 // FilterOwnershipTransferred is a free log retrieval operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. 1106 // 1107 // Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) 1108 func (_Token *TokenFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*TokenOwnershipTransferredIterator, error) { 1109 1110 var previousOwnerRule []interface{} 1111 for _, previousOwnerItem := range previousOwner { 1112 previousOwnerRule = append(previousOwnerRule, previousOwnerItem) 1113 } 1114 var newOwnerRule []interface{} 1115 for _, newOwnerItem := range newOwner { 1116 newOwnerRule = append(newOwnerRule, newOwnerItem) 1117 } 1118 1119 logs, sub, err := _Token.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) 1120 if err != nil { 1121 return nil, err 1122 } 1123 return &TokenOwnershipTransferredIterator{contract: _Token.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil 1124 } 1125 1126 // WatchOwnershipTransferred is a free log subscription operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. 1127 // 1128 // Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) 1129 func (_Token *TokenFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *TokenOwnershipTransferred, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) { 1130 1131 var previousOwnerRule []interface{} 1132 for _, previousOwnerItem := range previousOwner { 1133 previousOwnerRule = append(previousOwnerRule, previousOwnerItem) 1134 } 1135 var newOwnerRule []interface{} 1136 for _, newOwnerItem := range newOwner { 1137 newOwnerRule = append(newOwnerRule, newOwnerItem) 1138 } 1139 1140 logs, sub, err := _Token.contract.WatchLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) 1141 if err != nil { 1142 return nil, err 1143 } 1144 return event.NewSubscription(func(quit <-chan struct{}) error { 1145 defer sub.Unsubscribe() 1146 for { 1147 select { 1148 case log := <-logs: 1149 // New log arrived, parse the event and forward to the user 1150 event := new(TokenOwnershipTransferred) 1151 if err := _Token.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { 1152 return err 1153 } 1154 event.Raw = log 1155 1156 select { 1157 case sink <- event: 1158 case err := <-sub.Err(): 1159 return err 1160 case <-quit: 1161 return nil 1162 } 1163 case err := <-sub.Err(): 1164 return err 1165 case <-quit: 1166 return nil 1167 } 1168 } 1169 }), nil 1170 } 1171 1172 // ParseOwnershipTransferred is a log parse operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. 1173 // 1174 // Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) 1175 func (_Token *TokenFilterer) ParseOwnershipTransferred(log types.Log) (*TokenOwnershipTransferred, error) { 1176 event := new(TokenOwnershipTransferred) 1177 if err := _Token.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { 1178 return nil, err 1179 } 1180 event.Raw = log 1181 return event, nil 1182 } 1183 1184 // TokenTransferIterator is returned from FilterTransfer and is used to iterate over the raw logs and unpacked data for Transfer events raised by the Token contract. 1185 type TokenTransferIterator struct { 1186 Event *TokenTransfer // Event containing the contract specifics and raw log 1187 1188 contract *bind.BoundContract // Generic contract to use for unpacking event data 1189 event string // Event name to use for unpacking event data 1190 1191 logs chan types.Log // Log channel receiving the found contract events 1192 sub ethereum.Subscription // Subscription for errors, completion and termination 1193 done bool // Whether the subscription completed delivering logs 1194 fail error // Occurred error to stop iteration 1195 } 1196 1197 // Next advances the iterator to the subsequent event, returning whether there 1198 // are any more events found. In case of a retrieval or parsing error, false is 1199 // returned and Error() can be queried for the exact failure. 1200 func (it *TokenTransferIterator) Next() bool { 1201 // If the iterator failed, stop iterating 1202 if it.fail != nil { 1203 return false 1204 } 1205 // If the iterator completed, deliver directly whatever's available 1206 if it.done { 1207 select { 1208 case log := <-it.logs: 1209 it.Event = new(TokenTransfer) 1210 if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { 1211 it.fail = err 1212 return false 1213 } 1214 it.Event.Raw = log 1215 return true 1216 1217 default: 1218 return false 1219 } 1220 } 1221 // Iterator still in progress, wait for either a data or an error event 1222 select { 1223 case log := <-it.logs: 1224 it.Event = new(TokenTransfer) 1225 if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { 1226 it.fail = err 1227 return false 1228 } 1229 it.Event.Raw = log 1230 return true 1231 1232 case err := <-it.sub.Err(): 1233 it.done = true 1234 it.fail = err 1235 return it.Next() 1236 } 1237 } 1238 1239 // Error returns any retrieval or parsing error occurred during filtering. 1240 func (it *TokenTransferIterator) Error() error { 1241 return it.fail 1242 } 1243 1244 // Close terminates the iteration process, releasing any pending underlying 1245 // resources. 1246 func (it *TokenTransferIterator) Close() error { 1247 it.sub.Unsubscribe() 1248 return nil 1249 } 1250 1251 // TokenTransfer represents a Transfer event raised by the Token contract. 1252 type TokenTransfer struct { 1253 From common.Address 1254 To common.Address 1255 Value *big.Int 1256 Raw types.Log // Blockchain specific contextual infos 1257 } 1258 1259 // FilterTransfer is a free log retrieval operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. 1260 // 1261 // Solidity: event Transfer(address indexed from, address indexed to, uint256 value) 1262 func (_Token *TokenFilterer) FilterTransfer(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*TokenTransferIterator, error) { 1263 1264 var fromRule []interface{} 1265 for _, fromItem := range from { 1266 fromRule = append(fromRule, fromItem) 1267 } 1268 var toRule []interface{} 1269 for _, toItem := range to { 1270 toRule = append(toRule, toItem) 1271 } 1272 1273 logs, sub, err := _Token.contract.FilterLogs(opts, "Transfer", fromRule, toRule) 1274 if err != nil { 1275 return nil, err 1276 } 1277 return &TokenTransferIterator{contract: _Token.contract, event: "Transfer", logs: logs, sub: sub}, nil 1278 } 1279 1280 // WatchTransfer is a free log subscription operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. 1281 // 1282 // Solidity: event Transfer(address indexed from, address indexed to, uint256 value) 1283 func (_Token *TokenFilterer) WatchTransfer(opts *bind.WatchOpts, sink chan<- *TokenTransfer, from []common.Address, to []common.Address) (event.Subscription, error) { 1284 1285 var fromRule []interface{} 1286 for _, fromItem := range from { 1287 fromRule = append(fromRule, fromItem) 1288 } 1289 var toRule []interface{} 1290 for _, toItem := range to { 1291 toRule = append(toRule, toItem) 1292 } 1293 1294 logs, sub, err := _Token.contract.WatchLogs(opts, "Transfer", fromRule, toRule) 1295 if err != nil { 1296 return nil, err 1297 } 1298 return event.NewSubscription(func(quit <-chan struct{}) error { 1299 defer sub.Unsubscribe() 1300 for { 1301 select { 1302 case log := <-logs: 1303 // New log arrived, parse the event and forward to the user 1304 event := new(TokenTransfer) 1305 if err := _Token.contract.UnpackLog(event, "Transfer", log); err != nil { 1306 return err 1307 } 1308 event.Raw = log 1309 1310 select { 1311 case sink <- event: 1312 case err := <-sub.Err(): 1313 return err 1314 case <-quit: 1315 return nil 1316 } 1317 case err := <-sub.Err(): 1318 return err 1319 case <-quit: 1320 return nil 1321 } 1322 } 1323 }), nil 1324 } 1325 1326 // ParseTransfer is a log parse operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. 1327 // 1328 // Solidity: event Transfer(address indexed from, address indexed to, uint256 value) 1329 func (_Token *TokenFilterer) ParseTransfer(log types.Log) (*TokenTransfer, error) { 1330 event := new(TokenTransfer) 1331 if err := _Token.contract.UnpackLog(event, "Transfer", log); err != nil { 1332 return nil, err 1333 } 1334 event.Raw = log 1335 return event, nil 1336 }