From 58e42fd4473158ebbdd14c9b8c9db66e8ce0f0bc Mon Sep 17 00:00:00 2001 From: Mubaris NK Date: Thu, 15 Apr 2021 21:05:02 +0530 Subject: [PATCH] wip settle testcase --- contracts/senders/aave-v2-migrator/main.sol | 2 +- contracts/senders/aave-v2-migrator/variables.sol | 2 +- test/migrator_l1.test.js | 14 ++++++++++++-- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/contracts/senders/aave-v2-migrator/main.sol b/contracts/senders/aave-v2-migrator/main.sol index 0088e91..a8f606f 100644 --- a/contracts/senders/aave-v2-migrator/main.sol +++ b/contracts/senders/aave-v2-migrator/main.sol @@ -63,7 +63,7 @@ contract LiquidityResolver is Helpers, Events { IERC20 _tokenContract = IERC20(_token); uint _tokenBal = _tokenContract.balanceOf(address(this)); if (_tokenBal > 0) { - _tokenContract.safeApprove(address(this), _tokenBal); + _tokenContract.safeApprove(address(aave), _tokenBal); aave.deposit(_token, _tokenBal, address(this), 3288); } ( diff --git a/contracts/senders/aave-v2-migrator/variables.sol b/contracts/senders/aave-v2-migrator/variables.sol index bbf0b54..64bb15d 100644 --- a/contracts/senders/aave-v2-migrator/variables.sol +++ b/contracts/senders/aave-v2-migrator/variables.sol @@ -39,7 +39,7 @@ contract Variables { */ uint16 constant internal referralCode = 3228; - address constant internal polygonReceiver = address(0); // TODO: Replace this + address constant internal polygonReceiver = 0xA35f3FEFEcb5160327d1B6A210b60D1e1d7968e3; // This is fake addr. TODO: Replace this FlashloanInterface constant internal flashloanContract = FlashloanInterface(0x709407B70ce0845996108205aA92aE87B22F7b1a); // TODO: Replace this address constant internal erc20Predicate = 0x40ec5B33f54e0E8A33A975908C5BA1c14e5BbbDf; diff --git a/test/migrator_l1.test.js b/test/migrator_l1.test.js index 3250c03..fa5fc5c 100644 --- a/test/migrator_l1.test.js +++ b/test/migrator_l1.test.js @@ -115,9 +115,19 @@ describe("Migrator", function() { }) const signer = ethers.provider.getSigner(sourceAddr) - const tx = await migrator.connect(signer).migrateWithFlash(rawData, ethers.utils.parseEther('20')) + const tx = await migrator.connect(signer).migrateWithFlash(rawData, ethers.utils.parseEther('40')) const receipt = await tx.wait() - console.log(receipt) + // console.log(receipt) + }) + + it("test settle", async function() { + const tokens = [weth] + const amts = [ethers.utils.parseEther('10')] + + const tx = await migrator.settle(tokens, amts) + const receipt = await tx.wait() + + // console.log(receipt) }) }) \ No newline at end of file