Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed AAVE and Euler tests due to flash loan functionality deprecation #41

Merged
merged 2 commits into from
Feb 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/flashloan/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ This template is for getting started with attack PoCs which use flash loans. The

| Network | Protocol | Library |
| ---------- | -------- | ------------------------------------------------------- |
| Ethereum | AAVEV1 | [AAVEV1FlashLoan](./lib/AAVEV1FlashLoan.sol) |
| Ethereum | AAVEV1 ⚠️ | [AAVEV1FlashLoan](./lib/AAVEV1FlashLoan.sol) |
| Ethereum | AAVEV2 | [AAVEV2FlashLoan](./lib/AAVEV2FlashLoan.sol) |
| Ethereum | AAVEV3 | [AAVEV3FlashLoan](./lib/AAVEV3FlashLoan.sol) |
| Ethereum | Euler | [EulerFlashLoan](./lib/EulerFlashLoan.sol) |
| Ethereum | Euler ⚠️ | [EulerFlashLoan](./lib/EulerFlashLoan.sol) |
| Ethereum | Balancer | [BalancerFlashLoan](./lib/BalancerFlashLoan.sol) |
| Ethereum | MakerDAO | [MakerDAOFlashLoan](./lib/MakerDAOFlashLoan.sol) |
| Ethereum | UniswapV2 | [UniswapV2FlashLoan](./lib/UniswapV2FlashLoan.sol) |
Expand Down
4 changes: 2 additions & 2 deletions src/flashloan/examples/MultiProviderFlashLoanExample.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ contract MultiProviderFlashLoanExample is FlashLoan, Tokens {
function _executeAttack() internal override {
console.log("DAI BALANCE DURING:", EthereumTokens.DAI.balanceOf(address(this)));
if (currentFlashLoanProvider() == FlashLoanProviders.UNISWAPV3) {
takeFlashLoan(FlashLoanProviders.AAVEV1, address(EthereumTokens.DAI), 1 ether);
} else if (currentFlashLoanProvider() == FlashLoanProviders.AAVEV1) {
takeFlashLoan(FlashLoanProviders.AAVEV3, address(EthereumTokens.DAI), 1 ether);
} else if (currentFlashLoanProvider() == FlashLoanProviders.AAVEV3) {
// Execute attack with funds from UNISWAPV3 and AAVE
}
}
Expand Down
6 changes: 6 additions & 0 deletions src/flashloan/lib/AAVEV1FlashLoan.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ pragma solidity ^0.8.0;

import "forge-std/interfaces/IERC20.sol";

/**
* @custom:deprecated
* @dev AAVE V1 flash loans have been disabled as part of the AAVE V1 deprecation strategy
* from BGD Labs. Flash loans only work from block 19168280 or earlier.
* https://governance.aave.com/t/temp-check-bgd-further-aave-v1-deprecation-strategy/15893/3.
*/
library AAVEV1FlashLoan {
/**
* @dev struct that hold the reference of IAAVEV1LendingPool and address core
Expand Down
6 changes: 6 additions & 0 deletions src/flashloan/lib/EulerFlashLoan.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ pragma solidity ^0.8.0;

import "forge-std/interfaces/IERC20.sol";

/**
* @custom:deprecated
* @dev Euler flash loans no longer work due to the $187M hack on March 13, 2023.
* Flash loans only work from block 16818068 or earlier.
* https://github.com/iphelix/euler-exploit-poc
*/
library EulerFlashLoan {
/**
* @dev struct that hold the reference of Euler and the dToken
Expand Down
12 changes: 9 additions & 3 deletions test/examples/FlashLoanExample.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@ contract FlashLoanExampleTest is Test {
multiProviderFlashLoanExample = new MultiProviderFlashLoanExample();
}

function testAAVEV1FlashLoan() public {
flashLoanExample.initiateAttack(FlashLoanProviders.AAVEV1);
}
/**
* @dev Flash loans only work from block 19168280 or earlier.
*/
// function testAAVEV1FlashLoan() public {
// flashLoanExample.initiateAttack(FlashLoanProviders.AAVEV1);
// }

function testAAVEV2FlashLoan() public {
flashLoanExample.initiateAttack(FlashLoanProviders.AAVEV2);
Expand All @@ -34,6 +37,9 @@ contract FlashLoanExampleTest is Test {
flashLoanExample.initiateAttack(FlashLoanProviders.BALANCER);
}

/**
* @dev Flash loans only work from block 16818068 or earlier.
*/
// function testEulerFlashLoan() public {
// flashLoanExample.initiateAttack(FlashLoanProviders.EULER);
// }
Expand Down
Loading