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