requestPrice(bytes32,uint256) :
This function is used to request a price from the contract. It takes in three parameters: an identifier, a time, and ancillary data. It first encodes the parameters into a price request ID, and then checks if the request has already been made. If it has, the function returns. Otherwise, it calls the _requestPrice() function to make the request, and then calls the _getBridge() function to deposit the resource ID, along with the encoded parameters, onto the destination chain. (autogenerated documentation)
validateDeposit(uint8,bytes32,uint256) :
This function is used to validate a deposit on the Ethereum blockchain. It takes in four parameters: the sink chain ID, an identifier, a time, and ancillary data. It then calls the _finalizeRequest() function, which is used to finalize the deposit request and ensure that the deposit is valid. This function is used to ensure that the deposit is valid and that the data provided is correct. (autogenerated documentation)
executePublishPrice(uint8,bytes32,uint256,int256) :
This function is used to publish a price to the blockchain. It takes in a sinkChainID, an identifier, a time, ancillaryData, and a price as parameters. It then calls the _publishPrice function to publish the price to the blockchain, and then calls the _finalizePublish function to finalize the publishing process. (autogenerated documentation)
hasPrice(bytes32,uint256) :
This function checks if a price has been set for a given identifier, time, and ancillary data. It does this by first encoding the given parameters into a unique price request ID, and then checking if the corresponding entry in the 'prices' mapping has a state of 'Resolved'. If so, the function returns true, indicating that a price has been set. (autogenerated documentation)
getPrice(bytes32,uint256) :
This function is used to retrieve the price of a given asset, identified by its identifier, at a given time. It takes in the identifier, time, and ancillary data as parameters and returns an int256 representing the price. It first encodes the price request using the currentChainID, identifier, time, and ancillary data, and then looks up the price in the prices mapping. It requires that the price has been resolved before returning the price. (autogenerated documentation)
getResourceId() :
This function returns a bytes32 resource ID that is generated by hashing the parameters "Oracle" and the destinationChainID. This resource ID is used to identify the Oracle contract on the destination chain. (autogenerated documentation)
formatMetadata(uint8,bytes32,uint256) :
This function is used to format metadata into a byte array. It takes four parameters: chainID (uint8), identifier (bytes32), time (uint256), and ancillaryData (bytes). It then encodes these parameters into a byte array and returns the encoded data. The function also encodes the length of the byte array before returning it. (autogenerated documentation)