chore: Make naming consistent: transfer_needed, approval_needed, etc
Took 46 minutes
This commit is contained in:
@@ -29,10 +29,10 @@ contract BalancerV2Executor is IExecutor {
|
||||
IERC20 tokenOut,
|
||||
bytes32 poolId,
|
||||
address receiver,
|
||||
bool needsApproval
|
||||
bool approvalNeeded
|
||||
) = _decodeData(data);
|
||||
|
||||
if (needsApproval) {
|
||||
if (approvalNeeded) {
|
||||
// slither-disable-next-line unused-return
|
||||
tokenIn.forceApprove(VAULT, type(uint256).max);
|
||||
}
|
||||
@@ -67,7 +67,7 @@ contract BalancerV2Executor is IExecutor {
|
||||
IERC20 tokenOut,
|
||||
bytes32 poolId,
|
||||
address receiver,
|
||||
bool needsApproval
|
||||
bool approvalNeeded
|
||||
)
|
||||
{
|
||||
if (data.length != 93) {
|
||||
@@ -78,6 +78,6 @@ contract BalancerV2Executor is IExecutor {
|
||||
tokenOut = IERC20(address(bytes20(data[20:40])));
|
||||
poolId = bytes32(data[40:72]);
|
||||
receiver = address(bytes20(data[72:92]));
|
||||
needsApproval = uint8(data[92]) > 0;
|
||||
approvalNeeded = uint8(data[92]) > 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,11 +61,11 @@ contract CurveExecutor is IExecutor {
|
||||
uint8 poolType,
|
||||
int128 i,
|
||||
int128 j,
|
||||
bool tokenApprovalNeeded,
|
||||
bool approvalNeeded,
|
||||
address receiver
|
||||
) = _decodeData(data);
|
||||
|
||||
if (tokenApprovalNeeded && tokenIn != nativeToken) {
|
||||
if (approvalNeeded && tokenIn != nativeToken) {
|
||||
// slither-disable-next-line unused-return
|
||||
IERC20(tokenIn).forceApprove(address(pool), type(uint256).max);
|
||||
}
|
||||
@@ -119,7 +119,7 @@ contract CurveExecutor is IExecutor {
|
||||
uint8 poolType,
|
||||
int128 i,
|
||||
int128 j,
|
||||
bool tokenApprovalNeeded,
|
||||
bool approvalNeeded,
|
||||
address receiver
|
||||
)
|
||||
{
|
||||
@@ -129,7 +129,7 @@ contract CurveExecutor is IExecutor {
|
||||
poolType = uint8(data[60]);
|
||||
i = int128(uint128(uint8(data[61])));
|
||||
j = int128(uint128(uint8(data[62])));
|
||||
tokenApprovalNeeded = data[63] != 0;
|
||||
approvalNeeded = data[63] != 0;
|
||||
receiver = address(bytes20(data[64:84]));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user