Added double token check

This commit is contained in:
Thrilok Kumar 2021-04-29 23:42:13 +05:30
parent ce8cc951bc
commit 8952099463

View File

@ -148,6 +148,15 @@ contract InstaFlash is AaveV2Migrator {
) external nonReentrant isDSA {
uint _length = _tokens.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);
IERC20[] memory _tokenContracts = new IERC20[](_length);
for (uint i = 0; i < _length; i++) {