👻
AaveV3Supply
Action ID: 0xfc33bf00
Supply a token to an AaveV3 market
const aaveSupplyAction = new dfs.actions.aaveV3.AaveV3SupplyAction(
amount, from, tokenAddr, assetId, enableAsColl, useDefaultMarket, useOnBehalf, market, onBehalf,
);
This is a DFS STANDARD_ACTION.
User needs to approve the DSProxy to pull the tokens being supplied
If amount is set to uint.max, take the whole _from balance
Input:
/// @param amount Amount of tokens to be deposited
/// @param from Where are we pulling the supply tokens amount from
/// @param assetId The id of the token to be deposited
/// @param useDefaultMarket If true the action will inject aave default market
/// @param useOnBehalf If true the action will inject _onBehalf addr
/// @param enableAsColl If the supply asset should be collateral
/// @param market Address provider for specific market
/// @param onBehalf On whose behalf we borrow the tokens, defaults to proxy
struct Params {
uint256 amount;
address from;
uint16 assetId;
bool enableAsColl;
bool useDefaultMarket;
bool useOnBehalf;
address market;
address onBehalf;
}
Return value:
return bytes32(supplyAmount);
Events:
emit ActionEvent("AaveV3Supply", logData);
logger.logActionDirectEvent("AaveV3Supply", logData);
bytes memory logData = abi.encode(
_market,
tokenAddr,
_amount,
_from,
_onBehalf,
_enableAsColl
);
Last modified 7mo ago