Skip to main content

IOracleWithValidationFactory

Git Source - Generated with forge doc

Title: IOracleWithValidationFactory

Interface of the CREATE2 factory deploying OracleWithValidation instances.

Functions

createOracleWithValidation

Deploys a new OracleWithValidation via CREATE2.

Reverts if an oracle address is zero, the two oracles are identical, or maxOracleDeviation >= 1e18.

function createOracleWithValidation(
IOracle primaryOracle,
IOracle validationOracle,
uint256 maxOracleDeviation,
bool revertOnValidationOracleFailure,
address owner,
bytes32 salt
) external returns (address oracle);

Parameters

NameTypeDescription
primaryOracleIOracleThe primary oracle, always used for the price.
validationOracleIOracleThe validation oracle used to bound-check the primary's price.
maxOracleDeviationuint256The maximum allowed deviation, in WAD.
revertOnValidationOracleFailureboolWhether price() reverts when the validation oracle call reverts.
owneraddressThe initial owner of the deployed oracle.
saltbytes32The CREATE2 salt.

Returns

NameTypeDescription
oracleaddressThe address of the deployed oracle.

isDeployedOracle

Whether oracle was deployed by this factory.

function isDeployedOracle(address oracle) external view returns (bool);

Events

OracleWithValidationDeployed

event OracleWithValidationDeployed(
address indexed oracle,
address primaryOracle,
address validationOracle,
uint256 maxOracleDeviation,
bool revertOnValidationOracleFailure,
address owner,
bytes32 salt
);

Errors

NotAllowed

error NotAllowed();