Skip to main content

Overview

MakxYieldVault is an ERC-20 contract that holds ETH and lends it to MakxYieldPad. Depositors receive METH shares. YieldPad borrows ETH for token launches and pays interest back. Interest raises the share price, benefiting all depositors proportionally. All interest accrual logic is owned by YieldPad — the vault simply receives ETH via repay() and depositInterest().

State

VariableTypeDescription
yieldPadaddressAddress of the authorized MakxYieldPad
totalBondedETHuint256ETH currently lent out (accounting marker, not physical balance)
withdrawalCooldownuint24Seconds between withdrawal request and redemption
feeBpsuint256Protocol fee in BPS on deposit and redeem (max 1000)
withdrawalRequestsmapping(address => WithdrawalRequest)Pending withdrawal requests

Depositor functions

deposit()

Deposit ETH, receive METH shares. Calls collectInterest() on YieldPad first. Deducts feeBps if non-zero.

requestWithdrawal(uint256 shares)

Starts the withdrawal cooldown. One active request per address.

cancelWithdrawal()

Cancels a pending withdrawal request.

redeem()

After cooldown: burns shares, sends ETH. Capped at idle vault balance — partial redemption possible. Deducts feeBps from output.

Lending interface (YieldPad only)

borrow(uint256 amount)

Lends ETH to YieldPad. Increments totalBondedETH. Reverts if amount > address(this).balance.

repay()

Receives ETH back from YieldPad (bond repayment or interest). Decrements totalBondedETH by msg.value.

View functions

totalAssets()

Returns address(this).balance + totalBondedETH. This is the full ETH value backing all METH shares.

sharePrice()

Returns ETH per METH share, scaled by 1e18. Returns 1e18 if supply is zero.

Owner functions

configure(address _yieldPad, uint24 _withdrawalCooldown)

Sets the authorized YieldPad address and withdrawal cooldown.

setFeeBps(uint256 _feeBps)

Sets the protocol fee on deposit/redeem. Capped at 1000 (10%).

Events

EventEmitted when
Deposited(user, ethAmount, shares)ETH deposited
WithdrawalRequested(user, shares, requestedAt)Withdrawal request started
WithdrawalCancelled(user)Request cancelled
Redeemed(user, shares, ethOut)Shares redeemed for ETH
Borrowed(amount)ETH lent to YieldPad
Repaid(amount)ETH returned from YieldPad
FeeBpsUpdated(feeBps)Protocol fee updated

Errors

ErrorCondition
ZeroAmountZero ETH deposit or zero shares
InsufficientSharesCaller has fewer shares than requested
InsufficientAvailableETHVault idle balance too low to lend
NoWithdrawalPendingNo active request to redeem or cancel
CooldownNotElapsedCooldown period not yet passed
NotYieldPadCaller is not the authorized YieldPad
TransferFailedETH transfer reverted
FeeTooHighfeeBps > 1000