Skip to content

Commit

Permalink
Removed AAVE and Euler tests due to flash loan functionality deprecation
Browse files Browse the repository at this point in the history
  • Loading branch information
alejandro-immunefi committed Feb 14, 2024
1 parent 41c8358 commit 2699609
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 5 deletions.
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

0 comments on commit 2699609

Please sign in to comment.