diff --git a/abi-bindings/go/EventImporter/EventImporter.go b/abi-bindings/go/EventImporter/EventImporter.go index ad266cc..7438ef3 100644 --- a/abi-bindings/go/EventImporter/EventImporter.go +++ b/abi-bindings/go/EventImporter/EventImporter.go @@ -31,7 +31,7 @@ var ( // EventImporterMetaData contains all meta data concerning the EventImporter contract. var EventImporterMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"blockHeader\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"txIndex\",\"type\":\"uint256\"},{\"internalType\":\"bytes[]\",\"name\":\"receiptProof\",\"type\":\"bytes[]\"},{\"internalType\":\"uint256\",\"name\":\"logIndex\",\"type\":\"uint256\"}],\"name\":\"importEvent\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"warpMessenger\",\"outputs\":[{\"internalType\":\"contractIWarpMessenger\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", + ABI: "[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"sourceBlockchainID\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"sourceBlockHash\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"loggerAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"txIndex\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"logIndex\",\"type\":\"uint256\"}],\"name\":\"EventImported\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"blockHeader\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"txIndex\",\"type\":\"uint256\"},{\"internalType\":\"bytes[]\",\"name\":\"receiptProof\",\"type\":\"bytes[]\"},{\"internalType\":\"uint256\",\"name\":\"logIndex\",\"type\":\"uint256\"}],\"name\":\"importEvent\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"warpMessenger\",\"outputs\":[{\"internalType\":\"contractIWarpMessenger\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", } // EventImporterABI is the input ABI used to generate the binding from. @@ -211,23 +211,187 @@ func (_EventImporter *EventImporterCallerSession) WarpMessenger() (common.Addres return _EventImporter.Contract.WarpMessenger(&_EventImporter.CallOpts) } -// ImportEvent is a paid mutator transaction binding the contract method 0xa47b555e. +// ImportEvent is a paid mutator transaction binding the contract method 0x0a8bfac9. // -// Solidity: function importEvent(bytes blockHeader, uint256 txIndex, bytes[] receiptProof, uint256 logIndex) returns() -func (_EventImporter *EventImporterTransactor) ImportEvent(opts *bind.TransactOpts, blockHeader []byte, txIndex *big.Int, receiptProof [][]byte, logIndex *big.Int) (*types.Transaction, error) { - return _EventImporter.contract.Transact(opts, "importEvent", blockHeader, txIndex, receiptProof, logIndex) +// Solidity: function importEvent(bytes32 , bytes blockHeader, uint256 txIndex, bytes[] receiptProof, uint256 logIndex) returns() +func (_EventImporter *EventImporterTransactor) ImportEvent(opts *bind.TransactOpts, arg0 [32]byte, blockHeader []byte, txIndex *big.Int, receiptProof [][]byte, logIndex *big.Int) (*types.Transaction, error) { + return _EventImporter.contract.Transact(opts, "importEvent", arg0, blockHeader, txIndex, receiptProof, logIndex) } -// ImportEvent is a paid mutator transaction binding the contract method 0xa47b555e. +// ImportEvent is a paid mutator transaction binding the contract method 0x0a8bfac9. // -// Solidity: function importEvent(bytes blockHeader, uint256 txIndex, bytes[] receiptProof, uint256 logIndex) returns() -func (_EventImporter *EventImporterSession) ImportEvent(blockHeader []byte, txIndex *big.Int, receiptProof [][]byte, logIndex *big.Int) (*types.Transaction, error) { - return _EventImporter.Contract.ImportEvent(&_EventImporter.TransactOpts, blockHeader, txIndex, receiptProof, logIndex) +// Solidity: function importEvent(bytes32 , bytes blockHeader, uint256 txIndex, bytes[] receiptProof, uint256 logIndex) returns() +func (_EventImporter *EventImporterSession) ImportEvent(arg0 [32]byte, blockHeader []byte, txIndex *big.Int, receiptProof [][]byte, logIndex *big.Int) (*types.Transaction, error) { + return _EventImporter.Contract.ImportEvent(&_EventImporter.TransactOpts, arg0, blockHeader, txIndex, receiptProof, logIndex) } -// ImportEvent is a paid mutator transaction binding the contract method 0xa47b555e. +// ImportEvent is a paid mutator transaction binding the contract method 0x0a8bfac9. // -// Solidity: function importEvent(bytes blockHeader, uint256 txIndex, bytes[] receiptProof, uint256 logIndex) returns() -func (_EventImporter *EventImporterTransactorSession) ImportEvent(blockHeader []byte, txIndex *big.Int, receiptProof [][]byte, logIndex *big.Int) (*types.Transaction, error) { - return _EventImporter.Contract.ImportEvent(&_EventImporter.TransactOpts, blockHeader, txIndex, receiptProof, logIndex) +// Solidity: function importEvent(bytes32 , bytes blockHeader, uint256 txIndex, bytes[] receiptProof, uint256 logIndex) returns() +func (_EventImporter *EventImporterTransactorSession) ImportEvent(arg0 [32]byte, blockHeader []byte, txIndex *big.Int, receiptProof [][]byte, logIndex *big.Int) (*types.Transaction, error) { + return _EventImporter.Contract.ImportEvent(&_EventImporter.TransactOpts, arg0, blockHeader, txIndex, receiptProof, logIndex) +} + +// EventImporterEventImportedIterator is returned from FilterEventImported and is used to iterate over the raw logs and unpacked data for EventImported events raised by the EventImporter contract. +type EventImporterEventImportedIterator struct { + Event *EventImporterEventImported // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub interfaces.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *EventImporterEventImportedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(EventImporterEventImported) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(EventImporterEventImported) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *EventImporterEventImportedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *EventImporterEventImportedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// EventImporterEventImported represents a EventImported event raised by the EventImporter contract. +type EventImporterEventImported struct { + SourceBlockchainID [32]byte + SourceBlockHash [32]byte + LoggerAddress common.Address + TxIndex *big.Int + LogIndex *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterEventImported is a free log retrieval operation binding the contract event 0xfdb2f8239033f2b8c1122b2a4b6af55bb0b0b05e4050b5ecd9eafa153d3cd41d. +// +// Solidity: event EventImported(bytes32 indexed sourceBlockchainID, bytes32 indexed sourceBlockHash, address indexed loggerAddress, uint256 txIndex, uint256 logIndex) +func (_EventImporter *EventImporterFilterer) FilterEventImported(opts *bind.FilterOpts, sourceBlockchainID [][32]byte, sourceBlockHash [][32]byte, loggerAddress []common.Address) (*EventImporterEventImportedIterator, error) { + + var sourceBlockchainIDRule []interface{} + for _, sourceBlockchainIDItem := range sourceBlockchainID { + sourceBlockchainIDRule = append(sourceBlockchainIDRule, sourceBlockchainIDItem) + } + var sourceBlockHashRule []interface{} + for _, sourceBlockHashItem := range sourceBlockHash { + sourceBlockHashRule = append(sourceBlockHashRule, sourceBlockHashItem) + } + var loggerAddressRule []interface{} + for _, loggerAddressItem := range loggerAddress { + loggerAddressRule = append(loggerAddressRule, loggerAddressItem) + } + + logs, sub, err := _EventImporter.contract.FilterLogs(opts, "EventImported", sourceBlockchainIDRule, sourceBlockHashRule, loggerAddressRule) + if err != nil { + return nil, err + } + return &EventImporterEventImportedIterator{contract: _EventImporter.contract, event: "EventImported", logs: logs, sub: sub}, nil +} + +// WatchEventImported is a free log subscription operation binding the contract event 0xfdb2f8239033f2b8c1122b2a4b6af55bb0b0b05e4050b5ecd9eafa153d3cd41d. +// +// Solidity: event EventImported(bytes32 indexed sourceBlockchainID, bytes32 indexed sourceBlockHash, address indexed loggerAddress, uint256 txIndex, uint256 logIndex) +func (_EventImporter *EventImporterFilterer) WatchEventImported(opts *bind.WatchOpts, sink chan<- *EventImporterEventImported, sourceBlockchainID [][32]byte, sourceBlockHash [][32]byte, loggerAddress []common.Address) (event.Subscription, error) { + + var sourceBlockchainIDRule []interface{} + for _, sourceBlockchainIDItem := range sourceBlockchainID { + sourceBlockchainIDRule = append(sourceBlockchainIDRule, sourceBlockchainIDItem) + } + var sourceBlockHashRule []interface{} + for _, sourceBlockHashItem := range sourceBlockHash { + sourceBlockHashRule = append(sourceBlockHashRule, sourceBlockHashItem) + } + var loggerAddressRule []interface{} + for _, loggerAddressItem := range loggerAddress { + loggerAddressRule = append(loggerAddressRule, loggerAddressItem) + } + + logs, sub, err := _EventImporter.contract.WatchLogs(opts, "EventImported", sourceBlockchainIDRule, sourceBlockHashRule, loggerAddressRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(EventImporterEventImported) + if err := _EventImporter.contract.UnpackLog(event, "EventImported", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseEventImported is a log parse operation binding the contract event 0xfdb2f8239033f2b8c1122b2a4b6af55bb0b0b05e4050b5ecd9eafa153d3cd41d. +// +// Solidity: event EventImported(bytes32 indexed sourceBlockchainID, bytes32 indexed sourceBlockHash, address indexed loggerAddress, uint256 txIndex, uint256 logIndex) +func (_EventImporter *EventImporterFilterer) ParseEventImported(log types.Log) (*EventImporterEventImported, error) { + event := new(EventImporterEventImported) + if err := _EventImporter.contract.UnpackLog(event, "EventImported", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil } diff --git a/abi-bindings/go/IEventImporter/IEventImporter.go b/abi-bindings/go/IEventImporter/IEventImporter.go index 1230260..5b2c34c 100644 --- a/abi-bindings/go/IEventImporter/IEventImporter.go +++ b/abi-bindings/go/IEventImporter/IEventImporter.go @@ -31,7 +31,7 @@ var ( // IEventImporterMetaData contains all meta data concerning the IEventImporter contract. var IEventImporterMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"blockHeader\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"txIndex\",\"type\":\"uint256\"},{\"internalType\":\"bytes[]\",\"name\":\"receiptProof\",\"type\":\"bytes[]\"},{\"internalType\":\"uint256\",\"name\":\"logIndex\",\"type\":\"uint256\"}],\"name\":\"importEvent\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", + ABI: "[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"sourceBlockchainID\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"sourceBlockHash\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"loggerAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"txIndex\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"logIndex\",\"type\":\"uint256\"}],\"name\":\"EventImported\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"sourceBlockchainID\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"blockHeader\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"txIndex\",\"type\":\"uint256\"},{\"internalType\":\"bytes[]\",\"name\":\"receiptProof\",\"type\":\"bytes[]\"},{\"internalType\":\"uint256\",\"name\":\"logIndex\",\"type\":\"uint256\"}],\"name\":\"importEvent\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", } // IEventImporterABI is the input ABI used to generate the binding from. @@ -180,23 +180,187 @@ func (_IEventImporter *IEventImporterTransactorRaw) Transact(opts *bind.Transact return _IEventImporter.Contract.contract.Transact(opts, method, params...) } -// ImportEvent is a paid mutator transaction binding the contract method 0xa47b555e. +// ImportEvent is a paid mutator transaction binding the contract method 0x0a8bfac9. // -// Solidity: function importEvent(bytes blockHeader, uint256 txIndex, bytes[] receiptProof, uint256 logIndex) returns() -func (_IEventImporter *IEventImporterTransactor) ImportEvent(opts *bind.TransactOpts, blockHeader []byte, txIndex *big.Int, receiptProof [][]byte, logIndex *big.Int) (*types.Transaction, error) { - return _IEventImporter.contract.Transact(opts, "importEvent", blockHeader, txIndex, receiptProof, logIndex) +// Solidity: function importEvent(bytes32 sourceBlockchainID, bytes blockHeader, uint256 txIndex, bytes[] receiptProof, uint256 logIndex) returns() +func (_IEventImporter *IEventImporterTransactor) ImportEvent(opts *bind.TransactOpts, sourceBlockchainID [32]byte, blockHeader []byte, txIndex *big.Int, receiptProof [][]byte, logIndex *big.Int) (*types.Transaction, error) { + return _IEventImporter.contract.Transact(opts, "importEvent", sourceBlockchainID, blockHeader, txIndex, receiptProof, logIndex) } -// ImportEvent is a paid mutator transaction binding the contract method 0xa47b555e. +// ImportEvent is a paid mutator transaction binding the contract method 0x0a8bfac9. // -// Solidity: function importEvent(bytes blockHeader, uint256 txIndex, bytes[] receiptProof, uint256 logIndex) returns() -func (_IEventImporter *IEventImporterSession) ImportEvent(blockHeader []byte, txIndex *big.Int, receiptProof [][]byte, logIndex *big.Int) (*types.Transaction, error) { - return _IEventImporter.Contract.ImportEvent(&_IEventImporter.TransactOpts, blockHeader, txIndex, receiptProof, logIndex) +// Solidity: function importEvent(bytes32 sourceBlockchainID, bytes blockHeader, uint256 txIndex, bytes[] receiptProof, uint256 logIndex) returns() +func (_IEventImporter *IEventImporterSession) ImportEvent(sourceBlockchainID [32]byte, blockHeader []byte, txIndex *big.Int, receiptProof [][]byte, logIndex *big.Int) (*types.Transaction, error) { + return _IEventImporter.Contract.ImportEvent(&_IEventImporter.TransactOpts, sourceBlockchainID, blockHeader, txIndex, receiptProof, logIndex) } -// ImportEvent is a paid mutator transaction binding the contract method 0xa47b555e. +// ImportEvent is a paid mutator transaction binding the contract method 0x0a8bfac9. // -// Solidity: function importEvent(bytes blockHeader, uint256 txIndex, bytes[] receiptProof, uint256 logIndex) returns() -func (_IEventImporter *IEventImporterTransactorSession) ImportEvent(blockHeader []byte, txIndex *big.Int, receiptProof [][]byte, logIndex *big.Int) (*types.Transaction, error) { - return _IEventImporter.Contract.ImportEvent(&_IEventImporter.TransactOpts, blockHeader, txIndex, receiptProof, logIndex) +// Solidity: function importEvent(bytes32 sourceBlockchainID, bytes blockHeader, uint256 txIndex, bytes[] receiptProof, uint256 logIndex) returns() +func (_IEventImporter *IEventImporterTransactorSession) ImportEvent(sourceBlockchainID [32]byte, blockHeader []byte, txIndex *big.Int, receiptProof [][]byte, logIndex *big.Int) (*types.Transaction, error) { + return _IEventImporter.Contract.ImportEvent(&_IEventImporter.TransactOpts, sourceBlockchainID, blockHeader, txIndex, receiptProof, logIndex) +} + +// IEventImporterEventImportedIterator is returned from FilterEventImported and is used to iterate over the raw logs and unpacked data for EventImported events raised by the IEventImporter contract. +type IEventImporterEventImportedIterator struct { + Event *IEventImporterEventImported // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub interfaces.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *IEventImporterEventImportedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(IEventImporterEventImported) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(IEventImporterEventImported) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *IEventImporterEventImportedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *IEventImporterEventImportedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// IEventImporterEventImported represents a EventImported event raised by the IEventImporter contract. +type IEventImporterEventImported struct { + SourceBlockchainID [32]byte + SourceBlockHash [32]byte + LoggerAddress common.Address + TxIndex *big.Int + LogIndex *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterEventImported is a free log retrieval operation binding the contract event 0xfdb2f8239033f2b8c1122b2a4b6af55bb0b0b05e4050b5ecd9eafa153d3cd41d. +// +// Solidity: event EventImported(bytes32 indexed sourceBlockchainID, bytes32 indexed sourceBlockHash, address indexed loggerAddress, uint256 txIndex, uint256 logIndex) +func (_IEventImporter *IEventImporterFilterer) FilterEventImported(opts *bind.FilterOpts, sourceBlockchainID [][32]byte, sourceBlockHash [][32]byte, loggerAddress []common.Address) (*IEventImporterEventImportedIterator, error) { + + var sourceBlockchainIDRule []interface{} + for _, sourceBlockchainIDItem := range sourceBlockchainID { + sourceBlockchainIDRule = append(sourceBlockchainIDRule, sourceBlockchainIDItem) + } + var sourceBlockHashRule []interface{} + for _, sourceBlockHashItem := range sourceBlockHash { + sourceBlockHashRule = append(sourceBlockHashRule, sourceBlockHashItem) + } + var loggerAddressRule []interface{} + for _, loggerAddressItem := range loggerAddress { + loggerAddressRule = append(loggerAddressRule, loggerAddressItem) + } + + logs, sub, err := _IEventImporter.contract.FilterLogs(opts, "EventImported", sourceBlockchainIDRule, sourceBlockHashRule, loggerAddressRule) + if err != nil { + return nil, err + } + return &IEventImporterEventImportedIterator{contract: _IEventImporter.contract, event: "EventImported", logs: logs, sub: sub}, nil +} + +// WatchEventImported is a free log subscription operation binding the contract event 0xfdb2f8239033f2b8c1122b2a4b6af55bb0b0b05e4050b5ecd9eafa153d3cd41d. +// +// Solidity: event EventImported(bytes32 indexed sourceBlockchainID, bytes32 indexed sourceBlockHash, address indexed loggerAddress, uint256 txIndex, uint256 logIndex) +func (_IEventImporter *IEventImporterFilterer) WatchEventImported(opts *bind.WatchOpts, sink chan<- *IEventImporterEventImported, sourceBlockchainID [][32]byte, sourceBlockHash [][32]byte, loggerAddress []common.Address) (event.Subscription, error) { + + var sourceBlockchainIDRule []interface{} + for _, sourceBlockchainIDItem := range sourceBlockchainID { + sourceBlockchainIDRule = append(sourceBlockchainIDRule, sourceBlockchainIDItem) + } + var sourceBlockHashRule []interface{} + for _, sourceBlockHashItem := range sourceBlockHash { + sourceBlockHashRule = append(sourceBlockHashRule, sourceBlockHashItem) + } + var loggerAddressRule []interface{} + for _, loggerAddressItem := range loggerAddress { + loggerAddressRule = append(loggerAddressRule, loggerAddressItem) + } + + logs, sub, err := _IEventImporter.contract.WatchLogs(opts, "EventImported", sourceBlockchainIDRule, sourceBlockHashRule, loggerAddressRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(IEventImporterEventImported) + if err := _IEventImporter.contract.UnpackLog(event, "EventImported", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseEventImported is a log parse operation binding the contract event 0xfdb2f8239033f2b8c1122b2a4b6af55bb0b0b05e4050b5ecd9eafa153d3cd41d. +// +// Solidity: event EventImported(bytes32 indexed sourceBlockchainID, bytes32 indexed sourceBlockHash, address indexed loggerAddress, uint256 txIndex, uint256 logIndex) +func (_IEventImporter *IEventImporterFilterer) ParseEventImported(log types.Log) (*IEventImporterEventImported, error) { + event := new(IEventImporterEventImported) + if err := _IEventImporter.contract.UnpackLog(event, "EventImported", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil } diff --git a/abi-bindings/go/PriceFeedImporter/PriceFeedImporter.go b/abi-bindings/go/PriceFeedImporter/PriceFeedImporter.go index d4d9138..ee83aa7 100644 --- a/abi-bindings/go/PriceFeedImporter/PriceFeedImporter.go +++ b/abi-bindings/go/PriceFeedImporter/PriceFeedImporter.go @@ -31,8 +31,8 @@ var ( // PriceFeedImporterMetaData contains all meta data concerning the PriceFeedImporter contract. var PriceFeedImporterMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"sourceBlockchainID_\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"sourceOracleAggregator_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"int256\",\"name\":\"currentAnswer\",\"type\":\"int256\"},{\"indexed\":false,\"internalType\":\"uint80\",\"name\":\"roundID\",\"type\":\"uint80\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"updatedAt\",\"type\":\"uint256\"}],\"name\":\"AnswerUpdated\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"ANSWER_UPDATED_EVENT_SIGNATURE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"currentAnswer\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"blockHeader\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"txIndex\",\"type\":\"uint256\"},{\"internalType\":\"bytes[]\",\"name\":\"receiptProof\",\"type\":\"bytes[]\"},{\"internalType\":\"uint256\",\"name\":\"logIndex\",\"type\":\"uint256\"}],\"name\":\"importEvent\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestRoundData\",\"outputs\":[{\"internalType\":\"uint80\",\"name\":\"\",\"type\":\"uint80\"},{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint80\",\"name\":\"\",\"type\":\"uint80\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestSourceBlockNumber\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestSourceLogIndex\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestSourceTxIndex\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"roundID\",\"outputs\":[{\"internalType\":\"uint80\",\"name\":\"\",\"type\":\"uint80\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"sourceBlockchainID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"sourceOracleAggregator\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"updatedAt\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"warpMessenger\",\"outputs\":[{\"internalType\":\"contractIWarpMessenger\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", - Bin: "0x60c06040523480156200001157600080fd5b5060405162002d1f38038062002d1f833981016040819052620000349162000072565b600080546001600160a01b0319167302000000000000000000000000000000000000051790556080919091526001600160a01b031660a052620000b1565b600080604083850312156200008657600080fd5b825160208401519092506001600160a01b0381168114620000a657600080fd5b809150509250929050565b60805160a051612c3a620000e5600039600081816101b70152610f6201526000818161012c0152610efc0152612c3a6000f3fe608060405234801561001057600080fd5b50600436106100b45760003560e01c80637e1b4cb0116100715780637e1b4cb0146101605780638716cde514610169578063a47b555e14610172578063c9572e1414610187578063ce2723fc146101b2578063feaf968c146101d957600080fd5b8063042a7c97146100b957806308fd4323146100f357806314f8b424146100fc57806329b7b3fd146101275780634af37a111461014e5780637519ab5014610157575b600080fd5b6100e07f0559884fd3a460db3073b7fc896cc77986f16e378210ded43186175bf646fc5f81565b6040519081526020015b60405180910390f35b6100e060065481565b60025461010f906001600160501b031681565b6040516001600160501b0390911681526020016100ea565b6100e07f000000000000000000000000000000000000000000000000000000000000000081565b6100e060055481565b6100e060035481565b6100e060015481565b6100e060045481565b61018561018036600461278f565b610215565b005b60005461019a906001600160a01b031681565b6040516001600160a01b0390911681526020016100ea565b61019a7f000000000000000000000000000000000000000000000000000000000000000081565b6101e161058c565b604080516001600160501b03968716815260208101959095528401929092526060830152909116608082015260a0016100ea565b6000805460405163ce7f592960e01b81526004810183905282916001600160a01b03169063ce7f592990602401606060405180830381865afa15801561025f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102839190612881565b91509150806102d15760405162461bcd60e51b8152602060048201526015602482015274092dcecc2d8d2c840aec2e4e084d8dec6d690c2e6d605b1b60448201526064015b60405180910390fd5b816020015188886040516102e69291906128f8565b6040518091039020146103315760405162461bcd60e51b815260206004820152601360248201527224b73b30b634b210313637b1b5a432b0b232b960691b60448201526064016102c8565b6000806103738a8a8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506105f492505050565b60408051600180825281830190925292945090925060009190816020015b60608152602001906001900390816103915790505090506103b1896106d7565b816000815181106103c4576103c4612908565b602090810291909101015260006103e5836103df8a8c61291e565b84610772565b9050805160011461044b5760405162461bcd60e51b815260206004820152602a60248201527f496e76616c6964206e756d626572206f6620726573756c747320696e2072656360448201526932b4b83a10383937b7b360b11b60648201526084016102c8565b60008160008151811061046057610460612908565b60200260200101516020015151116104b25760405162461bcd60e51b815260206004820152601560248201527424b73b30b634b2103932b1b2b4b83a10383937b7b360591b60448201526064016102c8565b60006104e36104de836000815181106104cd576104cd612908565b602002602001015160200151610c03565b610c30565b9050806080015151881061052d5760405162461bcd60e51b8152602060048201526011602482015270092dcecc2d8d2c840d8dece40d2dcc8caf607b1b60448201526064016102c8565b61057d6040518060a00160405280896000015181526020018781526020018d81526020018a815260200183608001518b8151811061056d5761056d612908565b6020026020010151815250610ef6565b50505050505050505050505050565b60008060008060006003546000036105d05760405162461bcd60e51b81526020600482015260076024820152664e6f206461746160c81b60448201526064016102c8565b50506002546001546003546001600160501b03909216959094509092508291508490565b600080600061060a61060585610c03565b61129c565b9050600f815110156106755760405162461bcd60e51b815260206004820152602e60248201527f496e76616c6964206e756d626572206f6620524c5020656c656d656e7473206960448201526d3710313637b1b5903432b0b232b960911b60648201526084016102c8565b600061069a8260088151811061068d5761068d612908565b60200260200101516113b1565b905060006106c1836005815181106106b4576106b4612908565b60200260200101516113ff565b6106ca906129f2565b9196919550909350505050565b6060816000036106fe5750506040805180820190915260018152600160ff1b602082015290565b607f8211156107425760405162461bcd60e51b815260206004820152601060248201526f092dcecc2d8d2c840e8f040d2dcc8caf60831b60448201526064016102c8565b6040516001600160f81b031960f884901b1660208201526021016040516020818303038152906040529050919050565b6060600082516001600160401b0381111561078f5761078f61283b565b6040519080825280602002602001820160405280156107d457816020015b60408051808201909152606080825260208201528152602001906001900390816107ad5790505b509050600084516001600160401b038111156107f2576107f261283b565b60405190808252806020026020018201604052801561083857816020015b6040805180820190915260008152606060208201528152602001906001900390816108105790505b50905060005b85518110156108c557604051806040016040528087838151811061086457610864612908565b602002602001015180519060200120815260200187838151811061088a5761088a612908565b60200260200101518152508282815181106108a7576108a7612908565b602002602001018190525080806108bd90612a2c565b91505061083e565b5060005b8451811015610bf8578481815181106108e4576108e4612908565b60200260200101518382815181106108fe576108fe612908565b6020026020010151600001819052506000604051806040016040528087848151811061092c5761092c612908565b6020026020010151815260200160008152509050600061095461094f858b61147c565b611529565b905060015b8015610be257604080516080810182526000808252602082018190529181019190915260608082015261098b8361167e565b15610a5957600061099b84611693565b90506000600286602001516109b09190612a5b565b156109d657600286602001516109c69190612a6f565b6109d1906001612a83565b6109e7565b600286602001516109e79190612a6f565b90506040518060400160405280610a0288600001518461173d565b815260200160008152509550610a1c826000015187611807565b15610a5157610a2f888360200151611834565b898881518110610a4157610a41612908565b6020026020010151602001819052505b505050610be2565b60c083015115610af7576000610a6e8461187d565b9050610a7e8582600001516119a1565b15610aea576000610a9282600001516119be565b8660200151610aa19190612a83565b90506040518060400160405280610ac88860000151600285610ac39190612a6f565b61173d565b8152602001610ad8600284612a5b565b81525095508160200151925050610af1565b5050610be2565b50610bbf565b60e083015115610bb2576000610b0c846119e1565b9050610b1785611be9565b15610b62578051511515600103610aea57610b3a87826000015160200151611834565b888781518110610b4c57610b4c612908565b6020026020010151602001819052505050610be2565b60008160200151610b74876000611bfb565b60108110610b8457610b84612908565b602002015180519091501515600103610a5157610ba2866001611c85565b9550806020015192505050610bbf565b825115610bbf5750610be2565b610bcc61094f8783611834565b9250508080610bda90612a2c565b915050610959565b5050508080610bf090612a2c565b9150506108c9565b509095945050505050565b60408051808201825260008082526020918201528151808301909252825182529182019181019190915290565b6040805160a08101825260008082526060602083018190529282015281810182905260808101919091526000610c6583611cc8565b610d1557506020820151805160001a906001821480610c8757508160ff166002145b610cdd5760405162461bcd60e51b815260206004820152602160248201527f496e76616c6964207478207479706520666f72206e6f6e2d6c656761637920746044820152600f60fb1b60648201526084016102c8565b604051806040016040528060018660000151610cf99190612a96565b815260200185602001516001610d0f9190612a83565b90529350505b6000610d208461129c565b90508051600414610d855760405162461bcd60e51b815260206004820152602960248201527f496e76616c6964206e756d626572206f6620524c5020656c656d656e747320696044820152681b881c9958d95a5c1d60ba1b60648201526084016102c8565b6040805160a0810182526060602082018190526000928201839052808201819052608082015260ff8416815282519091610dc8918491906106b4576106b4612908565b8160200181905250610de68260018151811061068d5761068d612908565b6001600160401b031660408201528151610e0d90839060029081106106b4576106b4612908565b81606001819052506000610e3a83600381518110610e2d57610e2d612908565b602002602001015161129c565b905080516001600160401b03811115610e5557610e5561283b565b604051908082528060200260200182016040528015610e8e57816020015b610e7b6125dc565b815260200190600190039081610e735790505b50608083015260005b8151811015610bf857610ec2828281518110610eb557610eb5612908565b6020026020010151611d03565b83608001518281518110610ed857610ed8612908565b60200260200101819052508080610eee90612a2c565b915050610e97565b805181907f000000000000000000000000000000000000000000000000000000000000000014610f605760405162461bcd60e51b8152602060048201526015602482015274125b9d985b1a5908189b1bd8dad8da185a5b881251605a1b60448201526064016102c8565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168160800151600001516001600160a01b031614610fe25760405162461bcd60e51b8152602060048201526016602482015275496e76616c6964206c6f67676572206164647265737360501b60448201526064016102c8565b81806080015160200151516003146110315760405162461bcd60e51b8152602060048201526012602482015271496e76616c6964206c6f6720746f7069637360701b60448201526064016102c8565b8060800151604001515160201461107d5760405162461bcd60e51b815260206004820152601060248201526f496e76616c6964206c6f67206461746160801b60448201526064016102c8565b7f0559884fd3a460db3073b7fc896cc77986f16e378210ded43186175bf646fc5f8160800151602001516000815181106110b9576110b9612908565b60200260200101511461110e5760405162461bcd60e51b815260206004820152601760248201527f496e76616c6964206576656e74207369676e617475726500000000000000000060448201526064016102c8565b8260045481602001511015801561113957506004548160200151118061113957506005548160400151115b801561116957506004548160200151118061115957506005548160400151115b8061116957506006548160600151115b6111a35760405162461bcd60e51b815260206004820152600b60248201526a14dd185b1948195d995b9d60aa1b60448201526064016102c8565b8360800151602001516001815181106111be576111be612908565b602002602001015160001c6001819055508360800151602001516002815181106111ea576111ea612908565b60209081029190910101516002805469ffffffffffffffffffff19166001600160501b03909216919091179055608084015160400151611229906129f2565b600381905560208581015160045560408087015160055560608088015160065560015460025483519182526001600160501b031693810193909352908201929092527f5b196ccf306f345de8745dffeaf185f4cafe74a334e2b2466d04c880071533b9910160405180910390a150505050565b60606112a782611cc8565b6112b057600080fd5b60006112bb83611e94565b90506000816001600160401b038111156112d7576112d761283b565b60405190808252806020026020018201604052801561131c57816020015b60408051808201909152600080825260208201528152602001906001900390816112f55790505b509050600061132e8560200151611f19565b856020015161133d9190612a83565b90506000805b848110156113a65761135483611f9a565b915060405180604001604052808381526020018481525084828151811061137d5761137d612908565b60209081029190910101526113928284612a83565b92508061139e81612a2c565b915050611343565b509195945050505050565b8051600090158015906113c657508151602110155b6113cf57600080fd5b6000806113db84612043565b8151919350915060208210156113f75760208290036101000a90045b949350505050565b805160609061140d57600080fd5b60008061141984612043565b915091506000816001600160401b038111156114375761143761283b565b6040519080825280601f01601f191660200182016040528015611461576020820181803683370190505b5090506020810161147384828561207d565b50949350505050565b606060005b83518110156114e6578284828151811061149d5761149d612908565b602002602001015160000151036114d4578381815181106114c0576114c0612908565b602002602001015160200151915050611523565b806114de81612a2c565b915050611481565b5060405162461bcd60e51b8152602060048201526011602482015270496e636f6d706c6574652050726f6f662160781b60448201526064016102c8565b92915050565b611531612606565b611539612606565b6000604051806040016040528085815260200160008152509050611592846040518060400160405280602081526020017f56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421815250612100565b156115a257506001815292915050565b60006115b061060586610c03565b805190915060008190036115cb575050600182525092915050565b806002036116255760006115eb836000815181106106b4576106b4612908565b602081015190915060fc1c60028114806116055750806003145b15611616576001602087015261161e565b600160c08701525b5050611670565b8060110361163957600160e0850152611670565b60405162461bcd60e51b815260206004820152600c60248201526b496e76616c6964206461746160a01b60448201526064016102c8565b505061012082015292915050565b60008160200151806115235750506040015190565b61169b61266c565b6116a361266c565b60006116ba61060585610120015160000151610c03565b905060006116d4826001815181106106b4576106b4612908565b905060405180604001604052806117016116fa856000815181106106b4576106b4612908565b6001612130565b81526000602091820181905291855260408051608081018252838152808301939093526001908301526060820192909252908301525092915050565b8151606090600061174e8483612a96565b9050838210156117945760405162461bcd60e51b8152602060048201526011602482015270736c6963655f6f75744f66426f756e647360781b60448201526064016102c8565b6060811580156117b357604051915060008252602082016040526117fd565b6040519150601f8316801560200281840101848101888315602002848c0101015b818310156117ec5780518352602092830192016117d4565b5050848452601f01601f1916604052505b5095945050505050565b6000611812826119be565b61181b846119be565b14801561182d575061182d83836119a1565b9392505050565b606081604001511561184b57506060810151611523565b8151156118675761186083836020015161147c565b9050611523565b5060408051602081019091526000815292915050565b61188561266c565b61188d61266c565b60006118a461060585610120015160000151610c03565b905060006118be826001815181106106b4576106b4612908565b9050600060046118da846000815181106106b4576106b4612908565b6000815181106118ec576118ec612908565b602001015160f81c60f81b6001600160f81b031916901c60f81c6001169050604051806040016040528061194e61192f866000815181106106b4576106b4612908565b600261193c866001612aa9565b6119469190612ac2565b60ff16612130565b815260ff831660209182015290855260408051608081019091526001815290810161197884612168565b815260006020808301829052604080519283528282018152909201528501525091949350505050565b60006119ac826119be565b6119b684846121d0565b149392505050565b6000816020015160028360000151516119d79190612ae4565b6115239190612a96565b6119e96126bd565b6119f16126bd565b6000611a0861060585610120015160000151610c03565b9050611a126126d9565b60005b6010811015611b1a576000611a358483815181106106b4576106b4612908565b90508051602014611a9d576040805180820182526000808252825160808101845281815260208082018390528185018390528451928352828101909452606081019190915291810191909152838360108110611a9357611a93612908565b6020020152611b07565b6000611aa882612168565b60408051808201825260018082528251608081018452908152602080820185905260008285018190528451908152808201909452606082019390935291810191909152909150848460108110611b0057611b00612908565b6020020152505b5080611b1281612a2c565b915050611a15565b50611b39611b34836010815181106106b4576106b4612908565b61234e565b15611b865760408051808201825260008082528251608081018452818152602080820183905281850183905284519283528281019094526060810191909152918101919091528352611bdd565b604051806040016040528060011515815260200160405180608001604052806000151581526020016000801b8152602001600115158152602001611bd6866010815181106106b4576106b4612908565b9052905283525b60208301525092915050565b6000611bf4826119be565b1592915050565b6000806002838560200151611c109190612a83565b611c1a9190612a6f565b905060006002848660200151611c309190612a83565b611c3a9190612a5b565b9050600085600001518381518110611c5457611c54612908565b016020015160f81c905060018214611c735760048160ff16901c611c78565b80600f165b60ff169695505050505050565b604080518082019091526060815260006020820152604051806040016040528084600001518152602001838560200151611cbf9190612a83565b90529392505050565b80516000908103611cdb57506000919050565b6020820151805160001a9060c0821015611cf9575060009392505050565b5060019392505050565b611d0b6125dc565b6000611d168361129c565b90508051600314611d775760405162461bcd60e51b815260206004820152602560248201527f496e76616c6964206e756d626572206f6620524c5020656c656d656e747320696044820152646e206c6f6760d81b60648201526084016102c8565b611d7f6125dc565b611da282600081518110611d9557611d95612908565b60200260200101516123b9565b6001600160a01b031681528151600090611dc99084906001908110610e2d57610e2d612908565b905080516001600160401b03811115611de457611de461283b565b604051908082528060200260200182016040528015611e0d578160200160208202803683370190505b50602083015260005b8151811015611e7057611e348282815181106106b4576106b4612908565b611e3d906129f2565b83602001518281518110611e5357611e53612908565b602090810291909101015280611e6881612a2c565b915050611e16565b50611e87836002815181106106b4576106b4612908565b6040830152509392505050565b80516000908103611ea757506000919050565b600080611eb78460200151611f19565b8460200151611ec69190612a83565b9050600084600001518560200151611ede9190612a83565b90505b80821015611f1057611ef282611f9a565b611efc9083612a83565b915082611f0881612a2c565b935050611ee1565b50909392505050565b8051600090811a6080811015611f325750600092915050565b60b8811080611f4d575060c08110801590611f4d575060f881105b15611f5b5750600192915050565b60c0811015611f8857611f70600160b8612afb565b611f7d9060ff1682612a96565b61182d906001612a83565b611f70600160f8612afb565b50919050565b80516000908190811a6080811015611fb5576001915061203c565b60b8811015611fdb57611fc9608082612a96565b611fd4906001612a83565b915061203c565b60c08110156120085760b78103600185019450806020036101000a8551046001820181019350505061203c565b60f881101561201c57611fc960c082612a96565b60f78103600185019450806020036101000a855104600182018101935050505b5092915050565b60008060006120558460200151611f19565b905060008185602001516120699190612a83565b905060008286600001516106ca9190612a96565b8060000361208a57505050565b602081106120c257825182526120a1602084612a83565b92506120ae602083612a83565b91506120bb602082612a96565b905061208a565b80156120fb57600060016120d7836020612a96565b6120e390610100612bf8565b6120ed9190612a96565b845184518216911916178352505b505050565b6000815183511461211357506000611523565b825160208381018281209186019283209091145b95945050505050565b6060825182111561214057600080fd5b600082845161214f9190612a96565b9050602084016121276121628583612a83565b836123d3565b60006020825110156121c85760405162461bcd60e51b8152602060048201526024808201527f42797465733a3a20746f427974657333323a206461746120697320746f20736860448201526337b93a1760e11b60648201526084016102c8565b506020015190565b600080600284602001516121e49190612a5b565b90506000600284602001516121f99190612a5b565b90508082036122f1576000600286602001516122159190612a6f565b905060006002866020015161222a9190612a6f565b9050600084156122aa57865180518390811061224857612248612908565b016020015188518051600f60f81b909216918590811061226a5761226a612908565b0160200151600f60f81b161461228857600095505050505050611523565b61229183612a2c565b925061229c82612a2c565b91506122a781612a2c565b90505b60006122ba89600001518561173d565b905060006122cc89600001518561173d565b9050826122d98383612429565b6122e39190612a83565b975050505050505050611523565b600061230d6122ff876119be565b612308876119be565b612511565b905060005b81811015612343576123248682611bfb565b61232e8883611bfb565b036123435761233c81612a2c565b9050612312565b935061152392505050565b600080825111801561152357508160008151811061236e5761236e612908565b6020910101516001600160f81b031916600360fe1b148061152357508160008151811061239d5761239d612908565b6020910101516001600160f81b031916600160ff1b1492915050565b80516000906015146123ca57600080fd5b611523826113b1565b6060816001600160401b038111156123ed576123ed61283b565b6040519080825280601f01601f191660200182016040528015612417576020820181803683370190505b5090506020810161203c848285612527565b60008061243884518451612511565b905060005b818110156125065783818151811061245757612457612908565b602001015160f81c60f81b6001600160f81b03191685828151811061247e5761247e612908565b01602001516001600160f81b031916146124f6576124d88582815181106124a7576124a7612908565b602001015160f81c60f81b8583815181106124c4576124c4612908565b01602001516001600160f81b031916612595565b6124e3600283612ae4565b6124ed9190612a83565b92505050611523565b6124ff81612a2c565b905061243d565b612127600282612ae4565b6000818310612520578161182d565b5090919050565b6020811061255f578251825261253e602083612a83565b915061254b602084612a83565b9250612558602082612a96565b9050612527565b6000811561258f576001612574836020612a96565b61258090610100612bf8565b61258a9190612a96565b6120ed565b50505050565b60006001600160f81b0319808316908416036125b357506002611523565b8160f81c60f01660ff168360f81c60f01660ff16036125d457506001611523565b506000611523565b604051806060016040528060006001600160a01b0316815260200160608152602001606081525090565b60408051610140810182526000808252602080830182905282840182905260608084018390526080840183905260a0840183905260c0840183905260e084018390526101008401839052845180860190955284528301529061012082015290565b905290565b6040518060400160405280612694604051806040016040528060608152602001600081525090565b815260408051608081018252600080825260208281018290529282015260608082015291015290565b60405180604001604052806126d0612707565b81526020016126675b6040518061020001604052806010905b6126f1612707565b8152602001906001900390816126e95790505090565b6040518060400160405280600015158152602001612667604080516080810182526000808252602082018190529181019190915260608082015290565b60008083601f84011261275657600080fd5b5081356001600160401b0381111561276d57600080fd5b6020830191508360208260051b850101111561278857600080fd5b9250929050565b600080600080600080608087890312156127a857600080fd5b86356001600160401b03808211156127bf57600080fd5b818901915089601f8301126127d357600080fd5b8135818111156127e257600080fd5b8a60208285010111156127f457600080fd5b6020928301985096509088013594506040880135908082111561281657600080fd5b5061282389828a01612744565b979a9699509497949695606090950135949350505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b03811182821017156128795761287961283b565b604052919050565b600080828403606081121561289557600080fd5b60408112156128a357600080fd5b50604051604081018181106001600160401b03821117156128c6576128c661283b565b6040908152845182526020808601519083015284015190925080151581146128ed57600080fd5b809150509250929050565b8183823760009101908152919050565b634e487b7160e01b600052603260045260246000fd5b60006001600160401b03808411156129385761293861283b565b8360051b6020612949818301612851565b86815291850191818101903684111561296157600080fd5b865b848110156129e65780358681111561297b5760008081fd5b8801601f368183011261298e5760008081fd5b8135888111156129a0576129a061283b565b6129b1818301601f19168801612851565b915080825236878285010111156129c85760008081fd5b80878401888401376000908201870152845250918301918301612963565b50979650505050505050565b80516020808301519190811015611f945760001960209190910360031b1b16919050565b634e487b7160e01b600052601160045260246000fd5b600060018201612a3e57612a3e612a16565b5060010190565b634e487b7160e01b600052601260045260246000fd5b600082612a6a57612a6a612a45565b500690565b600082612a7e57612a7e612a45565b500490565b8082018082111561152357611523612a16565b8181038181111561152357611523612a16565b60ff818116838216019081111561152357611523612a16565b600060ff831680612ad557612ad5612a45565b8060ff84160691505092915050565b808202811582820484141761152357611523612a16565b60ff828116828216039081111561152357611523612a16565b600181815b80851115612b4f578160001904821115612b3557612b35612a16565b80851615612b4257918102915b93841c9390800290612b19565b509250929050565b600082612b6657506001611523565b81612b7357506000611523565b8160018114612b895760028114612b9357612baf565b6001915050611523565b60ff841115612ba457612ba4612a16565b50506001821b611523565b5060208310610133831016604e8410600b8410161715612bd2575081810a611523565b612bdc8383612b14565b8060001904821115612bf057612bf0612a16565b029392505050565b600061182d8383612b5756fea2646970667358221220dbc8526868f325378847dd37be2e85878e58dc7850293f492c6ea5b5b8cfdf5964736f6c63430008120033", + ABI: "[{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"sourceBlockchainID_\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"sourceOracleAggregator_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"int256\",\"name\":\"currentAnswer\",\"type\":\"int256\"},{\"indexed\":false,\"internalType\":\"uint80\",\"name\":\"roundID\",\"type\":\"uint80\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"updatedAt\",\"type\":\"uint256\"}],\"name\":\"AnswerUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"sourceBlockchainID\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"sourceBlockHash\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"loggerAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"txIndex\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"logIndex\",\"type\":\"uint256\"}],\"name\":\"EventImported\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"ANSWER_UPDATED_EVENT_SIGNATURE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"currentAnswer\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"blockHeader\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"txIndex\",\"type\":\"uint256\"},{\"internalType\":\"bytes[]\",\"name\":\"receiptProof\",\"type\":\"bytes[]\"},{\"internalType\":\"uint256\",\"name\":\"logIndex\",\"type\":\"uint256\"}],\"name\":\"importEvent\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestRoundData\",\"outputs\":[{\"internalType\":\"uint80\",\"name\":\"\",\"type\":\"uint80\"},{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint80\",\"name\":\"\",\"type\":\"uint80\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestSourceBlockNumber\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestSourceLogIndex\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestSourceTxIndex\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"roundID\",\"outputs\":[{\"internalType\":\"uint80\",\"name\":\"\",\"type\":\"uint80\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"sourceBlockchainID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"sourceOracleAggregator\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"updatedAt\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"warpMessenger\",\"outputs\":[{\"internalType\":\"contractIWarpMessenger\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", + Bin: "0x60c06040523480156200001157600080fd5b5060405162002da438038062002da4833981016040819052620000349162000072565b600080546001600160a01b0319167302000000000000000000000000000000000000051790556080919091526001600160a01b031660a052620000b1565b600080604083850312156200008657600080fd5b825160208401519092506001600160a01b0381168114620000a657600080fd5b809150509250929050565b60805160a051612cbf620000e5600039600081816101b70152610fda0152600081816101410152610f740152612cbf6000f3fe608060405234801561001057600080fd5b50600436106100b45760003560e01c80637519ab50116100715780637519ab501461016c5780637e1b4cb0146101755780638716cde51461017e578063c9572e1414610187578063ce2723fc146101b2578063feaf968c146101d957600080fd5b8063042a7c97146100b957806308fd4323146100f35780630a8bfac9146100fc57806314f8b4241461011157806329b7b3fd1461013c5780634af37a1114610163575b600080fd5b6100e07f0559884fd3a460db3073b7fc896cc77986f16e378210ded43186175bf646fc5f81565b6040519081526020015b60405180910390f35b6100e060065481565b61010f61010a366004612807565b610215565b005b600254610124906001600160501b031681565b6040516001600160501b0390911681526020016100ea565b6100e07f000000000000000000000000000000000000000000000000000000000000000081565b6100e060055481565b6100e060035481565b6100e060015481565b6100e060045481565b60005461019a906001600160a01b031681565b6040516001600160a01b0390911681526020016100ea565b61019a7f000000000000000000000000000000000000000000000000000000000000000081565b6101e1610604565b604080516001600160501b03968716815260208101959095528401929092526060830152909116608082015260a0016100ea565b6000805460405163ce7f592960e01b81526004810183905282916001600160a01b03169063ce7f592990602401606060405180830381865afa15801561025f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102839190612906565b91509150806102d15760405162461bcd60e51b8152602060048201526015602482015274092dcecc2d8d2c840aec2e4e084d8dec6d690c2e6d605b1b60448201526064015b60405180910390fd5b816020015188886040516102e692919061297d565b6040518091039020146103315760405162461bcd60e51b815260206004820152601360248201527224b73b30b634b210313637b1b5a432b0b232b960691b60448201526064016102c8565b6000806103738a8a8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061066c92505050565b60408051600180825281830190925292945090925060009190816020015b60608152602001906001900390816103915790505090506103b18961074f565b816000815181106103c4576103c461298d565b602090810291909101015260006103e5836103df8a8c6129a3565b846107ea565b9050805160011461044b5760405162461bcd60e51b815260206004820152602a60248201527f496e76616c6964206e756d626572206f6620726573756c747320696e2072656360448201526932b4b83a10383937b7b360b11b60648201526084016102c8565b6000816000815181106104605761046061298d565b60200260200101516020015151116104b25760405162461bcd60e51b815260206004820152601560248201527424b73b30b634b2103932b1b2b4b83a10383937b7b360591b60448201526064016102c8565b60006104e36104de836000815181106104cd576104cd61298d565b602002602001015160200151610c7b565b610ca8565b9050806080015151881061052d5760405162461bcd60e51b8152602060048201526011602482015270092dcecc2d8d2c840d8dece40d2dcc8caf607b1b60448201526064016102c8565b61057d6040518060a00160405280896000015181526020018781526020018d81526020018a815260200183608001518b8151811061056d5761056d61298d565b6020026020010151815250610f6e565b806080015188815181106105935761059361298d565b6020026020010151600001516001600160a01b0316876020015188600001517ffdb2f8239033f2b8c1122b2a4b6af55bb0b0b05e4050b5ecd9eafa153d3cd41d8e8c6040516105ec929190918252602082015260400190565b60405180910390a45050505050505050505050505050565b60008060008060006003546000036106485760405162461bcd60e51b81526020600482015260076024820152664e6f206461746160c81b60448201526064016102c8565b50506002546001546003546001600160501b03909216959094509092508291508490565b600080600061068261067d85610c7b565b611314565b9050600f815110156106ed5760405162461bcd60e51b815260206004820152602e60248201527f496e76616c6964206e756d626572206f6620524c5020656c656d656e7473206960448201526d3710313637b1b5903432b0b232b960911b60648201526084016102c8565b6000610712826008815181106107055761070561298d565b6020026020010151611429565b905060006107398360058151811061072c5761072c61298d565b6020026020010151611477565b61074290612a77565b9196919550909350505050565b6060816000036107765750506040805180820190915260018152600160ff1b602082015290565b607f8211156107ba5760405162461bcd60e51b815260206004820152601060248201526f092dcecc2d8d2c840e8f040d2dcc8caf60831b60448201526064016102c8565b6040516001600160f81b031960f884901b1660208201526021016040516020818303038152906040529050919050565b6060600082516001600160401b03811115610807576108076128c0565b60405190808252806020026020018201604052801561084c57816020015b60408051808201909152606080825260208201528152602001906001900390816108255790505b509050600084516001600160401b0381111561086a5761086a6128c0565b6040519080825280602002602001820160405280156108b057816020015b6040805180820190915260008152606060208201528152602001906001900390816108885790505b50905060005b855181101561093d5760405180604001604052808783815181106108dc576108dc61298d565b60200260200101518051906020012081526020018783815181106109025761090261298d565b602002602001015181525082828151811061091f5761091f61298d565b6020026020010181905250808061093590612ab1565b9150506108b6565b5060005b8451811015610c705784818151811061095c5761095c61298d565b60200260200101518382815181106109765761097661298d565b602002602001015160000181905250600060405180604001604052808784815181106109a4576109a461298d565b602002602001015181526020016000815250905060006109cc6109c7858b6114f4565b6115a1565b905060015b8015610c5a576040805160808101825260008082526020820181905291810191909152606080820152610a03836116f6565b15610ad1576000610a138461170b565b9050600060028660200151610a289190612ae0565b15610a4e5760028660200151610a3e9190612af4565b610a49906001612b08565b610a5f565b60028660200151610a5f9190612af4565b90506040518060400160405280610a7a8860000151846117b5565b815260200160008152509550610a9482600001518761187f565b15610ac957610aa78883602001516118ac565b898881518110610ab957610ab961298d565b6020026020010151602001819052505b505050610c5a565b60c083015115610b6f576000610ae6846118f5565b9050610af6858260000151611a19565b15610b62576000610b0a8260000151611a36565b8660200151610b199190612b08565b90506040518060400160405280610b408860000151600285610b3b9190612af4565b6117b5565b8152602001610b50600284612ae0565b81525095508160200151925050610b69565b5050610c5a565b50610c37565b60e083015115610c2a576000610b8484611a59565b9050610b8f85611c61565b15610bda578051511515600103610b6257610bb2878260000151602001516118ac565b888781518110610bc457610bc461298d565b6020026020010151602001819052505050610c5a565b60008160200151610bec876000611c73565b60108110610bfc57610bfc61298d565b602002015180519091501515600103610ac957610c1a866001611cfd565b9550806020015192505050610c37565b825115610c375750610c5a565b610c446109c787836118ac565b9250508080610c5290612ab1565b9150506109d1565b5050508080610c6890612ab1565b915050610941565b509095945050505050565b60408051808201825260008082526020918201528151808301909252825182529182019181019190915290565b6040805160a08101825260008082526060602083018190529282015281810182905260808101919091526000610cdd83611d40565b610d8d57506020820151805160001a906001821480610cff57508160ff166002145b610d555760405162461bcd60e51b815260206004820152602160248201527f496e76616c6964207478207479706520666f72206e6f6e2d6c656761637920746044820152600f60fb1b60648201526084016102c8565b604051806040016040528060018660000151610d719190612b1b565b815260200185602001516001610d879190612b08565b90529350505b6000610d9884611314565b90508051600414610dfd5760405162461bcd60e51b815260206004820152602960248201527f496e76616c6964206e756d626572206f6620524c5020656c656d656e747320696044820152681b881c9958d95a5c1d60ba1b60648201526084016102c8565b6040805160a0810182526060602082018190526000928201839052808201819052608082015260ff8416815282519091610e409184919061072c5761072c61298d565b8160200181905250610e5e826001815181106107055761070561298d565b6001600160401b031660408201528151610e85908390600290811061072c5761072c61298d565b81606001819052506000610eb283600381518110610ea557610ea561298d565b6020026020010151611314565b905080516001600160401b03811115610ecd57610ecd6128c0565b604051908082528060200260200182016040528015610f0657816020015b610ef3612654565b815260200190600190039081610eeb5790505b50608083015260005b8151811015610c7057610f3a828281518110610f2d57610f2d61298d565b6020026020010151611d7b565b83608001518281518110610f5057610f5061298d565b60200260200101819052508080610f6690612ab1565b915050610f0f565b805181907f000000000000000000000000000000000000000000000000000000000000000014610fd85760405162461bcd60e51b8152602060048201526015602482015274125b9d985b1a5908189b1bd8dad8da185a5b881251605a1b60448201526064016102c8565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168160800151600001516001600160a01b03161461105a5760405162461bcd60e51b8152602060048201526016602482015275496e76616c6964206c6f67676572206164647265737360501b60448201526064016102c8565b81806080015160200151516003146110a95760405162461bcd60e51b8152602060048201526012602482015271496e76616c6964206c6f6720746f7069637360701b60448201526064016102c8565b806080015160400151516020146110f55760405162461bcd60e51b815260206004820152601060248201526f496e76616c6964206c6f67206461746160801b60448201526064016102c8565b7f0559884fd3a460db3073b7fc896cc77986f16e378210ded43186175bf646fc5f8160800151602001516000815181106111315761113161298d565b6020026020010151146111865760405162461bcd60e51b815260206004820152601760248201527f496e76616c6964206576656e74207369676e617475726500000000000000000060448201526064016102c8565b826004548160200151101580156111b15750600454816020015111806111b157506005548160400151115b80156111e15750600454816020015111806111d157506005548160400151115b806111e157506006548160600151115b61121b5760405162461bcd60e51b815260206004820152600b60248201526a14dd185b1948195d995b9d60aa1b60448201526064016102c8565b8360800151602001516001815181106112365761123661298d565b602002602001015160001c6001819055508360800151602001516002815181106112625761126261298d565b60209081029190910101516002805469ffffffffffffffffffff19166001600160501b039092169190911790556080840151604001516112a190612a77565b600381905560208581015160045560408087015160055560608088015160065560015460025483519182526001600160501b031693810193909352908201929092527f5b196ccf306f345de8745dffeaf185f4cafe74a334e2b2466d04c880071533b9910160405180910390a150505050565b606061131f82611d40565b61132857600080fd5b600061133383611f0c565b90506000816001600160401b0381111561134f5761134f6128c0565b60405190808252806020026020018201604052801561139457816020015b604080518082019091526000808252602082015281526020019060019003908161136d5790505b50905060006113a68560200151611f91565b85602001516113b59190612b08565b90506000805b8481101561141e576113cc83612012565b91506040518060400160405280838152602001848152508482815181106113f5576113f561298d565b602090810291909101015261140a8284612b08565b92508061141681612ab1565b9150506113bb565b509195945050505050565b80516000901580159061143e57508151602110155b61144757600080fd5b600080611453846120bb565b81519193509150602082101561146f5760208290036101000a90045b949350505050565b805160609061148557600080fd5b600080611491846120bb565b915091506000816001600160401b038111156114af576114af6128c0565b6040519080825280601f01601f1916602001820160405280156114d9576020820181803683370190505b509050602081016114eb8482856120f5565b50949350505050565b606060005b835181101561155e57828482815181106115155761151561298d565b6020026020010151600001510361154c578381815181106115385761153861298d565b60200260200101516020015191505061159b565b8061155681612ab1565b9150506114f9565b5060405162461bcd60e51b8152602060048201526011602482015270496e636f6d706c6574652050726f6f662160781b60448201526064016102c8565b92915050565b6115a961267e565b6115b161267e565b600060405180604001604052808581526020016000815250905061160a846040518060400160405280602081526020017f56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421815250612178565b1561161a57506001815292915050565b600061162861067d86610c7b565b80519091506000819003611643575050600182525092915050565b8060020361169d5760006116638360008151811061072c5761072c61298d565b602081015190915060fc1c600281148061167d5750806003145b1561168e5760016020870152611696565b600160c08701525b50506116e8565b806011036116b157600160e08501526116e8565b60405162461bcd60e51b815260206004820152600c60248201526b496e76616c6964206461746160a01b60448201526064016102c8565b505061012082015292915050565b600081602001518061159b5750506040015190565b6117136126e4565b61171b6126e4565b600061173261067d85610120015160000151610c7b565b9050600061174c8260018151811061072c5761072c61298d565b905060405180604001604052806117796117728560008151811061072c5761072c61298d565b60016121a8565b81526000602091820181905291855260408051608081018252838152808301939093526001908301526060820192909252908301525092915050565b815160609060006117c68483612b1b565b90508382101561180c5760405162461bcd60e51b8152602060048201526011602482015270736c6963655f6f75744f66426f756e647360781b60448201526064016102c8565b60608115801561182b5760405191506000825260208201604052611875565b6040519150601f8316801560200281840101848101888315602002848c0101015b8183101561186457805183526020928301920161184c565b5050848452601f01601f1916604052505b5095945050505050565b600061188a82611a36565b61189384611a36565b1480156118a557506118a58383611a19565b9392505050565b60608160400151156118c35750606081015161159b565b8151156118df576118d88383602001516114f4565b905061159b565b5060408051602081019091526000815292915050565b6118fd6126e4565b6119056126e4565b600061191c61067d85610120015160000151610c7b565b905060006119368260018151811061072c5761072c61298d565b9050600060046119528460008151811061072c5761072c61298d565b6000815181106119645761196461298d565b602001015160f81c60f81b6001600160f81b031916901c60f81c600116905060405180604001604052806119c66119a78660008151811061072c5761072c61298d565b60026119b4866001612b2e565b6119be9190612b47565b60ff166121a8565b815260ff83166020918201529085526040805160808101909152600181529081016119f0846121e0565b815260006020808301829052604080519283528282018152909201528501525091949350505050565b6000611a2482611a36565b611a2e8484612248565b149392505050565b600081602001516002836000015151611a4f9190612b69565b61159b9190612b1b565b611a61612735565b611a69612735565b6000611a8061067d85610120015160000151610c7b565b9050611a8a612751565b60005b6010811015611b92576000611aad84838151811061072c5761072c61298d565b90508051602014611b15576040805180820182526000808252825160808101845281815260208082018390528185018390528451928352828101909452606081019190915291810191909152838360108110611b0b57611b0b61298d565b6020020152611b7f565b6000611b20826121e0565b60408051808201825260018082528251608081018452908152602080820185905260008285018190528451908152808201909452606082019390935291810191909152909150848460108110611b7857611b7861298d565b6020020152505b5080611b8a81612ab1565b915050611a8d565b50611bb1611bac8360108151811061072c5761072c61298d565b6123c6565b15611bfe5760408051808201825260008082528251608081018452818152602080820183905281850183905284519283528281019094526060810191909152918101919091528352611c55565b604051806040016040528060011515815260200160405180608001604052806000151581526020016000801b8152602001600115158152602001611c4e8660108151811061072c5761072c61298d565b9052905283525b60208301525092915050565b6000611c6c82611a36565b1592915050565b6000806002838560200151611c889190612b08565b611c929190612af4565b905060006002848660200151611ca89190612b08565b611cb29190612ae0565b9050600085600001518381518110611ccc57611ccc61298d565b016020015160f81c905060018214611ceb5760048160ff16901c611cf0565b80600f165b60ff169695505050505050565b604080518082019091526060815260006020820152604051806040016040528084600001518152602001838560200151611d379190612b08565b90529392505050565b80516000908103611d5357506000919050565b6020820151805160001a9060c0821015611d71575060009392505050565b5060019392505050565b611d83612654565b6000611d8e83611314565b90508051600314611def5760405162461bcd60e51b815260206004820152602560248201527f496e76616c6964206e756d626572206f6620524c5020656c656d656e747320696044820152646e206c6f6760d81b60648201526084016102c8565b611df7612654565b611e1a82600081518110611e0d57611e0d61298d565b6020026020010151612431565b6001600160a01b031681528151600090611e419084906001908110610ea557610ea561298d565b905080516001600160401b03811115611e5c57611e5c6128c0565b604051908082528060200260200182016040528015611e85578160200160208202803683370190505b50602083015260005b8151811015611ee857611eac82828151811061072c5761072c61298d565b611eb590612a77565b83602001518281518110611ecb57611ecb61298d565b602090810291909101015280611ee081612ab1565b915050611e8e565b50611eff8360028151811061072c5761072c61298d565b6040830152509392505050565b80516000908103611f1f57506000919050565b600080611f2f8460200151611f91565b8460200151611f3e9190612b08565b9050600084600001518560200151611f569190612b08565b90505b80821015611f8857611f6a82612012565b611f749083612b08565b915082611f8081612ab1565b935050611f59565b50909392505050565b8051600090811a6080811015611faa5750600092915050565b60b8811080611fc5575060c08110801590611fc5575060f881105b15611fd35750600192915050565b60c081101561200057611fe8600160b8612b80565b611ff59060ff1682612b1b565b6118a5906001612b08565b611fe8600160f8612b80565b50919050565b80516000908190811a608081101561202d57600191506120b4565b60b881101561205357612041608082612b1b565b61204c906001612b08565b91506120b4565b60c08110156120805760b78103600185019450806020036101000a855104600182018101935050506120b4565b60f88110156120945761204160c082612b1b565b60f78103600185019450806020036101000a855104600182018101935050505b5092915050565b60008060006120cd8460200151611f91565b905060008185602001516120e19190612b08565b905060008286600001516107429190612b1b565b8060000361210257505050565b6020811061213a5782518252612119602084612b08565b9250612126602083612b08565b9150612133602082612b1b565b9050612102565b8015612173576000600161214f836020612b1b565b61215b90610100612c7d565b6121659190612b1b565b845184518216911916178352505b505050565b6000815183511461218b5750600061159b565b825160208381018281209186019283209091145b95945050505050565b606082518211156121b857600080fd5b60008284516121c79190612b1b565b90506020840161219f6121da8583612b08565b8361244b565b60006020825110156122405760405162461bcd60e51b8152602060048201526024808201527f42797465733a3a20746f427974657333323a206461746120697320746f20736860448201526337b93a1760e11b60648201526084016102c8565b506020015190565b6000806002846020015161225c9190612ae0565b90506000600284602001516122719190612ae0565b90508082036123695760006002866020015161228d9190612af4565b90506000600286602001516122a29190612af4565b9050600084156123225786518051839081106122c0576122c061298d565b016020015188518051600f60f81b90921691859081106122e2576122e261298d565b0160200151600f60f81b16146123005760009550505050505061159b565b61230983612ab1565b925061231482612ab1565b915061231f81612ab1565b90505b60006123328960000151856117b5565b905060006123448960000151856117b5565b90508261235183836124a1565b61235b9190612b08565b97505050505050505061159b565b600061238561237787611a36565b61238087611a36565b612589565b905060005b818110156123bb5761239c8682611c73565b6123a68883611c73565b036123bb576123b481612ab1565b905061238a565b935061159b92505050565b600080825111801561159b5750816000815181106123e6576123e661298d565b6020910101516001600160f81b031916600360fe1b148061159b5750816000815181106124155761241561298d565b6020910101516001600160f81b031916600160ff1b1492915050565b805160009060151461244257600080fd5b61159b82611429565b6060816001600160401b03811115612465576124656128c0565b6040519080825280601f01601f19166020018201604052801561248f576020820181803683370190505b509050602081016120b484828561259f565b6000806124b084518451612589565b905060005b8181101561257e578381815181106124cf576124cf61298d565b602001015160f81c60f81b6001600160f81b0319168582815181106124f6576124f661298d565b01602001516001600160f81b0319161461256e5761255085828151811061251f5761251f61298d565b602001015160f81c60f81b85838151811061253c5761253c61298d565b01602001516001600160f81b03191661260d565b61255b600283612b69565b6125659190612b08565b9250505061159b565b61257781612ab1565b90506124b5565b61219f600282612b69565b600081831061259857816118a5565b5090919050565b602081106125d757825182526125b6602083612b08565b91506125c3602084612b08565b92506125d0602082612b1b565b905061259f565b600081156126075760016125ec836020612b1b565b6125f890610100612c7d565b6126029190612b1b565b612165565b50505050565b60006001600160f81b03198083169084160361262b5750600261159b565b8160f81c60f01660ff168360f81c60f01660ff160361264c5750600161159b565b50600061159b565b604051806060016040528060006001600160a01b0316815260200160608152602001606081525090565b60408051610140810182526000808252602080830182905282840182905260608084018390526080840183905260a0840183905260c0840183905260e084018390526101008401839052845180860190955284528301529061012082015290565b905290565b604051806040016040528061270c604051806040016040528060608152602001600081525090565b815260408051608081018252600080825260208281018290529282015260608082015291015290565b604051806040016040528061274861277f565b81526020016126df5b6040518061020001604052806010905b61276961277f565b8152602001906001900390816127615790505090565b60405180604001604052806000151581526020016126df604080516080810182526000808252602082018190529181019190915260608082015290565b60008083601f8401126127ce57600080fd5b5081356001600160401b038111156127e557600080fd5b6020830191508360208260051b850101111561280057600080fd5b9250929050565b600080600080600080600060a0888a03121561282257600080fd5b8735965060208801356001600160401b038082111561284057600080fd5b818a0191508a601f83011261285457600080fd5b81358181111561286357600080fd5b8b602082850101111561287557600080fd5b6020830198508097505060408a0135955060608a013591508082111561289a57600080fd5b506128a78a828b016127bc565b989b979a50959894979596608090950135949350505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b03811182821017156128fe576128fe6128c0565b604052919050565b600080828403606081121561291a57600080fd5b604081121561292857600080fd5b50604051604081018181106001600160401b038211171561294b5761294b6128c0565b60409081528451825260208086015190830152840151909250801515811461297257600080fd5b809150509250929050565b8183823760009101908152919050565b634e487b7160e01b600052603260045260246000fd5b60006001600160401b03808411156129bd576129bd6128c0565b8360051b60206129ce8183016128d6565b8681529185019181810190368411156129e657600080fd5b865b84811015612a6b57803586811115612a005760008081fd5b8801601f3681830112612a135760008081fd5b813588811115612a2557612a256128c0565b612a36818301601f191688016128d6565b91508082523687828501011115612a4d5760008081fd5b808784018884013760009082018701528452509183019183016129e8565b50979650505050505050565b8051602080830151919081101561200c5760001960209190910360031b1b16919050565b634e487b7160e01b600052601160045260246000fd5b600060018201612ac357612ac3612a9b565b5060010190565b634e487b7160e01b600052601260045260246000fd5b600082612aef57612aef612aca565b500690565b600082612b0357612b03612aca565b500490565b8082018082111561159b5761159b612a9b565b8181038181111561159b5761159b612a9b565b60ff818116838216019081111561159b5761159b612a9b565b600060ff831680612b5a57612b5a612aca565b8060ff84160691505092915050565b808202811582820484141761159b5761159b612a9b565b60ff828116828216039081111561159b5761159b612a9b565b600181815b80851115612bd4578160001904821115612bba57612bba612a9b565b80851615612bc757918102915b93841c9390800290612b9e565b509250929050565b600082612beb5750600161159b565b81612bf85750600061159b565b8160018114612c0e5760028114612c1857612c34565b600191505061159b565b60ff841115612c2957612c29612a9b565b50506001821b61159b565b5060208310610133831016604e8410600b8410161715612c57575081810a61159b565b612c618383612b99565b8060001904821115612c7557612c75612a9b565b029392505050565b60006118a58383612bdc56fea26469706673582212203df60811a03d8fb800928ecd4ed94b7eb8aadfd17718decd761001eee182303264736f6c63430008120033", } // PriceFeedImporterABI is the input ABI used to generate the binding from. @@ -547,25 +547,25 @@ func (_PriceFeedImporter *PriceFeedImporterCallerSession) WarpMessenger() (commo return _PriceFeedImporter.Contract.WarpMessenger(&_PriceFeedImporter.CallOpts) } -// ImportEvent is a paid mutator transaction binding the contract method 0xa47b555e. +// ImportEvent is a paid mutator transaction binding the contract method 0x0a8bfac9. // -// Solidity: function importEvent(bytes blockHeader, uint256 txIndex, bytes[] receiptProof, uint256 logIndex) returns() -func (_PriceFeedImporter *PriceFeedImporterTransactor) ImportEvent(opts *bind.TransactOpts, blockHeader []byte, txIndex *big.Int, receiptProof [][]byte, logIndex *big.Int) (*types.Transaction, error) { - return _PriceFeedImporter.contract.Transact(opts, "importEvent", blockHeader, txIndex, receiptProof, logIndex) +// Solidity: function importEvent(bytes32 , bytes blockHeader, uint256 txIndex, bytes[] receiptProof, uint256 logIndex) returns() +func (_PriceFeedImporter *PriceFeedImporterTransactor) ImportEvent(opts *bind.TransactOpts, arg0 [32]byte, blockHeader []byte, txIndex *big.Int, receiptProof [][]byte, logIndex *big.Int) (*types.Transaction, error) { + return _PriceFeedImporter.contract.Transact(opts, "importEvent", arg0, blockHeader, txIndex, receiptProof, logIndex) } -// ImportEvent is a paid mutator transaction binding the contract method 0xa47b555e. +// ImportEvent is a paid mutator transaction binding the contract method 0x0a8bfac9. // -// Solidity: function importEvent(bytes blockHeader, uint256 txIndex, bytes[] receiptProof, uint256 logIndex) returns() -func (_PriceFeedImporter *PriceFeedImporterSession) ImportEvent(blockHeader []byte, txIndex *big.Int, receiptProof [][]byte, logIndex *big.Int) (*types.Transaction, error) { - return _PriceFeedImporter.Contract.ImportEvent(&_PriceFeedImporter.TransactOpts, blockHeader, txIndex, receiptProof, logIndex) +// Solidity: function importEvent(bytes32 , bytes blockHeader, uint256 txIndex, bytes[] receiptProof, uint256 logIndex) returns() +func (_PriceFeedImporter *PriceFeedImporterSession) ImportEvent(arg0 [32]byte, blockHeader []byte, txIndex *big.Int, receiptProof [][]byte, logIndex *big.Int) (*types.Transaction, error) { + return _PriceFeedImporter.Contract.ImportEvent(&_PriceFeedImporter.TransactOpts, arg0, blockHeader, txIndex, receiptProof, logIndex) } -// ImportEvent is a paid mutator transaction binding the contract method 0xa47b555e. +// ImportEvent is a paid mutator transaction binding the contract method 0x0a8bfac9. // -// Solidity: function importEvent(bytes blockHeader, uint256 txIndex, bytes[] receiptProof, uint256 logIndex) returns() -func (_PriceFeedImporter *PriceFeedImporterTransactorSession) ImportEvent(blockHeader []byte, txIndex *big.Int, receiptProof [][]byte, logIndex *big.Int) (*types.Transaction, error) { - return _PriceFeedImporter.Contract.ImportEvent(&_PriceFeedImporter.TransactOpts, blockHeader, txIndex, receiptProof, logIndex) +// Solidity: function importEvent(bytes32 , bytes blockHeader, uint256 txIndex, bytes[] receiptProof, uint256 logIndex) returns() +func (_PriceFeedImporter *PriceFeedImporterTransactorSession) ImportEvent(arg0 [32]byte, blockHeader []byte, txIndex *big.Int, receiptProof [][]byte, logIndex *big.Int) (*types.Transaction, error) { + return _PriceFeedImporter.Contract.ImportEvent(&_PriceFeedImporter.TransactOpts, arg0, blockHeader, txIndex, receiptProof, logIndex) } // PriceFeedImporterAnswerUpdatedIterator is returned from FilterAnswerUpdated and is used to iterate over the raw logs and unpacked data for AnswerUpdated events raised by the PriceFeedImporter contract. @@ -703,3 +703,167 @@ func (_PriceFeedImporter *PriceFeedImporterFilterer) ParseAnswerUpdated(log type event.Raw = log return event, nil } + +// PriceFeedImporterEventImportedIterator is returned from FilterEventImported and is used to iterate over the raw logs and unpacked data for EventImported events raised by the PriceFeedImporter contract. +type PriceFeedImporterEventImportedIterator struct { + Event *PriceFeedImporterEventImported // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub interfaces.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *PriceFeedImporterEventImportedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(PriceFeedImporterEventImported) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(PriceFeedImporterEventImported) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *PriceFeedImporterEventImportedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *PriceFeedImporterEventImportedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// PriceFeedImporterEventImported represents a EventImported event raised by the PriceFeedImporter contract. +type PriceFeedImporterEventImported struct { + SourceBlockchainID [32]byte + SourceBlockHash [32]byte + LoggerAddress common.Address + TxIndex *big.Int + LogIndex *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterEventImported is a free log retrieval operation binding the contract event 0xfdb2f8239033f2b8c1122b2a4b6af55bb0b0b05e4050b5ecd9eafa153d3cd41d. +// +// Solidity: event EventImported(bytes32 indexed sourceBlockchainID, bytes32 indexed sourceBlockHash, address indexed loggerAddress, uint256 txIndex, uint256 logIndex) +func (_PriceFeedImporter *PriceFeedImporterFilterer) FilterEventImported(opts *bind.FilterOpts, sourceBlockchainID [][32]byte, sourceBlockHash [][32]byte, loggerAddress []common.Address) (*PriceFeedImporterEventImportedIterator, error) { + + var sourceBlockchainIDRule []interface{} + for _, sourceBlockchainIDItem := range sourceBlockchainID { + sourceBlockchainIDRule = append(sourceBlockchainIDRule, sourceBlockchainIDItem) + } + var sourceBlockHashRule []interface{} + for _, sourceBlockHashItem := range sourceBlockHash { + sourceBlockHashRule = append(sourceBlockHashRule, sourceBlockHashItem) + } + var loggerAddressRule []interface{} + for _, loggerAddressItem := range loggerAddress { + loggerAddressRule = append(loggerAddressRule, loggerAddressItem) + } + + logs, sub, err := _PriceFeedImporter.contract.FilterLogs(opts, "EventImported", sourceBlockchainIDRule, sourceBlockHashRule, loggerAddressRule) + if err != nil { + return nil, err + } + return &PriceFeedImporterEventImportedIterator{contract: _PriceFeedImporter.contract, event: "EventImported", logs: logs, sub: sub}, nil +} + +// WatchEventImported is a free log subscription operation binding the contract event 0xfdb2f8239033f2b8c1122b2a4b6af55bb0b0b05e4050b5ecd9eafa153d3cd41d. +// +// Solidity: event EventImported(bytes32 indexed sourceBlockchainID, bytes32 indexed sourceBlockHash, address indexed loggerAddress, uint256 txIndex, uint256 logIndex) +func (_PriceFeedImporter *PriceFeedImporterFilterer) WatchEventImported(opts *bind.WatchOpts, sink chan<- *PriceFeedImporterEventImported, sourceBlockchainID [][32]byte, sourceBlockHash [][32]byte, loggerAddress []common.Address) (event.Subscription, error) { + + var sourceBlockchainIDRule []interface{} + for _, sourceBlockchainIDItem := range sourceBlockchainID { + sourceBlockchainIDRule = append(sourceBlockchainIDRule, sourceBlockchainIDItem) + } + var sourceBlockHashRule []interface{} + for _, sourceBlockHashItem := range sourceBlockHash { + sourceBlockHashRule = append(sourceBlockHashRule, sourceBlockHashItem) + } + var loggerAddressRule []interface{} + for _, loggerAddressItem := range loggerAddress { + loggerAddressRule = append(loggerAddressRule, loggerAddressItem) + } + + logs, sub, err := _PriceFeedImporter.contract.WatchLogs(opts, "EventImported", sourceBlockchainIDRule, sourceBlockHashRule, loggerAddressRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(PriceFeedImporterEventImported) + if err := _PriceFeedImporter.contract.UnpackLog(event, "EventImported", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseEventImported is a log parse operation binding the contract event 0xfdb2f8239033f2b8c1122b2a4b6af55bb0b0b05e4050b5ecd9eafa153d3cd41d. +// +// Solidity: event EventImported(bytes32 indexed sourceBlockchainID, bytes32 indexed sourceBlockHash, address indexed loggerAddress, uint256 txIndex, uint256 logIndex) +func (_PriceFeedImporter *PriceFeedImporterFilterer) ParseEventImported(log types.Log) (*PriceFeedImporterEventImported, error) { + event := new(PriceFeedImporterEventImported) + if err := _PriceFeedImporter.contract.UnpackLog(event, "EventImported", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/contracts/src/EventImporter.sol b/contracts/src/EventImporter.sol index 4c20ef3..f733deb 100644 --- a/contracts/src/EventImporter.sol +++ b/contracts/src/EventImporter.sol @@ -37,10 +37,16 @@ abstract contract EventImporter is IEventImporter { * 2. Verifies that the provided blockHeader matches the authenticated block hash. * 3. Gets the receipt at the given transaction index by verifying the merkle proof against the block header's receipt root. * 4. Decodes and returns the log at the given log index from the receipt. + * Note: The first argument (sourceBlockchainID) is not used in this example because it is fetched from + * WarpBlockHash provided by the Warp precompile. */ - function importEvent(bytes calldata blockHeader, uint256 txIndex, bytes[] calldata receiptProof, uint256 logIndex) - external - { + function importEvent( + bytes32, + bytes calldata blockHeader, + uint256 txIndex, + bytes[] calldata receiptProof, + uint256 logIndex + ) external { // Get the verified block has via the Warp precompile. (WarpBlockHash memory warpBlockHash, bool valid) = warpMessenger.getVerifiedWarpBlockHash(0); require(valid, "Invalid WarpBlockHash"); diff --git a/contracts/src/IEventImporter.sol b/contracts/src/IEventImporter.sol index 7df4f06..9cb30eb 100644 --- a/contracts/src/IEventImporter.sol +++ b/contracts/src/IEventImporter.sol @@ -61,6 +61,11 @@ interface IEventImporter { * the block header's receipt root. * 4. Decodes and returns the log at the given log index from the receipt. */ - function importEvent(bytes calldata blockHeader, uint256 txIndex, bytes[] calldata receiptProof, uint256 logIndex) - external; + function importEvent( + bytes32 sourceBlockchainID, + bytes calldata blockHeader, + uint256 txIndex, + bytes[] calldata receiptProof, + uint256 logIndex + ) external; } diff --git a/contracts/test/PriceFeedImporterTests.sol b/contracts/test/PriceFeedImporterTests.sol index ffcf5b1..7cc729c 100644 --- a/contracts/test/PriceFeedImporterTests.sol +++ b/contracts/test/PriceFeedImporterTests.sol @@ -60,7 +60,7 @@ contract PriceFeedImporterTest is Test { emit AnswerUpdated(6_601_600_000_000, 179_712, 1_715_809_933); vm.expectEmit(true, true, true, true); emit EventImported(DEFAULT_BLOCKCHAIN_ID, blockHash, 0x154baB1FC1D87fF641EeD0E9Bc0f8a50D880D2B6, 8, 2); - priceFeedImporter.importEvent(encodedBlockHeader, 8, proof, 2); + priceFeedImporter.importEvent(bytes32(0), encodedBlockHeader, 8, proof, 2); // Verify the latest round data. (uint80 roundID, int256 currentAnswer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound) = diff --git a/tests/utils/utils.go b/tests/utils/utils.go index 3f76093..dc1b9fc 100644 --- a/tests/utils/utils.go +++ b/tests/utils/utils.go @@ -124,6 +124,7 @@ func ConstructImportEventTransaction( Expect(err).Should(BeNil()) importEventData, err := importerABI.Pack( "importEvent", + common.Hash{}, encodedBlockHeader, big.NewInt(int64(txIndex)), encodedReceiptProof,