👻AavePayback

Payback a token a user borrowed from an AaveV2 market.

Description

Action ID: 0x9ca7f8d2

Payback a token a user borrowed from an AaveV2 market.

SDK Action

    await approve(tokenAddr, proxy);
    
    const aavePaybackAction = new dfs.actions.aave.AavePaybackAction(
        market,
        tokenAddr,
        amount,
        rateMode,
        from,
        onBehalf,
    );

Contract

This is a DFS STANDARD_ACTION.

User needs to approve the DSProxy to pull the _tokenAddr tokens

Input:

    /// @param market Address provider for specific market
    /// @param tokenAddr The address of the token to be paid back
    /// @param amount Amount of tokens to be paid back
    /// @param rateMode Type of borrow debt Stable: 1, Variable: 2
    /// @param from Where are we pulling the payback tokens amount from
    /// @param onBehalf On behalf of the address we are borrowing, defaults to proxy
    struct Params {
        address market;
        address tokenAddr;
        uint256 amount;
        uint256 rateMode;
        address from;
        address onBehalf;
    }

Return value:

return bytes32(paybackAmount);

Events:

emit ActionEvent("AavePayback", logData);

logger.logActionDirectEvent("AavePayback", logData);

bytes memory logData = abi.encode(
            _market,
            _tokenAddr,
            _amount,
            _rateMode,
            _from,
            _onBehalf
        )

Last updated