Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HP-25: C4 Audit Fixes, Dynamic Fee Changes #42

Merged
merged 21 commits into from
May 2, 2022
Merged

Conversation

ankurdubey521
Copy link
Contributor

@ankurdubey521 ankurdubey521 commented Apr 18, 2022

Liquidity Farming

Bug Fixes:

Liquidity Pool

Bug Fixes:

Features:

  • In excess state the transfer fee % is now a fixed configurable value.
  • Deep Factor is now set to 2.

Liquidity Providers

Bugs Fixed

Token Manager

Features

  • Make Token Manager Upgradeable
  • Introduce excessStateTransferFeePerc mapping

Pauser

Bugs Fixed

Misc

  • Update Deployment Scripts
  • Add test for testing upgradibility

@ankurdubey521 ankurdubey521 changed the title [ WIP ] C4 Audit Fixes C4 Audit Fixes Apr 28, 2022
@ankurdubey521 ankurdubey521 changed the title C4 Audit Fixes C4 Audit Fixes, Dynamic Fee Changes Apr 28, 2022
@ankurdubey521 ankurdubey521 changed the title C4 Audit Fixes, Dynamic Fee Changes HP-25: C4 Audit Fixes, Dynamic Fee Changes Apr 28, 2022
@@ -335,14 +345,14 @@ contract LiquidityPool is
* @param initialGas Gas provided initially before any calculations began
* @param tokenAddress Token address for which calculation needs to be done
* @param amount Amount of token to be transfered before deducting the fee
* @param tokenGasPrice Gas price in the token being transfered to be used to calculate gas fee
* @param nativeTokenPriceInTransferredToken Price of native token in terms of the token being transferred (multiplied base div), used to calculate gas fee
* @return [ amountToTransfer, lpFee, transferFeeAmount, gasFee ]
*/
function getAmountToTransfer(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do these changes in new method getAmountToTransferV2 and same for sendFundsToUserV2

expect((await ethers.provider.getBalance(owner.address)).gte(nativeBalance)).to.be.true;
});

it("Should be able to withdraw liquidity", async function () {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a test case to verify if token manager was changed after contracts upgrades.

@tomarsachin2271 tomarsachin2271 merged commit cb76e25 into staging May 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants