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