mirror of
https://github.com/Instadapp/dsa-polygon-migration.git
synced 2024-07-29 22:27:58 +00:00
Revert "Flashloan changes"
This commit is contained in:
parent
e3fc1a92fd
commit
0e876d7d6b
|
@ -145,18 +145,9 @@ contract InstaFlash is AaveV2Migrator {
|
||||||
uint256[] calldata _amounts,
|
uint256[] calldata _amounts,
|
||||||
uint /*_route */, // no use of route but just to follow current flashloan pattern
|
uint /*_route */, // no use of route but just to follow current flashloan pattern
|
||||||
bytes calldata data
|
bytes calldata data
|
||||||
) external nonReentrant isDSA {
|
) external isDSA {
|
||||||
uint _length = _tokens.length;
|
uint _length = _tokens.length;
|
||||||
require(_length == _amounts.length, "not-equal-length");
|
require(_length == _amounts.length, "not-equal-length");
|
||||||
|
|
||||||
for (uint i = 0; i < _length; i++) {
|
|
||||||
for (uint j = 0; j < _length; j++) {
|
|
||||||
if (j != i) {
|
|
||||||
require(_tokens[j] != _tokens[i], "token-repeated");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
uint[] memory iniBal = new uint[](_length);
|
uint[] memory iniBal = new uint[](_length);
|
||||||
IERC20[] memory _tokenContracts = new IERC20[](_length);
|
IERC20[] memory _tokenContracts = new IERC20[](_length);
|
||||||
for (uint i = 0; i < _length; i++) {
|
for (uint i = 0; i < _length; i++) {
|
||||||
|
|
|
@ -41,12 +41,6 @@ contract Variables {
|
||||||
*/
|
*/
|
||||||
address public constant maticReceiver = 0x0000000000000000000000000000000000001001;
|
address public constant maticReceiver = 0x0000000000000000000000000000000000001001;
|
||||||
|
|
||||||
/**
|
|
||||||
* @dev ReentrancyGuard
|
|
||||||
*/
|
|
||||||
uint256 private constant _NOT_ENTERED = 1;
|
|
||||||
uint256 private constant _ENTERED = 2;
|
|
||||||
|
|
||||||
|
|
||||||
// Storage variables //
|
// Storage variables //
|
||||||
|
|
||||||
|
@ -72,32 +66,4 @@ contract Variables {
|
||||||
* @dev last stateId from the onStateReceive
|
* @dev last stateId from the onStateReceive
|
||||||
*/
|
*/
|
||||||
uint256 internal lastStateId;
|
uint256 internal lastStateId;
|
||||||
|
|
||||||
/**
|
|
||||||
* @dev ReentrancyGuard status variable
|
|
||||||
*/
|
|
||||||
uint256 private _reentrancyStatus;
|
|
||||||
|
|
||||||
// Modifer //
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @dev Prevents a contract from calling itself, directly or indirectly.
|
|
||||||
* Calling a `nonReentrant` function from another `nonReentrant`
|
|
||||||
* function is not supported. It is possible to prevent this from happening
|
|
||||||
* by making the `nonReentrant` function external, and make it call a
|
|
||||||
* `private` function that does the actual work.
|
|
||||||
*/
|
|
||||||
modifier nonReentrant() {
|
|
||||||
// On the first call to nonReentrant, _notEntered will be true
|
|
||||||
require(_reentrancyStatus != _ENTERED, "ReentrancyGuard: reentrant call");
|
|
||||||
|
|
||||||
// Any calls to nonReentrant after this point will fail
|
|
||||||
_reentrancyStatus = _ENTERED;
|
|
||||||
|
|
||||||
_;
|
|
||||||
|
|
||||||
// By storing the original value once again, a refund is triggered (see
|
|
||||||
// https://eips.ethereum.org/EIPS/eip-2200)
|
|
||||||
_reentrancyStatus = _NOT_ENTERED;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user