🧑💻🧑💻 Integration guide
Guide for smart contract interactions with the vault
deposit(uint256 _amount, address _recipient)
/**
* @notice deposit function - where users can join the vault and
* receive shares in the vault proportional to their ownership
* of the funds.
* @param _amount amount of want to be deposited
* @param _recipient recipient of the shares as the recipient may not
* be the sender
* @return shares the amount of shares being minted to the recipient
* for their deposit
*/
function deposit(uint256 _amount, address _recipient)
external
nonReentrant
whenNotPaused
returns (uint256 shares)
{
require(_amount > 0, "!_amount");
require(_recipient != address(0), "!_recipient");
require(totalAssets() + _amount <= depositLimit, "!depositLimit");
shares = _issueShares(_amount, _recipient);
// transfer want to the vault
want.safeTransferFrom(msg.sender, address(this), _amount);
emit Deposit(_recipient, _amount, shares);
}withdraw(uint256 _shares, address _recipient)
Last updated