Deposit into the Vault
While there is only 1 underlying LP token per vault, Alluo enables you to deposit and withdraw in any token supported by the Alluo Exchange
1. Deposit with the underlying LP token
/// @notice Deposits an amount of LP underlying and mints shares in the vault.
/// @dev Read the difference between deposit and mint at the start of the contract. Makes sure to distribute rewards before any actions occur
/// @param assets Amount of assets deposited
/// @param receiver Recipient of shares
/// @return New amount of shares minted
function deposit(uint256 assets, address receiver) public override returns(uint256) {
////
// Rewards are distributed BEFORE new shares are minted to ensure that correct reward distribution is achieved
//
_distributeReward(_msgSender());
require(assets <= maxDeposit(receiver), "ERC4626: deposit more than max");
uint256 shares = previewDeposit(assets);
_deposit(_msgSender(), receiver, assets, shares);
return shares;
}2. Deposit with non LP tokens:
Last updated