From 009305e423fa7cd57f59d976cd2a3ef4547891a9 Mon Sep 17 00:00:00 2001 From: Thrilok Kumar Date: Fri, 16 Apr 2021 04:22:33 +0530 Subject: [PATCH] Fixed spells length bug --- contracts/receivers/aave-v2-receiver/helpers.sol | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contracts/receivers/aave-v2-receiver/helpers.sol b/contracts/receivers/aave-v2-receiver/helpers.sol index 9de607a..259e174 100644 --- a/contracts/receivers/aave-v2-receiver/helpers.sol +++ b/contracts/receivers/aave-v2-receiver/helpers.sol @@ -135,8 +135,8 @@ abstract contract Helpers is Stores, DSMath, Variables { } } - targets[spellsAmt] = "BASIC-A"; // TODO: right spell? - castData[spellsAmt] = abi.encodeWithSignature("withdraw(address,uint256,address,uint256,uint256)", data.atoken, data.borrowAmt, address(this), 0, 0); // encode the data of atoken withdrawal + targets[spellsAmt - 1] = "BASIC-A"; // TODO: right spell? + castData[spellsAmt - 1] = abi.encodeWithSignature("withdraw(address,uint256,address,uint256,uint256)", data.atoken, data.borrowAmt, address(this), 0, 0); // encode the data of atoken withdrawal AccountInterface(dsa).castMigrate(targets, castData, address(this)); }