wip settle testcase

This commit is contained in:
Mubaris NK 2021-04-15 21:05:02 +05:30
parent 7ee03cfdc8
commit 58e42fd447
No known key found for this signature in database
GPG Key ID: 9AC09AD0F8D68561
3 changed files with 14 additions and 4 deletions

View File

@ -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);
}
(

View File

@ -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;

View File

@ -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)
})
})