YearnWithdraw
Action ID: 0x42b4f003
Burns yTokens and receive underlying tokens in return
const yearnWithdrawAction = new dfs.actions.yearn.YearnWithdrawAction(token, amount, from, to);
This is a DFS STANDARD_ACTION.
yTokens need to be approved for DSProxy to pull them (yToken address)
If amount is uint.max pull and withdraw whole balance of yTokens
Input:
/// @param yToken The address of yToken to withdraw (same as yVault address)
/// @param yAmount Amount of yToken to withdraw
/// @param from The address from which to pull yTokens from
/// @param to The address where received underlying tokens will be sent to
struct Params {
address yToken;
uint256 yAmount;
address from;
address to;
}
Return value:
return bytes32(yAmountReceived);
Events:
emit ActionEvent("YearnWithdraw", logData);
logger.logActionDirectEvent("YearnWithdraw", logData);
Last modified 10mo ago