feat: Add TokenTransfer class to BalancerV2

- This needed to be in BalancerV2 so that the executor can also take care of transfers from the user into the tycho router, to avoid having transfer actions mixed between the router and executors
This commit is contained in:
TAMARA LIPOWSKI
2025-04-14 17:15:19 -04:00
committed by Diana Carvalho
parent 462be5463b
commit 3a73fef933
6 changed files with 66 additions and 23 deletions

View File

@@ -64,7 +64,15 @@ contract CurveExecutor is IExecutor, TokenTransfer {
TransferType transferType
) = _decodeData(data);
_transfer(tokenIn, msg.sender, pool, amountIn, transferType);
_transfer(
tokenIn,
msg.sender,
// Receiver can never be the pool, since the pool expects funds in the router contract
// Thus, this call will only ever be used to transfer funds from the user into the router.
address(this),
amountIn,
transferType
);
if (tokenApprovalNeeded && tokenIn != nativeToken) {
// slither-disable-next-line unused-return