Skip to content

Deterministic Contract Deployment & Easy Verification #261

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

seongyun-ko
Copy link
Contributor

@seongyun-ko seongyun-ko commented May 2, 2025

The script deployment/deploy.s.sol deployment/deploy.s.sol) provides a standardized, easy-to-review deployment flow using a deterministic contract deployment flow with Create2. It logs all deployment parameters and addresses in a structured JSON file for easy review and reproducibility. EtherFiRedemptionManager is used as an example.

Security Guarantee

By using CREATE2 with a fixed salt and bytecode, the deployed contract address is fully predictable and verifiable before upgrade, ensuring no surprises or hidden logic.

Reviewability

All constructor arguments and deployment metadata are automatically saved and human-readable, making audits and reviews straightforward and transparent for any contract deployed with this script.

Example output json file after deployment for archiving

{
  "contractName": "EtherFiRedemptionManager",
  "deploymentParameters": {
    "factory": "0x356d1B83970CeF2018F2c9337cDdb67dff5AEF99",
    "salt": "0x46a81769b944c166e46b4e02c4e78fade102d288000000000000000000000000",
    "constructorArgs": {
      "_liquidityPool": "0x0000000000000000000000000000000000000000",
      "_eEth": "0x0000000000000000000000000000000000000000",
      "_weEth": "0x0000000000000000000000000000000000000000",
      "_treasury": "0x0000000000000000000000000000000000000000",
      "_roleRegistry": "0x0000000000000000000000000000000000000000"
    }
  },
  "deployedAddress": "0x6BD8EA55e4522e4bDF71ECBa31b4d633A88aBB8c"
}

shivam-ef
shivam-ef previously approved these changes May 2, 2025
@shivam-ef
Copy link
Contributor

LGTM LFG!!!!

@solipsis
Copy link
Contributor

solipsis commented May 2, 2025

Looks good. One thing to maybe consider. Would we want the salt to be ether.fi-{commitSlug}? i.e. ether.fi-abc123

Could be nice to know exactly which commit each deployment should come from

@seongyun-ko
Copy link
Contributor Author

Looks good. One thing to maybe consider. Would we want the salt to be ether.fi-{commitSlug}? i.e. ether.fi-abc123

Could be nice to know exactly which commit each deployment should come from

Good idea. I updated the script to use the commit hash to generate the salt with right padding

@seongyun-ko seongyun-ko changed the title Deterministic Contract Deployment Deterministic Contract Deployment & Easy Verification May 5, 2025
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

Successfully merging this pull request may close these issues.

3 participants