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

Want to solve Uniswap's puzzle #453

Open
formysister opened this issue Sep 11, 2023 · 0 comments
Open

Want to solve Uniswap's puzzle #453

formysister opened this issue Sep 11, 2023 · 0 comments

Comments

@formysister
Copy link

In UniswapV2Router original code, we can find the method named pairFor().
This method is called when liquidity added to get pair.

But when deploy smart contract with this original method, addLiquidity() method makes error and transaction is reverted.

So all customers need to redefine the functions like below.

function pairFor(address factory, address tokenA, address tokenB) internal view returns (address pair) {
        pair = IUniswapV2Factory(factory).getPair(tokenA,tokenB);
}

What's the wrong with that function and how original Uniswap deployed initially?

image

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

No branches or pull requests

1 participant