mirror of
https://github.com/Instadapp/dsa-polygon-migration.git
synced 2024-07-29 22:27:58 +00:00
Added double token check
This commit is contained in:
parent
ce8cc951bc
commit
8952099463
|
@ -148,6 +148,15 @@ contract InstaFlash is AaveV2Migrator {
|
||||||
) external nonReentrant isDSA {
|
) external nonReentrant 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++) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user