📍4626 ETH Router
In order to allow raw Eth to be deposited and withdrawn from the system using the vault contract, a router has been created to allow this. The router accepts ETH, converts it to WETH, and then deposits the WETH into the 4626 vault.
This router is generic and is designed to be used by multiple projects without the need to deploy new instances even for different 4626 ETH Vaults.
The router interface has support for both mint and deposit functionality on the 4626 vault.
Both of these functions work by depositing all ETH sent to them into WETH, calling either deposit or mint on the specified 4626 vault, and then refunding all excess WETH leftover in the contract to the sender. Please note: refunds are denominated in WETH, not ETH. When calling the deposit function, the msg.value
should match up with the parameter amount
. When calling the mint, maxAmountIn
should equal msg.value
.
The router can only deposit on behalf of users. Withdrawals must take place by calling the underlying 4626 vault itself.
Last updated