Repository navigation
Conversation
Parallelizer V1
Update to hardhat v3 and deploy new chains
| /// @title GenericHarvester Front-Run Protection Tests | ||
| /// @notice Tests for the leftover token detection mechanism that protects against front-running attacks | ||
| contract Test_GenericHarvester_FrontRunProtection is Fixture { |
There was a problem hiding this comment.
no need to put FrontRunProctection in name, you can test the all contract here not just the FrontRunProctection
There was a problem hiding this comment.
Renamed to Test_GenericHarvesterfor units and Test_GenericHarvester_Integration for integrations
…r, add tests, utils, split unit/integration (18+3 tests)
…ceeds flashloan amount
… direction branching and budget lifecycle
Prevents CI from resolving a newer OZ version where __UUPSUpgradeable_init was removed, breaking the build.
|
Update : fix vulnerability + test coverage fix(GenericRebalancer): credit budget surplus when amountStableOut exceeds flashloan amount (missing else if) |
| uint256 amountOut = | ||
| parallelizer.swapExactInput(amount, 0, address(tokenP), tokenIn, address(this), block.timestamp); | ||
|
|
||
| // Swap to tokenIn |
There was a problem hiding this comment.
wrong comment: swap to tokenOut
| // Ensure router consumed all tokens | ||
| if (IERC20(tokenIn).balanceOf(address(this)) > tokenInBalanceBefore) { | ||
| revert RouterDidNotConsumeAllTokens(); | ||
| } |
There was a problem hiding this comment.
Will always revert in case of swapExactOutput with positive slippage
…ter to MultiBlockRebalancer, update all references
Fix compares token balance before receiving from Parallelizer and after router swap. Any leftover triggers revert, protecting user funds on flash loan