-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* test: fix USDC deal problem * test: fix broken tests due to assumptions * test: rm assert condition due to changes in assumption * test: returnAsset attack * test: add comments for commented out code * test: add test for full redeem at different times * feat: add rawCall function for asset manager * fix: rm comments regarding vuln * ci: change fuzz runs to 10K * ci: rm custom fuzz runs * test: rawCall * fix: update error message * test: fix bound too low no interest accrued * test: rm polygon test as USDC doesn't have a master minter role
- Loading branch information
Showing
4 changed files
with
205 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity ^0.8.0; | ||
|
||
import "src/interfaces/IAssetManager.sol"; | ||
import { ReservoirPair } from "src/ReservoirPair.sol"; | ||
import { SafeTransferLib } from "solady/utils/SafeTransferLib.sol"; | ||
|
||
contract ReturnAssetExploit { | ||
using SafeTransferLib for address; | ||
|
||
IERC20 public token0; | ||
IERC20 public token1; | ||
|
||
constructor(ReservoirPair aPair) { | ||
token0 = aPair.token0(); | ||
token1 = aPair.token1(); | ||
} | ||
|
||
function adjustManagement(int256 token0Change, int256 token1Change) external { | ||
address(token0).safeTransferFrom(msg.sender, address(this), uint256(-token0Change)); | ||
address(token1).safeTransferFrom(msg.sender, address(this), uint256(-token1Change)); | ||
} | ||
|
||
function attack(IAssetManager aAssetManager) external { | ||
aAssetManager.returnAsset(false, 123555); | ||
} | ||
} |
Oops, something went wrong.