Request form
Cookbook may introduce a token in the future. Share and contribute to be eligible for future airdrops.
close icon
relevant tag icon
UMA Beacon Oracle
copy icon
UMA
• version 1.0.0
Oracle
Utiliity
Finance
Dispute
Audited

UMA Beacon Oracle

Audited

Simple implementation of the OracleInterface used to communicate price request data cross-chain between EVM networks. Can be extended either into a "Source" or "Sink" oracle that specializes in making and resolving cross-chain price requests, respectively. The "Source" Oracle is the originator or source of price resolution data and can only resolve prices already published by the DVM. The "Sink" Oracle receives the price resolution data from the Source Oracle and makes it available on non-Mainnet chains. The "Sink" Oracle can also be used to trigger price requests from the DVM on Mainnet.

*Visit desktop site to download or deploy

Version

1.0.0

Creator

UMA

Recent Use

🍞 0x77eA downloaded

Last Publish

11/5/2022
Any contract you deploy is yours.
Fully owned and controlled by your wallet.
Documentation
Source Code
_requestPrice(uint8,bytes32,uint256) :
This function is used to request a price from an external source. It takes in four parameters: chainID, identifier, time, and ancillaryData. It then encodes these parameters into a bytes32 priceRequestId. It then checks if the price has been requested before by looking up the priceRequestId in the prices mapping. If the price has never been requested before, it sets the state of the request to pending and emits an event. (autogenerated documentation)
_finalizeRequest(uint8,bytes32,uint256) :
This function is used to finalize a request for a price. It takes in the chain ID, an identifier, a timestamp, and ancillary data as parameters. It then encodes the parameters into a price request ID and looks up the corresponding price in the prices mapping. It then checks that the state of the price is PendingRequest and sets the state to Requested. (autogenerated documentation)
_publishPrice(uint8,bytes32,uint256,int256) :
This function is used to publish a price for a given request. It takes in the chainID, identifier, time, ancillaryData, and price as parameters. It first encodes the price request using the _encodePriceRequest function. It then looks up the price request in the prices mapping and checks that the state is Requested. If it is, it sets the price and state to PendingResolve and emits an event. (autogenerated documentation)
_finalizePublish(uint8,bytes32,uint256) :
This function is used to finalize the publishing of a price request. It takes in the chain ID, identifier, time, and ancillary data as parameters. It then encodes the price request using the provided parameters and looks up the corresponding price in the prices mapping. It then checks that the state of the price is PendingResolve and sets it to Resolved if it is. (autogenerated documentation)
_getBridge() :
This function is an internal view function that returns an IBridge interface. It uses the finder contract to get the address of the OracleInterfaces.Bridge interface, and then returns an IBridge interface based on that address. (autogenerated documentation)
_encodePriceRequest(uint8,bytes32,uint256) :
This function is used to encode a price request for a given chain ID, identifier, time, and ancillary data. It works by taking the given parameters and encoding them into a single bytes32 value using the keccak256 hashing algorithm. The resulting bytes32 value is then returned as the encoded price request. (autogenerated documentation)

Get Cookin'
share iconShare

copy iconDownload Source
copy iconnpx cookbookdev i uma-beacon-oracle
copy icon

Recent Use

🍞 0x77eA downloaded

Last Publish

11/5/2022

Version

1.0.0

Creator

UMA

Cookbook is free.
Any contract you deploy is yours.
Your contract is owned and controlled by you.