Function: _swapBalancer(byte[] swapPayload)
This swaps using the balancerVault.
Inputs
swapPayloadConstraints: No constraints.
Impact: The payload for the swap --- varies by DEX.
Branches and code coverage (including function calls)
Intended branches
The function calls the
balancerVaultwith the providedswapPayload.The function checks if the provided selector matches for a single swap or assumes multiswap if not.
In case of single swap, returns the decoded
uint256amount oftoTokenreceived.In case of multiswap, checks negative asset deltas for received amounts and reverts if none are found.
Negative behavior
The function reverts if the
balancerVaultcall is not successful.
Function call analysis
balancerVault.call(swapPayload)What is controllable?
swapPayload.If return value controllable, how is it used and how can it go wrong? Success used for condition; data used for decoding results.
What happens if it reverts, reenters, or does other unusual control flow? This function call can revert if the
balancerVaultcall fails --- no reentrancy scenarios.