IERC4626Custom Interface
The IERC4626Custom
interface is based on the ERC-4626 "Tokenized Vault Standard" with modifications specific to shMONAD's requirements. This interface defines the core functionality for depositing MON and receiving shMON tokens.
Events
Deposit
event Deposit(address indexed sender, address indexed owner, uint256 assets, uint256 shares);
Emitted when assets are deposited into the vault.
Withdraw
event Withdraw(
address indexed sender,
address indexed receiver,
address indexed owner,
uint256 assets,
uint256 shares
);
Emitted when assets are withdrawn from the vault.
Asset Management
asset
function asset() external view returns (address assetTokenAddress);
Returns the address of the underlying token used for the Vault.
Returns
Type | Description |
---|---|
address | The address of the underlying asset token |
totalAssets
function totalAssets() external view returns (uint256 totalManagedAssets);
Returns the total amount of the underlying asset managed by the Vault.
Returns
Type | Description |
---|---|
uint256 | Total amount of underlying assets |
Conversion Functions
convertToShares
function convertToShares(uint256 assets) external view returns (uint256 shares);
Calculate how many shares would be received for a given amount of assets.
Parameters
Name | Type | Description |
---|---|---|
assets | uint256 | The amount of assets to convert |
Returns
Type | Description |
---|---|
uint256 | The amount of shares that would be received |
convertToAssets
function convertToAssets(uint256 shares) external view returns (uint256 assets);
Calculate how many assets would be received for a given amount of shares.
Deposit Operations
deposit
function deposit(uint256 assets, address receiver) external payable returns (uint256 shares);
Deposit assets and receive shares.
Parameters
Name | Type | Description |
---|---|---|
assets | uint256 | The amount of assets to deposit |
receiver | address | The receiver of the shares |
Returns
Type | Description |
---|---|
uint256 | The amount of shares minted |
mint
function mint(uint256 shares, address receiver) external payable returns (uint256 assets);
Mint exact amount of shares by depositing assets.
Withdrawal Operations
withdraw
function withdraw(
uint256 assets,
address receiver,
address owner
) external returns (uint256 shares);
Withdraw exact amount of assets.
Parameters
Name | Type | Description |
---|---|---|
assets | uint256 | The amount of assets to withdraw |
receiver | address | The receiver of the assets |
owner | address | The owner of the shares |
redeem
function redeem(
uint256 shares,
address receiver,
address owner
) external returns (uint256 assets);
Redeem shares for assets.
Preview Functions
previewDeposit
function previewDeposit(uint256 assets) external view returns (uint256 shares);
Preview how many shares would be received for a deposit.
previewMint
function previewMint(uint256 shares) external view returns (uint256 assets);
Preview how many assets would be needed for a mint.
previewWithdraw
function previewWithdraw(uint256 assets) external view returns (uint256 shares);
Preview how many shares would be burned for a withdrawal.
previewRedeem
function previewRedeem(uint256 shares) external view returns (uint256 assets);
Preview how many assets would be received for a redemption.
Maximum Limits
maxDeposit
function maxDeposit(address receiver) external view returns (uint256 maxAssets);
Get the maximum amount that can be deposited.