Comment on page
EToken Technology
eTokens represents the collateral behind your trove, which corresponds to mint or burn when you increase or decrease the collateral. The eTokens's value is pegged to the value of the corresponding deposited collateral at a 1:1 ratio, and can be safely stored, transferred and traded.
All standard EIP20 methods are implemented for eTokens, such as
balanceOf
, transfer
, transferFrom
, approve
, totalSupply
etc.💡 `balanceOf` will always return the most up to date balance of the user, which includes their principal balance + the yield generated by the principal balance(for example, the profit of stETH after rebase every day).
function shareOf(address _account)
Returns the collateral share balance of
_account
. If the collateral is not a rebaseToken, it is equal to the amount of collateral deposited by the _account
.function getShare(uint256 _amount)
Returns the share of the specified
_amount
. If the collateral is not a rebaseToken, the return value is equal to _amount
.function getAmount(uint _share)
Returns the amount of the specified
_share
. If the collateral is not a rebaseToken, the return value is equal to _share
.function clear(address _account)
When the user close the trove, this method will be called to burn all eTokens of the user.
function reset(address _account, uint256 _amount)
When a trove is liquidated, this method will be called to adjust the user's collateral amount.
Last modified 3mo ago