Skip to content
LogoLogo

MachineShareOracle

Git Source

Inherits: MakinaContext, Initializable, IMachineShareOracle

Constants

MachineShareOracleStorageLocation

bytes32 private constant MachineShareOracleStorageLocation =
        0x4f70fa92dc3700b8f04f54ea7fbeb33f50a8cec0cd9f676fee937dccebe28100;

Functions

_getMachineShareOracleStorage

function _getMachineShareOracleStorage() internal pure returns (MachineShareOracleStorage storage $);

Returns

NameTypeDescription
$MachineShareOracleStorage

constructor

constructor(address coreRegistry) MakinaContext(coreRegistry);

Parameters

NameTypeDescription
coreRegistryaddress

initialize

Initializer of the contract.

function initialize(address _shareOwner, uint8 _decimals) external initializer;

Parameters

NameTypeDescription
_shareOwneraddressThe current owner contract of the share (machine or pre-deposit vault).
_decimalsuint8Decimals to use for the oracle price.

decimals

Decimals of the oracle.

function decimals() external view override returns (uint8);

Returns

NameTypeDescription
<none>uint8

description

Description of the oracle.

function description() external view override returns (string memory);

Returns

NameTypeDescription
<none>string

shareOwner

Address of the share owner (machine or pre-deposit vault).

function shareOwner() public view override returns (address);

Returns

NameTypeDescription
<none>address

getSharePrice

Returns the price of one machine share token expressed in machine accounting tokens.

The price is expressed with decimals precision.

function getSharePrice() external view override returns (uint256);

Returns

NameTypeDescription
<none>uint256The price of one machine share token expressed in machine accounting tokens, scaled to decimals precision.

notifyPdvMigration

Notifies the migration of the original share owner from a pre-deposit vault to a machine.

Can only be called once and only if the share owner was initially a pre-deposit vault.

This function can be called permissionlessly and allows to optimize gas costs for users of the oracle.

function notifyPdvMigration() external override;

Structs

MachineShareOracleStorage

Note:

  • storage-location: erc7201:makina.storage.MachineShareOracle
struct MachineShareOracleStorage {
        address _shareOwner;
        bool _isShareOwnerPdv;
        uint8 _decimals;
        uint256 _scalingNumerator;
        uint256 _shareTokenDecimalsOffset;
        string _description;
    }

Properties

NameTypeDescription
_shareOwneraddress
_isShareOwnerPdvbool
_decimalsuint8
_scalingNumeratoruint256
_shareTokenDecimalsOffsetuint256
_descriptionstring