mirror of
https://github.com/Instadapp/dsa-connectors.git
synced 2024-07-29 22:37:00 +00:00
minor fix
This commit is contained in:
parent
fd4a522446
commit
9a46bee94b
|
|
@ -273,7 +273,7 @@ contract AaveHelpers is Helper {
|
||||||
for (uint256 i = 0; i < _length; i++) {
|
for (uint256 i = 0; i < _length; i++) {
|
||||||
if (amts[i] > 0) {
|
if (amts[i] > 0) {
|
||||||
uint256 _amt = amts[i];
|
uint256 _amt = amts[i];
|
||||||
address _token = tokens[i];
|
address _token = address(atokenContracts[i]);
|
||||||
_targets[_cntr] = "BASIC-A";
|
_targets[_cntr] = "BASIC-A";
|
||||||
_data[_cntr] = abi.encodeWithSelector(
|
_data[_cntr] = abi.encodeWithSelector(
|
||||||
basicWithdraw,
|
basicWithdraw,
|
||||||
|
|
@ -345,7 +345,7 @@ contract AaveHelpers is Helper {
|
||||||
for (uint256 i = 0; i < _length; i++) {
|
for (uint256 i = 0; i < _length; i++) {
|
||||||
if (amts[i] > 0) {
|
if (amts[i] > 0) {
|
||||||
uint256 _amt = amts[i];
|
uint256 _amt = amts[i];
|
||||||
address _token = tokens[i];
|
address _token = address(atokenContracts[i]);
|
||||||
_targets[_cntr] = "BASIC-A";
|
_targets[_cntr] = "BASIC-A";
|
||||||
_data[_cntr] = abi.encodeWithSelector(
|
_data[_cntr] = abi.encodeWithSelector(
|
||||||
basicWithdraw,
|
basicWithdraw,
|
||||||
|
|
|
||||||
|
|
@ -334,8 +334,7 @@ describe("Import Aave v3 Position", function () {
|
||||||
walletBsigner = await ethers.getSigner(walletB.address);
|
walletBsigner = await ethers.getSigner(walletB.address);
|
||||||
|
|
||||||
await token.connect(signer).transfer(dsaWallet2.address, ethers.utils.parseEther("10"));
|
await token.connect(signer).transfer(dsaWallet2.address, ethers.utils.parseEther("10"));
|
||||||
console.log(dsaWallet1.address);
|
|
||||||
console.log(walletB.address);
|
|
||||||
const spells = [
|
const spells = [
|
||||||
//deposit DAI in aave
|
//deposit DAI in aave
|
||||||
{
|
{
|
||||||
|
|
@ -410,18 +409,18 @@ describe("Import Aave v3 Position", function () {
|
||||||
it("Should merge Aave position", async () => {
|
it("Should merge Aave position", async () => {
|
||||||
//Approving max amount
|
//Approving max amount
|
||||||
const amount = ethers.constants.MaxUint256;
|
const amount = ethers.constants.MaxUint256;
|
||||||
const tx0 = await aDai.connect(wallet0).approve(dsaWallet1.address, amount);
|
const tx0 = await aDai.connect(walletBsigner).approve(dsaWallet1.address, amount);
|
||||||
|
|
||||||
const amount0 = new BigNumber(await usdcToken.connect(wallet0).balanceOf(dsaWallet2.address));
|
const amount0 = new BigNumber(await usdcToken.connect(walletBsigner).balanceOf(dsaWallet2.address));
|
||||||
const amountB = new BigNumber(amount0.toString()).multipliedBy(5).dividedBy(1e4);
|
const amountB = new BigNumber(amount0.toString()).multipliedBy(5).dividedBy(1e4);
|
||||||
const amountWithFee = amount0.plus(amountB);
|
const amountWithFee = amount0.plus(amountB);
|
||||||
console.log(amount0.toFixed(0));
|
console.log(amountWithFee.toString());
|
||||||
|
|
||||||
const flashSpells = [
|
const flashSpells = [
|
||||||
{
|
{
|
||||||
connector: "AAVE-V3-IMPORT-X",
|
connector: "AAVE-V3-IMPORT-X",
|
||||||
method: "importAave",
|
method: "importAave",
|
||||||
args: [dsaWallet2.address, [[DAI], [USDC], false, [amountB.toFixed(0)]]] //dsaWallet2 --> DSA_A DSA with aave position
|
args: [dsaWallet2.address, [[DAI], [USDC], false, [amountB.toFixed(0)]]] //dsaWallet2 --> DSA_A DSA with aave position
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
connector: "INSTAPOOL-C",
|
connector: "INSTAPOOL-C",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user