From 14f83ff0c02ce513ed4e5e1dd717468ed88aa333 Mon Sep 17 00:00:00 2001 From: Aleksandr Kuperman Date: Tue, 19 Apr 2022 17:44:02 +0100 Subject: [PATCH] chore: correcting linter issues --- test/unit/tokenomics/depository/Depository.js | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/test/unit/tokenomics/depository/Depository.js b/test/unit/tokenomics/depository/Depository.js index e8e907c9..038ef504 100644 --- a/test/unit/tokenomics/depository/Depository.js +++ b/test/unit/tokenomics/depository/Depository.js @@ -238,7 +238,7 @@ describe("Depository LP", async () => { // Transfer all LP tokens back to deployer await pairODAI.connect(bob).transfer(deployer.address, amountTo); const amount = (await pairODAI.balanceOf(deployer.address)); -// console.log("LP token in:",amount); + // console.log("LP token in:",amount); const totalSupply = (await pairODAI.totalSupply()); // Calculate payout based on the amount of LP @@ -250,31 +250,31 @@ describe("Depository LP", async () => { // Get the balances of tokens in LP let balance0 = (await token0.balanceOf(pairODAI.address)); let balance1 = (await token1.balanceOf(pairODAI.address)); -// console.log("token0",token0.address); -// console.log("token1",token1.address); -// console.log("balance0",balance0); -// console.log("balance1",balance1); -// console.log("ola token",ola.address); -// console.log("totalSupply LP",totalSupply); + // console.log("token0",token0.address); + // console.log("token1",token1.address); + // console.log("balance0",balance0); + // console.log("balance1",balance1); + // console.log("ola token",ola.address); + // console.log("totalSupply LP",totalSupply); // Token fractions based on the LP tokens amount and total supply const amount0 = ethers.BigNumber.from(amount).mul(balance0).div(totalSupply); const amount1 = ethers.BigNumber.from(amount).mul(balance1).div(totalSupply); -// console.log("token0 amount ref LP",amount0); -// console.log("token1 amount ref LP",amount1); + // console.log("token0 amount ref LP",amount0); + // console.log("token1 amount ref LP",amount1); // This is equivalent to removing the liquidity let amountOLA = amount1; balance0 = balance0.sub(amount0); balance1 = balance1.sub(amount1); -// console.log("balance0",balance0); -// console.log("balance1",balance1); + // console.log("balance0",balance0); + // console.log("balance1",balance1); // This is the equivalent of a swap operation to calculate additional OLA const reserveIn = balance0; const reserveOut = balance1; let amountIn = amount0; -// console.log("amountIn",amountIn); + // console.log("amountIn",amountIn); // amountOLA = amountOLA + getAmountOut(amountPairForOLA, reserveIn, reserveOut); // We use this tutorial to correctly calculate the in-out amounts: @@ -284,18 +284,18 @@ describe("Depository LP", async () => { const denominator = (reserveIn.mul(1000)).add(amountInWithFee); const amountOut = numerator.div(denominator); amountOLA = amountOLA.add(amountOut); -// console.log("amountInWithFee",amountInWithFee); -// console.log("numerator",numerator); -// console.log("denominator",denominator); -// console.log("delta amountOut:",amountOut); -// console.log("sutotal amountOLA:",amountOLA); + // console.log("amountInWithFee",amountInWithFee); + // console.log("numerator",numerator); + // console.log("denominator",denominator); + // console.log("delta amountOut:",amountOut); + // console.log("sutotal amountOLA:",amountOLA); const payout = await tokenomics.calculatePayoutFromLP(pairODAI.address, amount, 0); const df = await tokenomics.getDF(0); // Payouts with direct calculation and via DF must be equal expect(amountOLA.mul(df).div(E18)).to.equal(payout); -// console.log("payout direclty", payout); -// console.log("payout via df", amountOLA.mul(df).div(E18)); + // console.log("payout direclty", payout); + // console.log("payout via df", amountOLA.mul(df).div(E18)); // Trying to deposit the amount that would result in an overflow payout for the LP supply await pairODAI.connect(deployer).approve(depository.address, LARGE_APPROVAL);