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

build: multi-chain deployment script #748

Merged
merged 11 commits into from
Jan 16, 2024
Merged

Conversation

PaulRBerg
Copy link
Member

great job @andreivladbrg, I like the script. Let me know what you think about my changes.

foundry.toml Outdated Show resolved Hide resolved
foundry.toml Outdated Show resolved Hide resolved
andreivladbrg and others added 7 commits December 22, 2023 16:56
build: remove etherscan api keys in foundry.toml
feat: add deploy core 3 scripts
chore: improve .env.example file
chore: git ignore deployments dir
chore: remove forge fmt comment
chore: improve multi-chain deployment script
refactor: rename env var MAX_SEGMENT_COUNT
@andreivladbrg andreivladbrg force-pushed the build/multi-chain-script branch from 8827002 to 0b6d4ee Compare December 22, 2023 14:56
@PaulRBerg
Copy link
Member Author

It looks like forge script supports a --multi parameter:

If present, --resume or --verify will be assumed to be a multi chain deployment

Are you aware of this, @smol-ninja, @andreivladbrg? Might be worth digging this up.

@smol-ninja
Copy link
Member

Yes. I have used it before. In order to use it, we will have to explicitly specify it in the script files. Since we will still need an option to select chains to deploy on (could be because of higher gas fee on one chain at the time of deployment), the script will be required to take list of chains as input.

This works without using --multi flag as its part of the solidity script code. What --multi flag does is make --verify to work alongside multi chain deployment.

IMO it does not add any additional benefit other than handing over the multi deployment logic to the script files.

function run() {
    vm.createSelectFork(POLYGON_RPC_URL);
    vm.startBroadcast();
    
    vm.stopBroadcast();
    
     vm.createSelectFork(ETHEREUM_RPC_URL);
    vm.startBroadcast();
    
    vm.stopBroadcast();
}

@PaulRBerg PaulRBerg removed the feature label Jan 1, 2024
PaulRBerg added a commit that referenced this pull request Jan 9, 2024
As realized in #748,
keeping the Etherscan API keys in version control is not worth the
maintainance cost.
PaulRBerg added a commit that referenced this pull request Jan 9, 2024
As realized in #748,
keeping the Etherscan API keys in version control is not worth the
maintenance cost.
PaulRBerg added a commit that referenced this pull request Jan 10, 2024
As realized in #748,
keeping the Etherscan API keys in version control is not worth the
maintenance cost.
* build: add script to generate deployment command

* feat: new command-line options for deploy-multi-chain command

* chore: continue for warnings and throw for errors

* perf: polish deployment script

---------

Co-authored-by: Paul Razvan Berg <[email protected]>
Copy link
Member Author

@PaulRBerg PaulRBerg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM except for the admin addresses that can be hard-coded directly in the script. I've pushed a commit myself.

Good to merge, but as I've said here, we should do some more testing when we get to deploy V2.2.

.env.deployment.example Outdated Show resolved Hide resolved
@PaulRBerg
Copy link
Member Author

IMO it does not add any additional benefit other than handing over the multi deployment logic to the script files.

Agree. Thanks for explaining!

@PaulRBerg
Copy link
Member Author

Feel free to accept the PR and merge it @smol-ninja @andreivladbrg.

@PaulRBerg
Copy link
Member Author

@andreivladbrg - you have the honor to squash and merge.

@andreivladbrg andreivladbrg merged commit 7819a3b into main Jan 16, 2024
9 checks passed
@PaulRBerg PaulRBerg deleted the build/multi-chain-script branch January 16, 2024 17:21
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