Giter Club home page Giter Club logo

Comments (3)

scorpion9979 avatar scorpion9979 commented on July 19, 2024

The Uniswap v2 pair contract will check for the latter to not be greater than the former, but it will allow it to pass when they are equal.

I don't think the above premise is valid. I think this edge case is never reachable due to line 162 in the Uniswap V2 pair contract:

require(amount0Out < _reserve0 && amount1Out < _reserve1, 'UniswapV2: INSUFFICIENT_LIQUIDITY');

When underlyingReserves happens to match underlyingAmount, that means either amount0Out matches _reserve0 or amount1Out matches _reserve1. Which leads to the swap function call being reverted with UniswapV2: INSUFFICIENT_LIQUIDITY even before uniswapV2Call(...) is entered.

from hifi.

PaulRBerg avatar PaulRBerg commented on July 19, 2024

Your analysis may be correct, though I am not sure now since it's been a while since I opened this issue. I will let you decide if it should be closed.

from hifi.

scorpion9979 avatar scorpion9979 commented on July 19, 2024

Yeah, I think it should be closed.

from hifi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.