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

feat(flash-swap): support liquidating vaults with underlying as collateral #64

Merged
merged 16 commits into from
Nov 5, 2021

Commits on Nov 2, 2021

  1. Configuration menu
    Copy the full SHA
    f222278 View commit details
    Browse the repository at this point in the history

Commits on Nov 3, 2021

  1. Configuration menu
    Copy the full SHA
    ef7a6d3 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    254bafb View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    4e3f8cb View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    59db094 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    c238f40 View commit details
    Browse the repository at this point in the history

Commits on Nov 4, 2021

  1. Configuration menu
    Copy the full SHA
    ffda179 View commit details
    Browse the repository at this point in the history
  2. refactor(flash-swap): "HifiFlashUniswapV2" into "CollateralFlashUnisw…

    …apV2"
    
    chore: update flash contract deployers to use the latest contract names
    chore(tasks): update flash contract deployers to use the latest contract names
    refactor(flash-swap): "HifiFlashUniswapV2Underlying" into "UnderlyingFlashUniswapV2"
    refactor(flash-swap): "HifiFlashUniswapV2Utils" into "FlashUtils"
    test(flash-swap): update tests to use the latest contract names
    PaulRBerg committed Nov 4, 2021
    Configuration menu
    Copy the full SHA
    b02aac3 View commit details
    Browse the repository at this point in the history
  3. refactor(flash-swap): use only "underlying" in var names in "Underlyi…

    …ngFlashUniswapV2"
    
    chore(amm,flash-swap,proxy-target): use "old" and "new" prefixes instead of "pre" and "post"
    chore(flash-swap): better explain the role of subsidizer in the "uniswapV2Call" function
    refactor(errors): "FlashBorrowWrongToken" to "FlashBorrowOtherToken"
    refactor(flash-swap): "bot" to "subsidizer"
    refactor(flash-swap): "collateral" to "otherToken"
    refactor(flash-swap): "collateralRepayAmount" to "repayCollateralAmount"
    refactor(flash-swap): delete "collateralAmount" arg in "FlashBorrowCollateral" custom err
    refactor(flash-swap): delete superfluous "vars.swapToken" var
    refactor(flash-swap): "FlashLiquidateBorrow" event to "FlashSwapCollateralAndLiquidateBorrow"
    refactor(flash-swap): "FlashLiquidateBorrow" event to "FlashSwapUnderlyingAndLiquidateBorrow"
    refactor(flash-swap): "getCollateralAndUnderlyingAmount" to "getOtherTokenAndUnderlyingAmount"
    refactor(flash-swap): "getRepayCollateralAmount" to "getRepayUnderlyingAmount"
    refactor(flash-swap): "overshootCollateralAmount" to "shortfallUnderlyingAmount"
    refactor(flash-swap): import "IHToken" in "FlashUtils.sol"
    test(flash-swap): order vars alphabetically
    test(flash-swap): rename "usdcRepayFeeAmount" var to "usdcFeeAmount"
    PaulRBerg committed Nov 4, 2021
    Configuration menu
    Copy the full SHA
    5a2e0dc View commit details
    Browse the repository at this point in the history
  4. test(flash-swap): refactor variable names in "UnderlyingFlashUniswapV…

    …2" tests
    
    test(flash-swap): import "LIQUIDATION_INCENTIVES" to set liquidation incentives for USDC/ WBTC
    PaulRBerg committed Nov 4, 2021
    Configuration menu
    Copy the full SHA
    e1ed460 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    601f296 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    4da7d20 View commit details
    Browse the repository at this point in the history
  7. fix(flash-swap): properly compare "repayUnderlyingAmount" to "seizedU…

    …nderlyingAmount"
    
    docs(flash-swap): better formulate the NatSpec comments for "getRepayUnderlyingAmount"
    test(flash-swap): add time-bound tests for "UnderlyingFlashUniswapV2"
    test(flash-swap): delete price-related tests for "UnderlyingFlashUniswapV2"
    test(flash-swap): refer to the "pair contract" as "UniswapV2Pair contract" in descriptors
    test(flash-swap): rename "bumpPoolReserves" to "increasePoolReserves"
    test(flash-swap): rename "collateralAmount" to "swapCollateralAmount"
    test(flash-swap): rename "repayHUsdcAmount" to "repayAmount"
    test(flash-swap): rename "underlyingAmount" to "swapUnderlyingAmount"
    PaulRBerg committed Nov 4, 2021
    Configuration menu
    Copy the full SHA
    613df07 View commit details
    Browse the repository at this point in the history

Commits on Nov 5, 2021

  1. fix(flash-swap): transfer profit instead of subsidized amount

    docs(flash-swap): rewrite the @notice for "liquidateBorrowInternal" function
    refactor(flash-swap): emit "profitUnderlyingAmount" and "subsidizedUnderlyingAmont" in event
    refactor(flash-swap): rename "shortfallUnderlyingAmount" to "subsidizedUnderlyingAmount"
    refactor(flash-swap): rename "surplusUnderlyingAmount" to "profitUnderlyingAmount"
    test(flash-swap): erc-20 approve to "MaxUint256"
    test(flash-swap): refer to USDC as "underlying" in variable names
    test(flash-swap): rename "repayAmount" to "repayHTokenAmount"
    test(flash-swap): when the repay underlying amount is less than the seized underlying amount
    PaulRBerg committed Nov 5, 2021
    Configuration menu
    Copy the full SHA
    d86fc14 View commit details
    Browse the repository at this point in the history
  2. test(flash-swap): repay underlying equal to seized underlying

    test(flash-swap): remove redundant debug console logs
    scorpion9979 authored and PaulRBerg committed Nov 5, 2021
    Configuration menu
    Copy the full SHA
    190e0ec View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    5ced780 View commit details
    Browse the repository at this point in the history