Oracle
Oracle contract relying on Chainlink for price
Methods
DEFAULT_ADMIN_ROLE
Returns
EMERGENCY_ADMIN
Returns
GOVERNANCE
Returns
assetToOracles
Parameters
Returns
getPrice
Get latest Chainlink price, except if a fixed price is defined for this asset
Use this getter for assets which are ERC-4626 vaultsPass the balance to account for slippage in the ERC4626 contract
Parameters
Returns
getRoleAdmin
Returns the admin role that controls role
. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}.
Parameters
Returns
gracePeriod
Returns
grantRole
Grants role
to account
. If account
had not been already granted role
, emits a {RoleGranted} event. Requirements: - the caller must have role
's admin role. May emit a {RoleGranted} event.
Parameters
hasRole
Returns true
if account
has been granted role
.
Parameters
Returns
isEmergencyAdmin
Parameters
Returns
isGovernor
Parameters
Returns
renounceRole
Revokes role
from the calling account. Roles are often managed via {grantRole} and {revokeRole}: this function's purpose is to provide a mechanism for accounts to lose their privileges if they are compromised (such as when a trusted device is misplaced). If the calling account had been revoked role
, emits a {RoleRevoked} event. Requirements: - the caller must be account
. May emit a {RoleRevoked} event.
Parameters
revokeRole
Revokes role
from account
. If account
had been granted role
, emits a {RoleRevoked} event. Requirements: - the caller must have role
's admin role. May emit a {RoleRevoked} event.
Parameters
sequencerUptimeFeed
Returns
setFixedPrice
Set a fixed prices for assets which do not require a price feed (i.e. UA)
The decimals price must be 18 even if the original price feed is different, e.g. USDC/USD chainlink oracle decimals is 8 but if we set it a fixed price it must be 18 decimals.
Parameters
setGracePeriod
Set grace period, i.e. a period that must be elapsed after the sequencer is back to fetch new price
Parameters
setHeartBeat
Update the heartBeat parameter of an oracle. To be used only if Chainlink updates this parameter
Parameters
setOracle
Add or update an oracle address
Parameters
setSequencerUptimeFeed
Set sequencer uptime feed, i.e. an oracle like contract telling whether the L2 sequencer is up or not
Parameters
supportsInterface
See {IERC165-supportsInterface}.
Parameters
Returns
Events
AssetGotFixedPrice
Emitted when an asset got a fixed price when requesting an oracle
Parameters
GracePeriodUpdated
Emitted when grace period is updated
Parameters
HeartBeatUpdated
Emitted when oracle heart beat is updated
Parameters
OracleUpdated
Emitted when oracle heart beat is added or updated
Parameters
RoleAdminChanged
Parameters
RoleGranted
Parameters
RoleRevoked
Parameters
SequencerUptimeFeedUpdated
Emitted when sequencer uptime feed is updated
Parameters
Errors
Oracle_AggregatorZeroAddress
Emitted when the proposed aggregator address is equal to the zero address
Oracle_AssetZeroAddress
Emitted when the proposed asset address is equal to the zero address
Oracle_DataNotFresh
Emitted when the latest round's data is older than the oracle's max refresh time
Oracle_GracePeriodNotOver
Emitted when Zksync sequencer hasn't been back up for long enough
Oracle_IncorrectGracePeriod
Emitted when proposed grace period doesn't fit in the defined bounds
Oracle_IncorrectHeartBeat
Emitted when the proposed heart beat is less than 1 sec second
Oracle_InvalidRoundPrice
Emitted when the latest round's price is invalid
Oracle_InvalidRoundTimestamp
Emitted when the latest round is incomplete
Oracle_SequencerDown
Emitted when Zksync sequencer is down
Oracle_SequencerUptimeFeedZeroAddress
Emitted when the proposed sequencer uptime feed address is equal to the zero address
Oracle_UnsupportedAsset
Emitted when owner tries to set fixed price to an unsupported asset
PRBMathSD59x18__AbsInputTooSmall
Emitted when the input is MIN_SD59x18.
PRBMathSD59x18__MulInputTooSmall
Emitted when one of the inputs is MIN_SD59x18.
PRBMathSD59x18__MulOverflow
Emitted when the intermediary absolute result overflows SD59x18.
Parameters
PRBMath__MulDivFixedPointOverflow
Emitted when the result overflows uint256.
Parameters
PRBMath__MulDivOverflow
Emitted when the result overflows uint256.
Parameters
Last updated