💿CompSupply

Description

Action ID: 0x4ce56950

Supply a token to CompoundV2.

SDK Action

    const compSupplyAction = new dfs.actions.compound.CompoundSupplyAction(
        cTokenAddr,
        amount,
        from,
        enableAsColl,
    );

Contract

This is a DFS STANDARD_ACTION.

If amount == type(uint256).max we are getting the whole balance of the proxy

Input:

    /// @param cTokenAddr Address of the cToken we'll get when supplying
    /// @param amount Amount of the underlying token we are supplying
    /// @param from Address where we are pulling the underlying tokens from
    /// @param enableAsColl If the supply asset should be collateral
    struct Params {
        address cTokenAddr;
        uint256 amount;
        address from;
        bool enableAsColl;
    }

Return value:

return bytes32(supplyAmount);

Events:

emit ActionEvent("CompSupply", logData);

logger.logActionDirectEvent("CompSupply", logData);

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

Last updated