Oracle
Last updated
Last updated
The constructor initializes the smart contract and sets the default roles. It also transfers ownership to the specified address and calculates the domain separator for EIP-712 signatures.
Name | Type | Description |
---|---|---|
The updateObservation
function is used to update the Oracle price if the following conditions are satisfied
All signers must reach a consensus and produce a signed message containing the same price observation
Each signed message must be created by a different signer
Each signed message must have a deadline not already passed
The number of signers is equal to or greater than the signer threshold
The cooldown period has elapsed since the last update
The percentage change between the old and new price observation is within an allowed delta
The freeze
function is an external function that allows designated operators to freeze the contract in case of emergency.
The unfreeze
function is an external function that allows the contract owner operators to unfreeze the contract to resume normal operativity.
The setMaximumDeltaPercentage
function is an external function that allows the owner of the contract to set the maximum allowed delta percentage for updates to the price observation.
The setThreshold
function is an external function that allows the owner of the contract to set the minimum required number of signers for updates to the observation state.
The precision used by the contract to handle the observation value
The number of seconds the latest price observation is considered valid and up to date
The get
function is a public view function that allows external callers to retrieve information about the current observation state stored in the contract. It returns a boolean indicating the validity of the observation and the actual observation value.
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Index? |
---|---|---|
Name | Type | Index? |
---|---|---|
Name | Type | Index? |
---|---|---|
Name | Type | Index? |
---|---|---|
to
address
The address to which ownership of the contract will be transferred during initialization.
value
uint144
The new observation value to be updated
signers
address[]
An array of addresses representing the signers involved in the update
deadline
uint256[]
An array of deadlines corresponding to each signatures
v
uint8[]
An array of the 'v' components of the ECDSA signatures
r
bytes32[]
An array of the 'r' components of the ECDSA signatures
s
bytes32[]
An array of the s' components of the ECDSA signatures
maximumDeltaPercentage
uint32
The new maximum allowed delta percentage for updates
theshold
uint8
The new minimum required number of signers
*
bytes
The function does not take any input parameters
isValid
bool
If true the observation has been updated within HEARTBEAT seconds
observation
uint256
Latest price observation
timestamp
uint256
No
observation
uint144
No
timestamp
uint256
No
frozen
uint8
No
timestamp
uint256
No
maxDeltaPercentage
uint32
No
timestamp
uint256
No
signerThreshold
uint8
No