💿CompPayback

Description

Action ID: 0x4cbab3db

Payback a token a user borrowed from Compound.

SDK Action

    const compPaybackAction = new dfs.actions.compound.CompoundPaybackAction(
        cTokenAddr,
        amount,
        from,
    );

Contract

This is a DFS STANDARD_ACTION.

Amount type(uint).max will take the whole borrow amount

If amount sent is over the whole debt amount, just the whole debt amount will be pulled

Input:

    /// @param cTokenAddr Address of the cToken we are paying back
    /// @param amount Amount of the underlying token
    /// @param from Address where we are pulling the underlying tokens from
    /// @param onBehalf Repay on behalf of which address (if 0x0 defaults to proxy)
    struct Params {
        address cTokenAddr;
        uint256 amount;
        address from;
        address onBehalf;
    }

Return value:

return bytes32(paybackAmount);

Events:

emit ActionEvent("CompPayback", logData);

logger.logActionDirectEvent("CompPayback", logData);

bytes memory logData = abi.encode(tokenAddr, _amount, _from, _onBehalf)

Last updated