👻AaveWithdraw

Withdraw a token from an AaveV2 market.

Description

Action ID: 0x4a76aaa3

Withdraw a token from an AaveV2 market.

SDK Action

    const aaveWithdrawAction = new dfs.actions.aave.AaveWithdrawAction(
        market,
        tokenAddr,
        amount,
        to,
    );

Contract

This is a DFS STANDARD_ACTION.

If amount uint.max it will withdraw whole supply amount

Input:

    /// @param market Address provider for specific market
    /// @param tokenAddr The address of the token to be withdrawn
    /// @param amount Amount of tokens to be withdrawn
    /// @param to Where the withdrawn tokens will be sent
    struct Params {
        address market;
        address tokenAddr;
        uint256 amount;
        address to;
    }

Return value:

return bytes32(withdrawnAmount);

Events:

emit ActionEvent("AaveWithdraw", logData);

logger.logActionDirectEvent("AaveWithdraw", logData);

bytes memory logData = abi.encode(_market, _tokenAddr, _amount, _to)

Last updated