I need to deploy a contract at Goerli and polygon to get the contract address identical on both networks. So how to do this by truffle?

Created by Sourajyoti Gupta, Modified on Fri, 28 Jul 2023 at 07:35 PM by Sourajyoti Gupta

There is a way to get the same contract address across multiple chains. to do this you'll simply need to create a new account on metamask and you will use this account only for contract deployment -because if you send any transaction besides contract creation the address will not be the same due to nonce incrementation with every transaction- and you deploy your contract using that account address. then change the network and deploy the other contract using the same account. that should do the trick. also, you can check this article to find out more details about how smart contract addresses are generated. 
Here is something useful: https://dev.to/prashant/how-to-deploy-a-smart-contract-to-the-same-address-across-different-blockchains-39jf

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article