mirror of
https://github.com/Instadapp/dsa-polygon-migration.git
synced 2024-07-29 22:27:58 +00:00
bug fixes on migrate cast spells
This commit is contained in:
parent
03e2fd7c9d
commit
0a38ebbb19
|
@ -104,18 +104,17 @@ abstract contract Helpers is Stores, DSMath, Variables {
|
||||||
string[] memory targets = new string[](spellsAmt);
|
string[] memory targets = new string[](spellsAmt);
|
||||||
bytes[] memory castData = new bytes[](spellsAmt);
|
bytes[] memory castData = new bytes[](spellsAmt);
|
||||||
for (uint j = 0; j < num; j++) {
|
for (uint j = 0; j < num; j++) {
|
||||||
targets[j] = "AAVE-A";
|
|
||||||
uint k = j * 2;
|
uint k = j * 2;
|
||||||
if (i < num - 1) {
|
if (i < num - 1) {
|
||||||
// borrow spell
|
targets[k] = "AAVE-V1-A";
|
||||||
castData[k] = abi.encode("6abcd3de", _token, splitAmt, 2, 0, 0); // TODO: verify this & is rate mode right?
|
castData[k] = abi.encodeWithSignature("borrow(address,uint256,uint256,uint256,uint256)", _token, splitAmt, 2, 0, 0);
|
||||||
// deposit spell
|
targets[k+1] = "AAVE-V1-A";
|
||||||
castData[k+1] = abi.encode("ce88b439", _token, splitAmt, 2, 0, 0); // TODO: verify this & is rate mode right?
|
castData[k+1] = abi.encodeWithSignature("deposit(address,uint256,uint256,uint256,uint256)", _token, splitAmt, 2, 0, 0);
|
||||||
} else {
|
} else {
|
||||||
// borrow spell
|
targets[k] = "AAVE-V1-A";
|
||||||
castData[k] = abi.encode("6abcd3de", _token, finalSplit, 2, 0, 0); // TODO: verify this & is rate mode right?
|
castData[k] = abi.encodeWithSignature("borrow(address,uint256,uint256,uint256,uint256)", _token, finalSplit, 2, 0, 0);
|
||||||
// deposit spell
|
targets[k+1] = "AAVE-V1-A";
|
||||||
castData[k+1] = abi.encode("ce88b439", _token, finalSplit, 2, 0, 0); // TODO: verify this & is rate mode right?
|
castData[k+1] = abi.encodeWithSignature("deposit(address,uint256,uint256,uint256,uint256)", _token, splitAmt, 2, 0, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user