Function: compound(address[] swapInputTokens, IZapper.SingleTokenSwap[] swapToToken0, IZapper.SingleTokenSwap[] swapToToken1, IZapper.KodiakVaultStakingParams stakingParams, IZapper.VaultDepositParams vaultStakingParams)
This function compounds rewards by swapping harvested tokens and staking in the Kodiak Vault, depositing into Beradrome farm.
Inputs
swapInputTokensControl: Fully controlled by the caller.
Constraints: Must be equal to the sum of the lengths of
swapToToken0andswapToToken1Impact: Information of input-token addresses for swap.
swapToToken0Control: Fully controlled by the caller.
Constraints: N/A.
Impact: Information of swapping swapInputTokens to token0.
swapToToken1Control: Fully controlled by the caller.
Constraints: N/A.
Impact: Information of swapping swapInputTokens to token1.
stakingParamsControl: Fully controlled by the caller.
Constraints: The
stakingParams.receivermust be the contract address.Impact: Information of staking in Kodiak Vault.
vaultStakingParamsControl: Fully controlled by the caller.
Constraints: N/A.
Impact: Information of depositing into the vault.
Branches and code coverage
Intended branches
Check if
stakingParams.receiveris the contract address.Check if the length of
swapInputTokensis equal to the sum of the lengths ofswapToToken0andswapToToken1.Zaps in tokens.
Check if
islandTokensMintedis greater thanstakingParams.amountSharesMin.Check if
vaultSharesMintedis zero.
Negative behavior
The
stakingParams.receiveris not the contract address.The length of
swapInputTokensis not equal to the sum of the lengths ofswapToToken0andswapToToken1.islandTokensMintedis less thanstakingParams.amountSharesMin.vaultSharesMintedis not zero.