-
Notifications
You must be signed in to change notification settings - Fork 28
docs: update chain expansion guide for bytecode deployment #76
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds a bytecode deployment script for paymaster and SingleOwnerMSCA contracts while updating the README to include a comprehensive Chain Expansion Guide for deploying and verifying smart contracts across multiple networks.
- Introduces detailed deployment instructions with command examples for new deployment scripts.
- Replaces outdated on-chain deployment instructions with the updated Chain Expansion Guide.
- Updates documentation to support standard JSON input verification for various contracts.
Files not reviewed (17)
- broadcast/multi/107_DeploySponsorPaymasterEPv06.s.sol-1741905891/run.json: Language not supported
- broadcast/multi/107_DeploySponsorPaymasterEPv06.s.sol-1741906477/run.json: Language not supported
- broadcast/multi/107_DeploySponsorPaymasterEPv06.s.sol-1742244487/run.json: Language not supported
- broadcast/multi/110_DeployColdStorageAddressBookPluginEPv06.s.sol-1742333175/run.json: Language not supported
- broadcast/multi/110_DeployColdStorageAddressBookPluginEPv06.s.sol-latest/run.json: Language not supported
- script/bytecode-deploy/100_Constants.sol: Language not supported
- script/bytecode-deploy/107_DeploySponsorPaymasterEPv06.s.sol: Language not supported
- script/bytecode-deploy/108_DeployPluginManagerEPv06.s.sol: Language not supported
- script/bytecode-deploy/109_DeploySingleOwnerMSCAFactoryEPv06.s.sol: Language not supported
- script/bytecode-deploy/110_DeployColdStorageAddressBookPluginEPv06.s.sol: Language not supported
- script/bytecode-deploy/build-output/ColdStorageAddressBookPluginEPv06.json: Language not supported
- script/bytecode-deploy/build-output/PluginManagerEPv06.json: Language not supported
- script/bytecode-deploy/build-output/SingleOwnerMSCAFactoryEPv06.json: Language not supported
- script/bytecode-deploy/build-output/SponsorPaymasterImplementationEPv06.json: Language not supported
- script/bytecode-deploy/build-output/SponsorPaymasterProxyEPv06.json: Language not supported
- script/bytecode-deploy/standard-json-input/SingleOwnerMSCAEPv06_constructor_args: Language not supported
- script/bytecode-deploy/standard-json-input/SingleOwnerMSCAFactoryEPv06_constructor_args: Language not supported
1. Replace the placeholders and run the command in `script/cmd/DeploySponsorPaymaster`. | ||
2. Replace the placeholders and run the command in `script/cmd/DeploySponsorPaymaster`. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The deploy command instructions for EPv0.7 SponsorPaymaster appear duplicated between steps 1 and 2. Consider consolidating these steps to reduce potential confusion.
1. Replace the placeholders and run the command in `script/cmd/DeploySponsorPaymaster`. | |
2. Replace the placeholders and run the command in `script/cmd/DeploySponsorPaymaster`. | |
Replace the placeholders and run the command in `script/cmd/DeploySponsorPaymaster`. |
Copilot uses AI. Check for mistakes.
import {DeployFailed} from "./Errors.sol"; | ||
import {Script, console} from "forge-std/src/Script.sol"; | ||
|
||
contract DeployPluginManagerScript is Script { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name appears to be copy pasta, and I think this script should be placed in [buidl-wallet-contracts (entry-point-v0.6)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved to entrypoint v0.6 branch in #77
#77) ## Summary Add bytecode deployment script for paymaster and SingleOwnerMSCA to `entry-point-v0.6` branch ## Detail This pull request includes several changes to the deployment scripts for various components in the `script/bytecode-deploy` directory. The changes primarily involve adding new deployment scripts for different components and updating the `100_Constants.sol` file with necessary constants. Below are the most important changes: ### Changeset #### New Deployment Scripts * [`script/bytecode-deploy/101_DeploySponsorPaymaster.s.sol`](diffhunk://#diff-9c82cdaf3ef9fc416bbad145c086de2ad4b6c49cfbf3baf242632142aea41ed8R1-R157): Added a new script to deploy the Sponsor Paymaster EPv06 contract. This script includes steps for deploying the implementation, internal proxy, and main proxy contracts. * [`script/bytecode-deploy/102_DeployPluginManager.s.sol`](diffhunk://#diff-bf6775746ee1c4cdf005379dfb5f6d7ba256019323273ad345480a8c5e5c6708R1-R62): Added a new script to deploy the Plugin Manager EPv06 contract. This script checks if the contract is already deployed and deploys it if necessary. * [`script/bytecode-deploy/103_DeploySingleOwnerMSCAFactory.s.sol`](diffhunk://#diff-ba0ee952d7258dd1d2db8c0ab920cac8716ebc441334aadbfc9e285b246b0740R1-R75): Added a new script to deploy the Single Owner MSCA Factory EPv06 contract. This script includes steps for deploying the factory contract. * [`script/bytecode-deploy/104_DeployColdStorageAddressBookPlugin.s.sol`](diffhunk://#diff-43994f51e7b2228956bd21673c9e907b8f6778b37bed53c216d73015d88907e5R1-R71): Added a new script to deploy the Cold Storage Address Book Plugin EPv06 contract. This script checks if the contract is already deployed and deploys it if necessary. #### Constants Update * [`script/bytecode-deploy/100_Constants.sol`](diffhunk://#diff-04ae75bc743340930e12c5bd964e06f897cbba775e5a81511d093ffb605f31a7R1-R62): Added new constants for various addresses and a library with functions to get chain names and chains that need setup work after deployment. This file includes addresses for ENTRY_POINT, PLUGIN_MANAGER_ADDRESS, and other related addresses. #### Test changes Made test file changes for the following two test errors: * `[FAIL: call didn't revert at a lower depth than cheatcode call depth]`: add a `/// forge-config: default.allow_internal_expect_revert = true` on top of the test case fixes it. * `[FAIL: log != expected log]`: after printing out detailed error with `-vvvv`, it's because of `AA40 over verificationGasLimit`, I manually increased the verificationGasLimit in the failing tests and it passes again. ### Checklist - [x] Did you add new tests and confirm all tests pass? (`yarn test`) - [x] Did you ensure any new Solidity source code files meet minimum test coverage requirements? (`yarn coverage`) - [x] Did you update relevant docs? (docs are found in the `docs` folder) - [x] Do your commits follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) standard? - [x] Does your PR title also follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) standard? - [x] Did you run lint (`yarn lint`) and fix any issues? - [x] Did you run formatter (`yarn format:check`) and fix any issues (`yarn format:write`)? Note: I'll make the corresponding doc change in #76. ## Testing Mandatory section. For each changeset, please highlight the tests you've added. ## Documentation Optional section. Link to the doc.
moving the scripts to ep v0.6 branch in #77. This PR refactored to a pure doc change. @huaweigu @ashutosh-ukey |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR updates the README to provide a comprehensive Chain Expansion Guide, detailing steps to deploy and verify smart contracts on new blockchains.
- Updated the section title and content to describe the process for deploying on multiple chains
- Added detailed prerequisites, deployment, setup, and verification instructions for different components
- Removed outdated deployment & verification instructions
README.md
Outdated
|
||
#### Add new blockchain RPC URLs to foundry | ||
1. Add new blockchain to `[rpc_endpoints]` in foundry.toml following the format of `blockchain_a = ${BLOCKCHAIN_A_RPC_URL}` | ||
2. Update `.env.example` with the new RPC URL env var (e.g. `BLOCKCHAIN_A_RPC_URL`), also update your local `.env` to set up the new env var (e.g. `BLOCKCHAIN_A_RPC_URL=https://....`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The example for updating the .env.example
appears to have an unbalanced parenthesis or missing closing backtick. Consider revising the snippet for improved clarity.
2. Update `.env.example` with the new RPC URL env var (e.g. `BLOCKCHAIN_A_RPC_URL`), also update your local `.env` to set up the new env var (e.g. `BLOCKCHAIN_A_RPC_URL=https://....`. | |
2. Update `.env.example` with the new RPC URL env var (e.g. `BLOCKCHAIN_A_RPC_URL`), also update your local `.env` to set up the new env var (e.g. `BLOCKCHAIN_A_RPC_URL=https://example.com`). |
Copilot uses AI. Check for mistakes.
README.md
Outdated
|
||
### Prerequisites | ||
#### Fund deployer and owner | ||
Making sure there are enough new chain native token in deployer address (for contract deployment) and temporary owner |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The phrasing 'new chain native token' could be clarified or pluralized (e.g., 'native tokens for the new chain') to improve readability.
Making sure there are enough new chain native token in deployer address (for contract deployment) and temporary owner | |
Making sure there are enough native tokens for the new chain in the deployer address (for contract deployment) and the temporary owner |
Copilot uses AI. Check for mistakes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR updates the documentation by replacing the previous on-chain deployment instructions with a new, comprehensive "Chain Expansion Guide" in the README.
- Updated the README to include detailed instructions for supporting deployments to new blockchains.
- Added steps to configure new RPC URLs, update deployment scripts, and verify contracts across various networks.
Comments suppressed due to low confidence (1)
README.md:75
- [nitpick] Ensure consistent markdown formatting by adding the missing closing backtick for the RPC URL example to improve clarity.
2. Update `.env.example` with the new RPC URL env var (e.g. `BLOCKCHAIN_A_RPC_URL`), also update your local `.env` to set up the new env var (e.g. `BLOCKCHAIN_A_RPC_URL=https://blockchaina.rpc.com`),
README.md
Outdated
* Compiler Version: `v0.8.24` | ||
* License Type: `GNU GPLv3` | ||
|
||
### Deploy & Verify EPv0.6 SponsorPaymaster |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be moved to EP v0.6 branch?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed this, will create another PR for ep-v0.6 branch
README.md
Outdated
* License Type: `GNU GPLv3` | ||
|
||
### Deploy & Verify SingleOwnerMSCAFactory | ||
Deploy, setup and verify SingleOwnerMSCAFactory compatible with ERC-4337 v0.6 and ERC-6900 v0.7. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove ERC-4337 v0.6
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we want to remove 4337 v0.6?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR updates the chain expansion guide in the README, providing detailed instructions for deploying and verifying smart contracts across new blockchains.
- Updated title and structure to reflect "Chain Expansion Guide".
- Added detailed prerequisites and step-by-step commands for deploying and verifying various contracts.
- Removed outdated sections for on-chain deployment and verification.
Comments suppressed due to low confidence (1)
README.md:76
- [nitpick] Consider clarifying how updating the
getChains()
list affects subsequent deployment scripts, to guide developers on maintaining consistency in chain length across configurations.
3. Add new blockchain (e.g. "blockchain_a") to `getChains()` function in `./script/bytecode-deploy/100_Constants.sol`.
`make anvil` (if using foundry stack). To get a list of pre-funded addresses, you can look at the beginning of the logs in the `anvil` Docker container, or reference <https://github.com/foundry-rs/foundry/blob/0d8302880b79fa9c3c4aa52ab446583dece19a34/crates/anvil/README.md?plain=1#L48>. | ||
|
||
### (NEW) Deploy & Verify | ||
### Deploy & Verify |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] It might be helpful to include a brief note summarizing the key differences between this new 'Chain Expansion Guide' and the previous deployment instructions, reducing potential confusion.
### Deploy & Verify | |
### Deploy & Verify | |
This section introduces the new "Chain Expansion Guide," which focuses on bytecode deployment and standard JSON input verification. Unlike the previous deployment instructions, this guide emphasizes a streamlined process for chain expansion, reducing manual steps and improving compatibility with modern tooling. Note that the older deployment process is still applicable for legacy contracts. |
Copilot uses AI. Check for mistakes.
README.md
Outdated
|
||
## On-chain Deployment & Verification | ||
## Chain Expansion Guide | ||
Expanding the existing smart contracts to new blockchains. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: use complete sentences
Expanding the existing smart contracts to new blockchains. | |
This section explains how to expand the existing smart contracts to new blockchains. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
README.md
Outdated
|
||
### Prerequisites | ||
#### Fund deployer and owner | ||
Making sure there are enough native tokens for the new chain in the deployer address (for contract deployment) and temporary owner |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: use complete sentences
Making sure there are enough native tokens for the new chain in the deployer address (for contract deployment) and temporary owner | |
Make sure there are enough native tokens for the new chain in the deployer address (for contract deployment) and temporary owner |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
### Deploy & Verify UpgradableMSCAFactory and dependency smart contracts. | ||
Deploy, setup and verify UpgradableMSCAFactory compatible with ERC-4337 v0.7 and ERC-6900 v0.7. | ||
|
||
#### Run deploy commands: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we mention that this will attempt to deploy on all chains listed in foundry.toml
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point, added to the change
README.md
Outdated
forge script script/bytecode-deploy/110_DeployColdStorageAddressBookPluginEPv06.s.sol -vvvv --slow --broadcast --force --multi | ||
``` | ||
|
||
#### Verify contracts on block explorers. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There seems to be a lot of duplication in these verification sections. What do you think about having just one section for all of them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer duplication to improve readability since chain expansion is operation-heavy work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR updates the README by replacing the old on-chain deployment and verification guide with a comprehensive "Chain Expansion Guide" specifically addressing bytecode deployment.
- Replaces the previous on-chain deployment instructions with a new chain expansion guide.
- Provides detailed prerequisites, deploy and verify commands, and setup instructions for new blockchain integrations.
Comments suppressed due to low confidence (1)
README.md:76
- [nitpick] Consider clarifying what specific modifications are required in the getChains() function, as well as outlining the expected impact on the deployment scripts when the length of the chain list changes.
3. Add new blockchain (e.g. "blockchain_a") to `getChains()` function in `./script/bytecode-deploy/100_Constants.sol`.
``` | ||
#### Setup UpgradableMSCAFactory: | ||
|
||
Update `chains[]` list in `105_SetUpgradableMSCAFactoryPlugins.s.sol` and `106_StakeUpgradableMSCAFactory.s.sol`. Update `stakeValue` list in `106_StakeUpgradableMSCAFactory.s.sol`. And run |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Consider adding further details or a reference link that explains how to update the chains[] and stakeValue lists for clarity, especially for new contributors who may be unfamiliar with the required changes.
Update `chains[]` list in `105_SetUpgradableMSCAFactoryPlugins.s.sol` and `106_StakeUpgradableMSCAFactory.s.sol`. Update `stakeValue` list in `106_StakeUpgradableMSCAFactory.s.sol`. And run | |
Update the `chains[]` list in `105_SetUpgradableMSCAFactoryPlugins.s.sol` and `106_StakeUpgradableMSCAFactory.s.sol` to include the chain IDs you want to support. Ensure that each chain ID corresponds to a valid blockchain network. | |
Update the `stakeValue` list in `106_StakeUpgradableMSCAFactory.s.sol` to specify the staking values for each chain. The `stakeValue` list should align with the `chains[]` list, where each entry corresponds to the respective chain ID. | |
For more details on the format and purpose of these lists, refer to the [documentation](https://example.com/docs/upgradable-factory-setup). After making these updates, run the following commands: |
Copilot uses AI. Check for mistakes.
## Summary Update chain expansion guide in README for EP v0.6 branch ## Detail ### Changeset Update README with a comprehensive "Chain Expansion Guide". main branch [PR](#76) ### Checklist - [x] Did you add new tests and confirm all tests pass? (`yarn test`) - [x] Did you ensure any new Solidity source code files meet minimum test coverage requirements? (`yarn coverage`) - [x] Did you update relevant docs? (docs are found in the `docs` folder) - [x] Do your commits follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) standard? - [x] Does your PR title also follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) standard? - [x] Did you run lint (`yarn lint`) and fix any issues? - [x] Did you run formatter (`yarn format:check`) and fix any issues (`yarn format:write`)? ## Testing Mandatory section. For each changeset, please highlight the tests you've added. ## Documentation Optional section. Link to the doc.
Summary
Update chain expansion guide in README
Detail
Changeset
Checklist
yarn test
)yarn coverage
)docs
folder)yarn lint
) and fix any issues?yarn format:check
) and fix any issues (yarn format:write
)?Testing
Mandatory section.
For each changeset, please highlight the tests you've added.
Documentation
Optional section.
Link to the doc.