oz4626Facet
Custom-made version of Solmate's ERC4626.
This contract is in charge of managing the transition of user's ETH to the allocation/rebasing of OZL tokens, and vice versa for redemptions.
Open methods
convertToAssets
function convertToAssets(uint256 shares) public view returns (uint256);It does the heavy-lifting of calculating how much protocol revenue should the caller receive based on an amount of OZL tokens.
Parameters:
shares
uint256
Amount of OZL tokens to redeem
Return values:
uint256
Protocol revenue to receive, expressed in yvCurve-Tricrypto
maxWithdraw
function maxWithdraw(address owner) public view returns (uint256);Queries the maximum amount of protocol revenue a specific OZL holder can receive based on their total OZL balance (expressed in yvCurve-Tricrypto)
Parameters:
owner
address
Holder of OZL tokens
Return values:
uint256
Amount of protocol revenue that can be redeemed
System methods
deposit
function deposit(
uint assets,
address receiver,
uint lockNum_
) external payable isAuthorized(lockNum_) noReentrancy(1);Initiates the deposit of the Account's ETH which ends with the user's new OZL balance.
Parameters:
assets
uint256
Amount of ETH received in the Account
receiver
address
Owner of the Account (aka the user)
lockNum_
uint256
Index of the bit that authorizes the call
redeem
function redeem(
uint shares,
address receiver,
address owner,
uint lockNum_
) external isAuthorized(lockNum_) noReentrancy(6) returns (uint256 assets); Function that initiates the redemption of an user's OZL balance for the protocol's revenue.
Parameters:
shares
address
Amount of OZL tokens to redeem
receiver
address
Receiver of the protocol's revenue after redemption
owner
address
Owner of the OZL tokens
lockNum_
uint256
Index of the bit that authorizes the call
Return values:
assets
uint256
yvCurve-Tricrypto balance redeemed (aka the user's protocol revenue according to the redeemed OZL balance)
Last updated