Function: _swapEth(address fromToken, address toToken, address pool, uint256 i, uint256 j, uint256 fromAmount, uint256 toAmountMin)
This swaps on Curve with the logic for an ETH pool.
Inputs
fromTokenConstraints: No constraints.
Impact: The token being swapped from.
toTokenConstraints: No constraints.
Impact: The token being swapped to.
poolConstraints: No constraints.
Impact: The Curve pool being swapped with.
iConstraints: No constraints.
Impact: The index of the
fromTokenin the Curve pool.
jConstraints: No constraints.
Impact: The index of the
toTokenin the Curve pool.
fromAmountConstraints: No constraints.
Impact: The amount of
fromTokento swap.
toAmountMinConstraints: No constraints.
Impact: The minimum amount of
toTokento receive from the swap.
Branches and code coverage (including function calls)
Intended branches
The swap on Curve succeeds with the given parameters.
Negative behaviour
The swap on Curve fails if output tokens are less than
toAmountMin.
Function call analysis
ERC20(fromToken).safeApprove(pool, fromAmount)What is controllable?
fromToken,pool, andfromAmount.If return value controllable, how is it used and how can it go wrong? N/A.
What happens if it reverts, reenters, or does other unusual control flow? If this reverts, the entire call fails --- no reentrancy issues.
ERC20(toToken).balanceOf(address(this))What is controllable?
toToken.If return value controllable, how is it used and how can it go wrong? N/A.
What happens if it reverts, reenters, or does other unusual control flow? If this reverts, the entire call fails --- no reentrancy issues.
ICurvePair(pool).exchange(i, j, fromAmount, toAmountMin, false)What is controllable?
pool,i,j,fromAmount, andtoAmountMin.If return value controllable, how is it used and how can it go wrong? N/A.
What happens if it reverts, reenters, or does other unusual control flow? If this reverts, the entire call fails --- no reentrancy issues.