gitee.com/liu-zhao234568/cntest@v1.0.0/contracts/checkpointoracle/contract/oracle.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 contract
     5  
     6  import (
     7  	"math/big"
     8  	"strings"
     9  
    10  	ethereum "gitee.com/liu-zhao234568/cntest"
    11  	"gitee.com/liu-zhao234568/cntest/accounts/abi"
    12  	"gitee.com/liu-zhao234568/cntest/accounts/abi/bind"
    13  	"gitee.com/liu-zhao234568/cntest/common"
    14  	"gitee.com/liu-zhao234568/cntest/core/types"
    15  	"gitee.com/liu-zhao234568/cntest/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  // CheckpointOracleABI is the input ABI used to generate the binding from.
    30  const CheckpointOracleABI = "[{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"_adminlist\",\"type\":\"address[]\"},{\"internalType\":\"uint256\",\"name\":\"_sectionSize\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_processConfirms\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_threshold\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"index\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"checkpointHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"NewCheckpointVote\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"GetAllAdmin\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"GetLatestCheckpoint\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"},{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_recentNumber\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"_recentHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"_hash\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"_sectionIndex\",\"type\":\"uint64\"},{\"internalType\":\"uint8[]\",\"name\":\"v\",\"type\":\"uint8[]\"},{\"internalType\":\"bytes32[]\",\"name\":\"r\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes32[]\",\"name\":\"s\",\"type\":\"bytes32[]\"}],\"name\":\"SetCheckpoint\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]"
    31  
    32  // CheckpointOracleFuncSigs maps the 4-byte function signature to its string representation.
    33  var CheckpointOracleFuncSigs = map[string]string{
    34  	"45848dfc": "GetAllAdmin()",
    35  	"4d6a304c": "GetLatestCheckpoint()",
    36  	"d459fc46": "SetCheckpoint(uint256,bytes32,bytes32,uint64,uint8[],bytes32[],bytes32[])",
    37  }
    38  
    39  // CheckpointOracleBin is the compiled bytecode used for deploying new contracts.
    40  var CheckpointOracleBin = "0x608060405234801561001057600080fd5b506040516108703803806108708339818101604052608081101561003357600080fd5b810190808051604051939291908464010000000082111561005357600080fd5b90830190602082018581111561006857600080fd5b825186602082028301116401000000008211171561008557600080fd5b82525081516020918201928201910280838360005b838110156100b257818101518382015260200161009a565b50505050919091016040908152602083015190830151606090930151909450919250600090505b84518110156101855760016000808784815181106100f357fe5b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff021916908315150217905550600185828151811061014057fe5b60209081029190910181015182546001808201855560009485529290932090920180546001600160a01b0319166001600160a01b0390931692909217909155016100d9565b50600592909255600655600755506106ce806101a26000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c806345848dfc146100465780634d6a304c1461009e578063d459fc46146100cf575b600080fd5b61004e6102b0565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561008a578181015183820152602001610072565b505050509050019250505060405180910390f35b6100a6610365565b6040805167ffffffffffffffff9094168452602084019290925282820152519081900360600190f35b61029c600480360360e08110156100e557600080fd5b81359160208101359160408201359167ffffffffffffffff6060820135169181019060a08101608082013564010000000081111561012257600080fd5b82018360208201111561013457600080fd5b8035906020019184602083028401116401000000008311171561015657600080fd5b91908080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525092959493602081019350359150506401000000008111156101a657600080fd5b8201836020820111156101b857600080fd5b803590602001918460208302840111640100000000831117156101da57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929594936020810193503591505064010000000081111561022a57600080fd5b82018360208201111561023c57600080fd5b8035906020019184602083028401116401000000008311171561025e57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610380945050505050565b604080519115158252519081900360200190f35b600154606090819067ffffffffffffffff811180156102ce57600080fd5b506040519080825280602002602001820160405280156102f8578160200160208202803683370190505b50905060005b60015481101561035f576001818154811061031557fe5b9060005260206000200160009054906101000a90046001600160a01b031682828151811061033f57fe5b6001600160a01b03909216602092830291909101909101526001016102fe565b50905090565b60025460045460035467ffffffffffffffff90921691909192565b3360009081526020819052604081205460ff1661039c57600080fd5b868840146103a957600080fd5b82518451146103b757600080fd5b81518451146103c557600080fd5b6006546005548660010167ffffffffffffffff1602014310156103ea5750600061068d565b60025467ffffffffffffffff908116908616101561040a5750600061068d565b60025467ffffffffffffffff868116911614801561043c575067ffffffffffffffff851615158061043c575060035415155b156104495750600061068d565b856104565750600061068d565b60408051601960f81b6020808301919091526000602183018190523060601b60228401526001600160c01b031960c08a901b166036840152603e8084018b905284518085039091018152605e909301909352815191012090805b86518110156106875760006001848984815181106104ca57fe5b60200260200101518985815181106104de57fe5b60200260200101518986815181106104f257fe5b602002602001015160405160008152602001604052604051808581526020018460ff1660ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa158015610551573d6000803e3d6000fd5b505060408051601f1901516001600160a01b03811660009081526020819052919091205490925060ff16905061058657600080fd5b826001600160a01b0316816001600160a01b0316116105a457600080fd5b8092508867ffffffffffffffff167fce51ffa16246bcaf0899f6504f473cd0114f430f566cef71ab7e03d3dde42a418b8a85815181106105e057fe5b60200260200101518a86815181106105f457fe5b60200260200101518a878151811061060857fe5b6020026020010151604051808581526020018460ff1660ff16815260200183815260200182815260200194505050505060405180910390a2600754826001011061067e5750505060048790555050436003556002805467ffffffffffffffff191667ffffffffffffffff8616179055600161068d565b506001016104b0565b50600080fd5b97965050505050505056fea26469706673582212202ddf9eda76bf59c0fc65584c0b22d84ecef2c703765de60439596d6ac34c2b7264736f6c634300060b0033"
    41  
    42  // DeployCheckpointOracle deploys a new Ethereum contract, binding an instance of CheckpointOracle to it.
    43  func DeployCheckpointOracle(auth *bind.TransactOpts, backend bind.ContractBackend, _adminlist []common.Address, _sectionSize *big.Int, _processConfirms *big.Int, _threshold *big.Int) (common.Address, *types.Transaction, *CheckpointOracle, error) {
    44  	parsed, err := abi.JSON(strings.NewReader(CheckpointOracleABI))
    45  	if err != nil {
    46  		return common.Address{}, nil, nil, err
    47  	}
    48  
    49  	address, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(CheckpointOracleBin), backend, _adminlist, _sectionSize, _processConfirms, _threshold)
    50  	if err != nil {
    51  		return common.Address{}, nil, nil, err
    52  	}
    53  	return address, tx, &CheckpointOracle{CheckpointOracleCaller: CheckpointOracleCaller{contract: contract}, CheckpointOracleTransactor: CheckpointOracleTransactor{contract: contract}, CheckpointOracleFilterer: CheckpointOracleFilterer{contract: contract}}, nil
    54  }
    55  
    56  // CheckpointOracle is an auto generated Go binding around an Ethereum contract.
    57  type CheckpointOracle struct {
    58  	CheckpointOracleCaller     // Read-only binding to the contract
    59  	CheckpointOracleTransactor // Write-only binding to the contract
    60  	CheckpointOracleFilterer   // Log filterer for contract events
    61  }
    62  
    63  // CheckpointOracleCaller is an auto generated read-only Go binding around an Ethereum contract.
    64  type CheckpointOracleCaller struct {
    65  	contract *bind.BoundContract // Generic contract wrapper for the low level calls
    66  }
    67  
    68  // CheckpointOracleTransactor is an auto generated write-only Go binding around an Ethereum contract.
    69  type CheckpointOracleTransactor struct {
    70  	contract *bind.BoundContract // Generic contract wrapper for the low level calls
    71  }
    72  
    73  // CheckpointOracleFilterer is an auto generated log filtering Go binding around an Ethereum contract events.
    74  type CheckpointOracleFilterer struct {
    75  	contract *bind.BoundContract // Generic contract wrapper for the low level calls
    76  }
    77  
    78  // CheckpointOracleSession is an auto generated Go binding around an Ethereum contract,
    79  // with pre-set call and transact options.
    80  type CheckpointOracleSession struct {
    81  	Contract     *CheckpointOracle // Generic contract binding to set the session for
    82  	CallOpts     bind.CallOpts     // Call options to use throughout this session
    83  	TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session
    84  }
    85  
    86  // CheckpointOracleCallerSession is an auto generated read-only Go binding around an Ethereum contract,
    87  // with pre-set call options.
    88  type CheckpointOracleCallerSession struct {
    89  	Contract *CheckpointOracleCaller // Generic contract caller binding to set the session for
    90  	CallOpts bind.CallOpts           // Call options to use throughout this session
    91  }
    92  
    93  // CheckpointOracleTransactorSession is an auto generated write-only Go binding around an Ethereum contract,
    94  // with pre-set transact options.
    95  type CheckpointOracleTransactorSession struct {
    96  	Contract     *CheckpointOracleTransactor // Generic contract transactor binding to set the session for
    97  	TransactOpts bind.TransactOpts           // Transaction auth options to use throughout this session
    98  }
    99  
   100  // CheckpointOracleRaw is an auto generated low-level Go binding around an Ethereum contract.
   101  type CheckpointOracleRaw struct {
   102  	Contract *CheckpointOracle // Generic contract binding to access the raw methods on
   103  }
   104  
   105  // CheckpointOracleCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract.
   106  type CheckpointOracleCallerRaw struct {
   107  	Contract *CheckpointOracleCaller // Generic read-only contract binding to access the raw methods on
   108  }
   109  
   110  // CheckpointOracleTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract.
   111  type CheckpointOracleTransactorRaw struct {
   112  	Contract *CheckpointOracleTransactor // Generic write-only contract binding to access the raw methods on
   113  }
   114  
   115  // NewCheckpointOracle creates a new instance of CheckpointOracle, bound to a specific deployed contract.
   116  func NewCheckpointOracle(address common.Address, backend bind.ContractBackend) (*CheckpointOracle, error) {
   117  	contract, err := bindCheckpointOracle(address, backend, backend, backend)
   118  	if err != nil {
   119  		return nil, err
   120  	}
   121  	return &CheckpointOracle{CheckpointOracleCaller: CheckpointOracleCaller{contract: contract}, CheckpointOracleTransactor: CheckpointOracleTransactor{contract: contract}, CheckpointOracleFilterer: CheckpointOracleFilterer{contract: contract}}, nil
   122  }
   123  
   124  // NewCheckpointOracleCaller creates a new read-only instance of CheckpointOracle, bound to a specific deployed contract.
   125  func NewCheckpointOracleCaller(address common.Address, caller bind.ContractCaller) (*CheckpointOracleCaller, error) {
   126  	contract, err := bindCheckpointOracle(address, caller, nil, nil)
   127  	if err != nil {
   128  		return nil, err
   129  	}
   130  	return &CheckpointOracleCaller{contract: contract}, nil
   131  }
   132  
   133  // NewCheckpointOracleTransactor creates a new write-only instance of CheckpointOracle, bound to a specific deployed contract.
   134  func NewCheckpointOracleTransactor(address common.Address, transactor bind.ContractTransactor) (*CheckpointOracleTransactor, error) {
   135  	contract, err := bindCheckpointOracle(address, nil, transactor, nil)
   136  	if err != nil {
   137  		return nil, err
   138  	}
   139  	return &CheckpointOracleTransactor{contract: contract}, nil
   140  }
   141  
   142  // NewCheckpointOracleFilterer creates a new log filterer instance of CheckpointOracle, bound to a specific deployed contract.
   143  func NewCheckpointOracleFilterer(address common.Address, filterer bind.ContractFilterer) (*CheckpointOracleFilterer, error) {
   144  	contract, err := bindCheckpointOracle(address, nil, nil, filterer)
   145  	if err != nil {
   146  		return nil, err
   147  	}
   148  	return &CheckpointOracleFilterer{contract: contract}, nil
   149  }
   150  
   151  // bindCheckpointOracle binds a generic wrapper to an already deployed contract.
   152  func bindCheckpointOracle(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {
   153  	parsed, err := abi.JSON(strings.NewReader(CheckpointOracleABI))
   154  	if err != nil {
   155  		return nil, err
   156  	}
   157  	return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil
   158  }
   159  
   160  // Call invokes the (constant) contract method with params as input values and
   161  // sets the output to result. The result type might be a single field for simple
   162  // returns, a slice of interfaces for anonymous returns and a struct for named
   163  // returns.
   164  func (_CheckpointOracle *CheckpointOracleRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
   165  	return _CheckpointOracle.Contract.CheckpointOracleCaller.contract.Call(opts, result, method, params...)
   166  }
   167  
   168  // Transfer initiates a plain transaction to move funds to the contract, calling
   169  // its default method if one is available.
   170  func (_CheckpointOracle *CheckpointOracleRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) {
   171  	return _CheckpointOracle.Contract.CheckpointOracleTransactor.contract.Transfer(opts)
   172  }
   173  
   174  // Transact invokes the (paid) contract method with params as input values.
   175  func (_CheckpointOracle *CheckpointOracleRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {
   176  	return _CheckpointOracle.Contract.CheckpointOracleTransactor.contract.Transact(opts, method, params...)
   177  }
   178  
   179  // Call invokes the (constant) contract method with params as input values and
   180  // sets the output to result. The result type might be a single field for simple
   181  // returns, a slice of interfaces for anonymous returns and a struct for named
   182  // returns.
   183  func (_CheckpointOracle *CheckpointOracleCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
   184  	return _CheckpointOracle.Contract.contract.Call(opts, result, method, params...)
   185  }
   186  
   187  // Transfer initiates a plain transaction to move funds to the contract, calling
   188  // its default method if one is available.
   189  func (_CheckpointOracle *CheckpointOracleTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) {
   190  	return _CheckpointOracle.Contract.contract.Transfer(opts)
   191  }
   192  
   193  // Transact invokes the (paid) contract method with params as input values.
   194  func (_CheckpointOracle *CheckpointOracleTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {
   195  	return _CheckpointOracle.Contract.contract.Transact(opts, method, params...)
   196  }
   197  
   198  // GetAllAdmin is a free data retrieval call binding the contract method 0x45848dfc.
   199  //
   200  // Solidity: function GetAllAdmin() view returns(address[])
   201  func (_CheckpointOracle *CheckpointOracleCaller) GetAllAdmin(opts *bind.CallOpts) ([]common.Address, error) {
   202  	var out []interface{}
   203  	err := _CheckpointOracle.contract.Call(opts, &out, "GetAllAdmin")
   204  
   205  	if err != nil {
   206  		return *new([]common.Address), err
   207  	}
   208  
   209  	out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address)
   210  
   211  	return out0, err
   212  
   213  }
   214  
   215  // GetAllAdmin is a free data retrieval call binding the contract method 0x45848dfc.
   216  //
   217  // Solidity: function GetAllAdmin() view returns(address[])
   218  func (_CheckpointOracle *CheckpointOracleSession) GetAllAdmin() ([]common.Address, error) {
   219  	return _CheckpointOracle.Contract.GetAllAdmin(&_CheckpointOracle.CallOpts)
   220  }
   221  
   222  // GetAllAdmin is a free data retrieval call binding the contract method 0x45848dfc.
   223  //
   224  // Solidity: function GetAllAdmin() view returns(address[])
   225  func (_CheckpointOracle *CheckpointOracleCallerSession) GetAllAdmin() ([]common.Address, error) {
   226  	return _CheckpointOracle.Contract.GetAllAdmin(&_CheckpointOracle.CallOpts)
   227  }
   228  
   229  // GetLatestCheckpoint is a free data retrieval call binding the contract method 0x4d6a304c.
   230  //
   231  // Solidity: function GetLatestCheckpoint() view returns(uint64, bytes32, uint256)
   232  func (_CheckpointOracle *CheckpointOracleCaller) GetLatestCheckpoint(opts *bind.CallOpts) (uint64, [32]byte, *big.Int, error) {
   233  	var out []interface{}
   234  	err := _CheckpointOracle.contract.Call(opts, &out, "GetLatestCheckpoint")
   235  
   236  	if err != nil {
   237  		return *new(uint64), *new([32]byte), *new(*big.Int), err
   238  	}
   239  
   240  	out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64)
   241  	out1 := *abi.ConvertType(out[1], new([32]byte)).(*[32]byte)
   242  	out2 := *abi.ConvertType(out[2], new(*big.Int)).(**big.Int)
   243  
   244  	return out0, out1, out2, err
   245  
   246  }
   247  
   248  // GetLatestCheckpoint is a free data retrieval call binding the contract method 0x4d6a304c.
   249  //
   250  // Solidity: function GetLatestCheckpoint() view returns(uint64, bytes32, uint256)
   251  func (_CheckpointOracle *CheckpointOracleSession) GetLatestCheckpoint() (uint64, [32]byte, *big.Int, error) {
   252  	return _CheckpointOracle.Contract.GetLatestCheckpoint(&_CheckpointOracle.CallOpts)
   253  }
   254  
   255  // GetLatestCheckpoint is a free data retrieval call binding the contract method 0x4d6a304c.
   256  //
   257  // Solidity: function GetLatestCheckpoint() view returns(uint64, bytes32, uint256)
   258  func (_CheckpointOracle *CheckpointOracleCallerSession) GetLatestCheckpoint() (uint64, [32]byte, *big.Int, error) {
   259  	return _CheckpointOracle.Contract.GetLatestCheckpoint(&_CheckpointOracle.CallOpts)
   260  }
   261  
   262  // SetCheckpoint is a paid mutator transaction binding the contract method 0xd459fc46.
   263  //
   264  // Solidity: function SetCheckpoint(uint256 _recentNumber, bytes32 _recentHash, bytes32 _hash, uint64 _sectionIndex, uint8[] v, bytes32[] r, bytes32[] s) returns(bool)
   265  func (_CheckpointOracle *CheckpointOracleTransactor) SetCheckpoint(opts *bind.TransactOpts, _recentNumber *big.Int, _recentHash [32]byte, _hash [32]byte, _sectionIndex uint64, v []uint8, r [][32]byte, s [][32]byte) (*types.Transaction, error) {
   266  	return _CheckpointOracle.contract.Transact(opts, "SetCheckpoint", _recentNumber, _recentHash, _hash, _sectionIndex, v, r, s)
   267  }
   268  
   269  // SetCheckpoint is a paid mutator transaction binding the contract method 0xd459fc46.
   270  //
   271  // Solidity: function SetCheckpoint(uint256 _recentNumber, bytes32 _recentHash, bytes32 _hash, uint64 _sectionIndex, uint8[] v, bytes32[] r, bytes32[] s) returns(bool)
   272  func (_CheckpointOracle *CheckpointOracleSession) SetCheckpoint(_recentNumber *big.Int, _recentHash [32]byte, _hash [32]byte, _sectionIndex uint64, v []uint8, r [][32]byte, s [][32]byte) (*types.Transaction, error) {
   273  	return _CheckpointOracle.Contract.SetCheckpoint(&_CheckpointOracle.TransactOpts, _recentNumber, _recentHash, _hash, _sectionIndex, v, r, s)
   274  }
   275  
   276  // SetCheckpoint is a paid mutator transaction binding the contract method 0xd459fc46.
   277  //
   278  // Solidity: function SetCheckpoint(uint256 _recentNumber, bytes32 _recentHash, bytes32 _hash, uint64 _sectionIndex, uint8[] v, bytes32[] r, bytes32[] s) returns(bool)
   279  func (_CheckpointOracle *CheckpointOracleTransactorSession) SetCheckpoint(_recentNumber *big.Int, _recentHash [32]byte, _hash [32]byte, _sectionIndex uint64, v []uint8, r [][32]byte, s [][32]byte) (*types.Transaction, error) {
   280  	return _CheckpointOracle.Contract.SetCheckpoint(&_CheckpointOracle.TransactOpts, _recentNumber, _recentHash, _hash, _sectionIndex, v, r, s)
   281  }
   282  
   283  // CheckpointOracleNewCheckpointVoteIterator is returned from FilterNewCheckpointVote and is used to iterate over the raw logs and unpacked data for NewCheckpointVote events raised by the CheckpointOracle contract.
   284  type CheckpointOracleNewCheckpointVoteIterator struct {
   285  	Event *CheckpointOracleNewCheckpointVote // Event containing the contract specifics and raw log
   286  
   287  	contract *bind.BoundContract // Generic contract to use for unpacking event data
   288  	event    string              // Event name to use for unpacking event data
   289  
   290  	logs chan types.Log        // Log channel receiving the found contract events
   291  	sub  ethereum.Subscription // Subscription for errors, completion and termination
   292  	done bool                  // Whether the subscription completed delivering logs
   293  	fail error                 // Occurred error to stop iteration
   294  }
   295  
   296  // Next advances the iterator to the subsequent event, returning whether there
   297  // are any more events found. In case of a retrieval or parsing error, false is
   298  // returned and Error() can be queried for the exact failure.
   299  func (it *CheckpointOracleNewCheckpointVoteIterator) Next() bool {
   300  	// If the iterator failed, stop iterating
   301  	if it.fail != nil {
   302  		return false
   303  	}
   304  	// If the iterator completed, deliver directly whatever's available
   305  	if it.done {
   306  		select {
   307  		case log := <-it.logs:
   308  			it.Event = new(CheckpointOracleNewCheckpointVote)
   309  			if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
   310  				it.fail = err
   311  				return false
   312  			}
   313  			it.Event.Raw = log
   314  			return true
   315  
   316  		default:
   317  			return false
   318  		}
   319  	}
   320  	// Iterator still in progress, wait for either a data or an error event
   321  	select {
   322  	case log := <-it.logs:
   323  		it.Event = new(CheckpointOracleNewCheckpointVote)
   324  		if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
   325  			it.fail = err
   326  			return false
   327  		}
   328  		it.Event.Raw = log
   329  		return true
   330  
   331  	case err := <-it.sub.Err():
   332  		it.done = true
   333  		it.fail = err
   334  		return it.Next()
   335  	}
   336  }
   337  
   338  // Error returns any retrieval or parsing error occurred during filtering.
   339  func (it *CheckpointOracleNewCheckpointVoteIterator) Error() error {
   340  	return it.fail
   341  }
   342  
   343  // Close terminates the iteration process, releasing any pending underlying
   344  // resources.
   345  func (it *CheckpointOracleNewCheckpointVoteIterator) Close() error {
   346  	it.sub.Unsubscribe()
   347  	return nil
   348  }
   349  
   350  // CheckpointOracleNewCheckpointVote represents a NewCheckpointVote event raised by the CheckpointOracle contract.
   351  type CheckpointOracleNewCheckpointVote struct {
   352  	Index          uint64
   353  	CheckpointHash [32]byte
   354  	V              uint8
   355  	R              [32]byte
   356  	S              [32]byte
   357  	Raw            types.Log // Blockchain specific contextual infos
   358  }
   359  
   360  // FilterNewCheckpointVote is a free log retrieval operation binding the contract event 0xce51ffa16246bcaf0899f6504f473cd0114f430f566cef71ab7e03d3dde42a41.
   361  //
   362  // Solidity: event NewCheckpointVote(uint64 indexed index, bytes32 checkpointHash, uint8 v, bytes32 r, bytes32 s)
   363  func (_CheckpointOracle *CheckpointOracleFilterer) FilterNewCheckpointVote(opts *bind.FilterOpts, index []uint64) (*CheckpointOracleNewCheckpointVoteIterator, error) {
   364  
   365  	var indexRule []interface{}
   366  	for _, indexItem := range index {
   367  		indexRule = append(indexRule, indexItem)
   368  	}
   369  
   370  	logs, sub, err := _CheckpointOracle.contract.FilterLogs(opts, "NewCheckpointVote", indexRule)
   371  	if err != nil {
   372  		return nil, err
   373  	}
   374  	return &CheckpointOracleNewCheckpointVoteIterator{contract: _CheckpointOracle.contract, event: "NewCheckpointVote", logs: logs, sub: sub}, nil
   375  }
   376  
   377  // WatchNewCheckpointVote is a free log subscription operation binding the contract event 0xce51ffa16246bcaf0899f6504f473cd0114f430f566cef71ab7e03d3dde42a41.
   378  //
   379  // Solidity: event NewCheckpointVote(uint64 indexed index, bytes32 checkpointHash, uint8 v, bytes32 r, bytes32 s)
   380  func (_CheckpointOracle *CheckpointOracleFilterer) WatchNewCheckpointVote(opts *bind.WatchOpts, sink chan<- *CheckpointOracleNewCheckpointVote, index []uint64) (event.Subscription, error) {
   381  
   382  	var indexRule []interface{}
   383  	for _, indexItem := range index {
   384  		indexRule = append(indexRule, indexItem)
   385  	}
   386  
   387  	logs, sub, err := _CheckpointOracle.contract.WatchLogs(opts, "NewCheckpointVote", indexRule)
   388  	if err != nil {
   389  		return nil, err
   390  	}
   391  	return event.NewSubscription(func(quit <-chan struct{}) error {
   392  		defer sub.Unsubscribe()
   393  		for {
   394  			select {
   395  			case log := <-logs:
   396  				// New log arrived, parse the event and forward to the user
   397  				event := new(CheckpointOracleNewCheckpointVote)
   398  				if err := _CheckpointOracle.contract.UnpackLog(event, "NewCheckpointVote", log); err != nil {
   399  					return err
   400  				}
   401  				event.Raw = log
   402  
   403  				select {
   404  				case sink <- event:
   405  				case err := <-sub.Err():
   406  					return err
   407  				case <-quit:
   408  					return nil
   409  				}
   410  			case err := <-sub.Err():
   411  				return err
   412  			case <-quit:
   413  				return nil
   414  			}
   415  		}
   416  	}), nil
   417  }
   418  
   419  // ParseNewCheckpointVote is a log parse operation binding the contract event 0xce51ffa16246bcaf0899f6504f473cd0114f430f566cef71ab7e03d3dde42a41.
   420  //
   421  // Solidity: event NewCheckpointVote(uint64 indexed index, bytes32 checkpointHash, uint8 v, bytes32 r, bytes32 s)
   422  func (_CheckpointOracle *CheckpointOracleFilterer) ParseNewCheckpointVote(log types.Log) (*CheckpointOracleNewCheckpointVote, error) {
   423  	event := new(CheckpointOracleNewCheckpointVote)
   424  	if err := _CheckpointOracle.contract.UnpackLog(event, "NewCheckpointVote", log); err != nil {
   425  		return nil, err
   426  	}
   427  	return event, nil
   428  }