Stake
Stake
// Stake involves 2 tokens. LP token and VC because it also trigger harvest of $VC token.
Token[] memory tokens = new Token[](2);
tokens[0] = toToken(IERC20(usdc_eth_lp));
tokens[1] = toToken(IERC20(vc));
operation[] memory ops = new operation[](1);
// address usdc_eth_pool = vault.getPair(usdc, eth);
// OP type STAKE(GAUGE). For volatile pools, LP contract itself is a gauge contract. so use pool address for relevant pool address.
// This is different for Wombat Pool, and I will return to that later.
ops[0].poolId = toPoolId(GAUGE,usdc_eth_pool);
ops[0].tokenInformations = new bytes32[](2);
int128 stakeAmount = int128(int256(IERC20(usdc_eth_lp).balanceOf(address(this))));
ops[0].tokenInformations[0] = toTokenInfo(0x00,EXACTLY,stakeAmount);
//we don't know how much VC we'd harvest in this action. so just use AT_MOST 0 .
ops[0].tokenInformations[1] = toTokenInfo(0x01,AT_MOST,0);
ops[0].data = "";
return execute(tokens, new int128[](2), ops);Last updated