HRC-4626
Introduce
HRC-4626 is a standard for optimizing and unifying the technical parameters of the income treasury. It provides a standard API for a tokenized yield treasury representing a share of a single underlying HRC-20 token. HRC-4626 also outlines optional extensions to tokenized treasuries using HRC-20, providing basic functionality for depositing, withdrawing tokens, and reading balances.
HRC-4626 The Role of the Earnings Treasury
Lending marketplaces, aggregators, and interest-bearing tokens in nature can help users find the best yield on their crypto tokens by executing different strategies. These strategies are done slightly differently, which can be error-prone or waste development resources.
The HRC-4626 standard for yield treasury reduces integration effort and unlocks avenues to monetize across a wide range of applications by creating a more consistent and robust implementation model that requires no dedicated work from developers.
Functions and functions of HRC-4626:
Method
asset
function asset() public view returns (address)This function returns the address of the underlying token used for the vault for accounting, depositing, withdrawing.
totalAssets
function totalAssets() public view returns (uint256)This function returns the total amount of underlying assets held by the vault.
convertToShares
function convertToShares(uint256 assets) public view returns (uint256 shares)This function returns the amount of shares that would be exchanged by the vault for the amount of assets provided.
convertToAssets
This function returns the amount of assets that would be exchanged by the vault for the amount of shares provided.
maxDeposit
This function returns the amount of assets that would be exchanged by the vault for the amount of shares provided.
previewDeposit
This function allows users to simulate the effects of their deposit at the current block.
deposit
This function deposits assets of underlying tokens into the vault and grants ownership of shares to receiver.
maxMint
This function returns the maximum amount of shares that can be minted in a single mint call by the receiver.
previewMint
This function allows users to simulate the effects of their mint at the current block.
mint
This function mints exactly shares vault shares to receiver by depositing assets of underlying tokens.
maxWithdraw
This function returns the maximum amount of underlying assets that can be withdrawn from the owner balance with a single withdraw call.
previewWithdraw
This function allows users to simulate the effects of their withdrawal at the current block.
withdraw
This function burns shares from owner and send exactly assets token from the vault to receiver.
maxRedeem
This function returns the maximum amount of shares that can be redeem from the owner balance through a redeem call.
previewRedeem
This function allows users to simulate the effects of their redeemption at the current block.
redeem
This function redeems a specific number of shares from owner and send assets of underlying token from the vault to receiver.
totalSupply
Returns the total number of unredeemed vault shares in circulation.
balanceOf
Returns the total amount of vault shares the owner currently has.
Events
Deposit Event
MUST be emitted when tokens are deposited into the vault via the mint and deposit methods
Where sender is the user who exchanged assets for shares, and transferred those shares to owner.
Withdraw Event
MUST be emitted when shares are withdrawn from the vault by a depositor in the redeem or withdraw methods.
Where sender is the user who triggered the withdrawal and exchanged shares, owned by owner, for assets. receiver is the user who received the withdrawn assets.
Last updated