MachineShareOracle
Inherits: MakinaContext, Initializable, IMachineShareOracle
Constants
MachineShareOracleStorageLocation
bytes32 private constant MachineShareOracleStorageLocation =
0x4f70fa92dc3700b8f04f54ea7fbeb33f50a8cec0cd9f676fee937dccebe28100;Functions
_getMachineShareOracleStorage
function _getMachineShareOracleStorage() internal pure returns (MachineShareOracleStorage storage $);Returns
| Name | Type | Description |
|---|---|---|
| $ | MachineShareOracleStorage |
constructor
constructor(address coreRegistry) MakinaContext(coreRegistry);Parameters
| Name | Type | Description |
|---|---|---|
| coreRegistry | address |
initialize
Initializer of the contract.
function initialize(address _shareOwner, uint8 _decimals) external initializer;Parameters
| Name | Type | Description |
|---|---|---|
| _shareOwner | address | The current owner contract of the share (machine or pre-deposit vault). |
| _decimals | uint8 | Decimals to use for the oracle price. |
decimals
Decimals of the oracle.
function decimals() external view override returns (uint8);Returns
| Name | Type | Description |
|---|---|---|
| <none> | uint8 |
description
Description of the oracle.
function description() external view override returns (string memory);Returns
| Name | Type | Description |
|---|---|---|
| <none> | string |
shareOwner
Address of the share owner (machine or pre-deposit vault).
function shareOwner() public view override returns (address);Returns
| Name | Type | Description |
|---|---|---|
| <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
| Name | Type | Description |
|---|---|---|
| <none> | uint256 | The 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
| Name | Type | Description |
|---|---|---|
| _shareOwner | address | |
| _isShareOwnerPdv | bool | |
| _decimals | uint8 | |
| _scalingNumerator | uint256 | |
| _shareTokenDecimalsOffset | uint256 | |
| _description | string |