Uniswap / v2-core

🦄 🦄 Core smart contracts of Uniswap V2
https://uniswap.org/docs
GNU General Public License v3.0
2.92k stars 3.13k forks source link

How does uniswap make the development network and the official network contract address the same. #124

Open dulumao opened 3 years ago

dulumao commented 3 years ago

It's amazing

RusseII commented 2 years ago

@dulumao did you find the answer to this?

timwuu commented 2 years ago

The address comes from the creator's address and the number of transactions sent from that address (the “nonce”). from https://ethereum.org/en/developers/docs/accounts/

MicahZoltu commented 2 years ago

Using CREATE2. There are contracts that exist on most networks that help facilitate this like https://github.com/Zoltu/deterministic-deployment-proxy

ghost commented 8 months ago

If you use a same account and same nonce for different networks, contract address would be the same whether they have the same bytecode or not ( somehow better than create2 ).