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

Clarification on reusing deployments #539

Open
n00b21337 opened this issue Apr 22, 2024 · 4 comments
Open

Clarification on reusing deployments #539

n00b21337 opened this issue Apr 22, 2024 · 4 comments

Comments

@n00b21337
Copy link

I would like to know more about reusing deployments. Precisely I wonder when deployments are reused and when is the situation that hh deploy reuses them. Is the only parameter solidity code change and while the code is exactly the same they will be always reused if file save is there or is there some other parameter that could also make hh deploy make new contract?

@wighawag
Copy link
Owner

tx data is what is looked at, so if bytecode changes (including ipfs hash appended at the end, and libraries) OR constructor arguments changes, then contract will be deployed

You can also specify skipIfAlreadyDeployed: true to not redeploy

@n00b21337
Copy link
Author

skipIfAlreadyDeployed is the flag for all contracts, probably I would need it per contract,
but I guess I could delete some data from the deployments dir for the ones I want to deploy and the rest would be skipped.

@n00b21337
Copy link
Author

But best way would be to know what changed and keep it the same, thnx for info.

@n00b21337
Copy link
Author

n00b21337 commented May 13, 2024

I have a strange situation where the bytecode is different between two compiled contracts
although

  • I have the same code when c/p one code over the other (no git diff)
  • I have the same constructors on both deployments
  • I have same locked solidity version in hardhat config 0.8.19

Yet when I go and deploy contracts, it's not reused as hh is deploying different bytecode now, then it was some 5 months ago.

I could guess if it is possible that somehow solidity compiler is compiling contracts differently now then then, even on the same version. If not that don't really know what else...

@n00b21337 n00b21337 reopened this May 13, 2024
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

2 participants