Skip to main content

MetaMorphoOracleFactory

Git Source

Inherits: AccessManagedUpgradeable, IMetaMorphoOracleFactory

State Variables

MetaMorphoOracleFactoryStorageLocation

bytes32 private constant MetaMorphoOracleFactoryStorageLocation =
0x8b272443f96f44d511b8bb6ad6efe08c8771f99b7e57f25c3f699349a99dca00;

Functions

_getMetaMorphoOracleFactoryStorage

function _getMetaMorphoOracleFactoryStorage() internal pure returns (MetaMorphoOracleFactoryStorage storage $);

constructor

constructor();

initialize

function initialize(address _initialAuthority) external initializer;

isMorphoFactory

Address => Whether this is a trusted Morpho factory.

function isMorphoFactory(address morphoFactory) external view returns (bool);

Parameters

NameTypeDescription
morphoFactoryaddressThe Morpho factory address to check.

Returns

NameTypeDescription
<none>boolisFactory True if the factory is trusted, false otherwise.

isOracle

Address => Whether this is an oracle deployed by this factory.

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

Parameters

NameTypeDescription
oracleaddressThe oracle address to check.

setMorphoFactory

Sets the Morpho Registry in the factory contract.

function setMorphoFactory(address morphoFactory, bool isFactory) external override restricted;

Parameters

NameTypeDescription
morphoFactoryaddressThe address of the Morpho Registry.
isFactoryboolFlags the factory as trusted or not.

createMetaMorphoOracle

Creates an oracle for the given MetaMorpho Vault.

function createMetaMorphoOracle(address factory, address metaMorphoVault, uint8 decimals)
external
override
restricted
returns (address);

Parameters

NameTypeDescription
factoryaddressThe factory used to create the MetaMorpho Vault.
metaMorphoVaultaddressThe Vault for which to create a wrapper oracle.
decimalsuint8Decimals to use for the oracle price.

Structs

MetaMorphoOracleFactoryStorage

struct MetaMorphoOracleFactoryStorage {
mapping(address oracle => bool isOracle) _isOracle;
mapping(address factory => bool isFactory) _isMorphoFactory;
}