💲McdWithdraw

Description

Action ID: 0xfd5383d0

Network mainnet: (Deployed address | Code)

Withdraws collateral from a Maker vault

SDK Action

    const mcdWithdrawAction = new dfs.actions.maker.MakerWithdrawAction(
        vaultId,
        amount,
        joinAddr,
        to,
        mcdManager,
    );

Contract

This is a DFS STANDARD_ACTION.

If amount is uint.max withdraw whole collateral amount

Will fail if token is over 18 decimals

Input:

    /// @param vaultId Id of the vault
    /// @param amount Amount of collateral to withdraw
    /// @param joinAddr Join address of the maker collateral
    /// @param to Address where to send the collateral we withdrew
    /// @param mcdManager The manager address we are using [mcd, b.protocol]
    struct Params {
        uint256 vaultId;
        uint256 amount;
        address joinAddr;
        address to;
        address mcdManager;
    }

Return value:

return bytes32(withdrawnAmount);

Events:

emit ActionEvent("McdWithdraw", logData);

logger.logActionDirectEvent("McdWithdraw", logData);

bytes memory logData = abi.encode(_vaultId, _amount, _joinAddr, _to, _mcdManager)

Last updated