Support Consistent Address Deployment Across Networks #132
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Overview
This PR introduces an update to the smart contract deployment process using Foundry and the
CREATE3
. By deploying a standaloneCreate3Deployer
contract on networks (e.g., Sepolia), we enable Foundry to execute actual transactions throughCreate3Deployer
, and ensuring that contracts are deployed at the same deterministic addresses.Key Features
salt
value derived from a providedseed
. This ensures uniformity and predictability of contract addresses on various networks.seed
argument. Thisseed
is used to generate thesalt
for the Create3 deployment, ensuring that using the sameseed
on different chains will deploy contracts to the same address.Motivation
Previously, deploying smart contracts using Foundry with the Create3 library faced verification issues on testnets due to the absence of actual deployment transactions. This PR resolves this issue by ensuring that each deployment involves a real transaction on the blockchain.
Additional Benefits
This update not only fixes the verification issue but also enhances the flexibility and control we have over the deployment process. It allows for seamless address changes without sacrificing consistency across multiple chains.
Usage
Deploy contracts by running the deployment script with a specific
seed
:This command will ensure that the same contract addresses are used across different networks, provided the same
seed
is used.Test Plan
seed
on different networks and verify the addresses match.Related Issue
Closes #131
Note
This PR also include the change in another PR #115 of licensing hook, will rebase after the PR#115 merged.