2

I am creating a DEX by forking Uniswap.

If I fork Uniswap V3 then do I need to re-deploy all contracts in libraries folder?

Q 2: How Uniswap calculates the price of a token? Does it get it from Chainlink's price feed?

1

1 Answer 1

0

No, you don't need to "re-deploy" all contracts in libraries folder. You only have to deploy UniswapV3Factory.

All the imports the contract has are automatically taken care of for you and added as part of the source code.

So, when you say...

import './UniswapV3Pool.sol';

...you are also importing all the imports that are included in this smart contract.

This means that you are also importing all the...

import './libraries/*

...that appear listed there.

The address you will get after successfully deploying UniswapV3Factory will be the address of a smart contract that not only "understands" all the UniswapV3Factory methods but also the methods of all the smart contracts that it inherites (IUniswapV3Factory, UniswapV3PoolDeployer and NoDelegateCall).

2
  • Thanks, tell me one thing that there are multiple contracts in contracts folder except libraries and interfaces, as u mentioned too, if i only deploy uniswapV3Factory.sol then how other related contracts will syncronize with the factory contract, they are not deployed so how their methods will work?
    – Hacek
    Apr 6, 2023 at 8:44
  • They will synchronise because they will be part of ’UniswapV3Factory‘ as this contract inherits the others. So technically they are deployed as part of it. That's why you also get those methods. Apr 8, 2023 at 0:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.