Skip to content

Want to solve Uniswap's puzzle #453

@formysister

Description

@formysister

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions