Skip to content

Commit

Permalink
Remove another unnecessary casting
Browse files Browse the repository at this point in the history
  • Loading branch information
alexkeating committed Jun 5, 2023
1 parent 006e854 commit 9cc4b35
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
8 changes: 2 additions & 6 deletions script/Benchmark.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,7 @@ contract Benchmark is Script, OneInchContracts {

// Optimized router v5 swap call
(bool v5Ok,) = payable(v5Rtr).call(
abi.encodePacked(
DAI, uint96(100_000), uint96(v5Desc.minReturnAmount), uint256(0), bytes(v5Data)
)
abi.encodePacked(DAI, uint96(100_000), uint96(v5Desc.minReturnAmount), uint256(0), v5Data)
);

if (!v5Ok) revert OptimizedV5RouterFailed();
Expand All @@ -83,9 +81,7 @@ contract Benchmark is Script, OneInchContracts {

// Optimized v4 swap call
(bool v4Ok,) = payable(v4Rtr).call(
abi.encodePacked(
DAI, uint96(100_000), uint96(v4Desc.minReturnAmount), uint256(0), bytes(v4Data)
)
abi.encodePacked(DAI, uint96(100_000), uint96(v4Desc.minReturnAmount), uint256(0), v4Data)
);
if (!v4Ok) revert OptimizedV4RouterFailed();
}
Expand Down
4 changes: 1 addition & 3 deletions test/V4Router.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,7 @@ contract Fallback is V4RouterTest {
IERC20(USDC).approve(routerAddr, 250_000);
uint256 startingBalance = IERC20(USDC).balanceOf(swapSenderAddress);
(bool ok,) = payable(routerAddr).call(
abi.encodePacked(
address(0), uint96(250_000), uint96(desc.minReturnAmount), uint256(0), bytes(data)
)
abi.encodePacked(address(0), uint96(250_000), uint96(desc.minReturnAmount), uint256(0), data)
);
uint256 endingBalance = IERC20(USDC).balanceOf(swapSenderAddress);

Expand Down

0 comments on commit 9cc4b35

Please sign in to comment.