struct Action {bytes32 protocolAdapterName;ActionType actionType;TokenAmount[] tokenAmounts;bytes data;}
protocolAdapterName
— protocol adapter name converted to hex
actionType
— type of action to be executed
tokenAmounts
— array of tokens' addresses to be deposited/withdrawn
data
— additional data required for the action (depends on actionType
, adapterIndex
, and protocolName
).
Parameter of type address[]
(or address
for 1 element) encoded as bytes
and corresponding values. web3.eth.abi.encodeParameter(type, value)
should be used with the following parameters:
UNISWAP_EXCHANGE_ADAPTER
ACTION_DEPOSIT
type: address[]
value: path
UNISWAP_ADAPTER_ASSET
ACTION_DEPOSIT
type: address
value: pairAddress
BALANCER_ASSET_ADAPTER
ACTION_DEPOSIT
type: address
value: poolAddress
ACTION_WITHDRAW
type: address
value: underlyingTokenAddress
CURVE_ASSET_ADAPTER
ACTION_DEPOSIT
type: address
value: poolAddress
ACTION_WITHDRAW
type: address
value: underlyingTokenAddress
All other cases: EMPTY_BYTES
struct TokenAmount {address token;uint256 amount;AmountType amountType;}
token
— address of token used for input
amount
— token amount for input (absolute or relative)
absolute amount is passed in wei
relative amount is passed in share (e.g. 0.5
for 50%) multiplied by 1e18
(eventually, it's 5e17
for 50%)
amountType
— indicator whether amount is absolute or relative