chore: Remove transfer flag from curve + balancer
we will never perform a manual transfer into these protocols, as they require the tokens to be in the router contract in order to perform a transferFrom.
This commit is contained in:
@@ -29,8 +29,7 @@ contract BalancerV2Executor is IExecutor {
|
||||
IERC20 tokenOut,
|
||||
bytes32 poolId,
|
||||
address receiver,
|
||||
bool needsApproval,
|
||||
bool transferNeeded
|
||||
bool needsApproval
|
||||
) = _decodeData(data);
|
||||
|
||||
if (needsApproval) {
|
||||
@@ -68,11 +67,10 @@ contract BalancerV2Executor is IExecutor {
|
||||
IERC20 tokenOut,
|
||||
bytes32 poolId,
|
||||
address receiver,
|
||||
bool needsApproval,
|
||||
bool transferNeeded
|
||||
bool needsApproval
|
||||
)
|
||||
{
|
||||
if (data.length != 94) {
|
||||
if (data.length != 93) {
|
||||
revert BalancerV2Executor__InvalidDataLength();
|
||||
}
|
||||
|
||||
@@ -81,6 +79,5 @@ contract BalancerV2Executor is IExecutor {
|
||||
poolId = bytes32(data[40:72]);
|
||||
receiver = address(bytes20(data[72:92]));
|
||||
needsApproval = uint8(data[92]) > 0;
|
||||
transferNeeded = uint8(data[93]) > 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ contract CurveExecutor is IExecutor {
|
||||
payable
|
||||
returns (uint256)
|
||||
{
|
||||
if (data.length != 85) revert CurveExecutor__InvalidDataLength();
|
||||
if (data.length != 84) revert CurveExecutor__InvalidDataLength();
|
||||
|
||||
(
|
||||
address tokenIn,
|
||||
@@ -62,7 +62,6 @@ contract CurveExecutor is IExecutor {
|
||||
int128 i,
|
||||
int128 j,
|
||||
bool tokenApprovalNeeded,
|
||||
bool transferNeeded, // TODO remove this with the encoding
|
||||
address receiver
|
||||
) = _decodeData(data);
|
||||
|
||||
@@ -121,7 +120,6 @@ contract CurveExecutor is IExecutor {
|
||||
int128 i,
|
||||
int128 j,
|
||||
bool tokenApprovalNeeded,
|
||||
bool transferNeeded,
|
||||
address receiver
|
||||
)
|
||||
{
|
||||
@@ -132,8 +130,7 @@ contract CurveExecutor is IExecutor {
|
||||
i = int128(uint128(uint8(data[61])));
|
||||
j = int128(uint128(uint8(data[62])));
|
||||
tokenApprovalNeeded = data[63] != 0;
|
||||
transferNeeded = data[64] != 0;
|
||||
receiver = address(bytes20(data[65:85]));
|
||||
receiver = address(bytes20(data[64:84]));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user