-
Notifications
You must be signed in to change notification settings - Fork 102
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
improve local deployment #89
Open
frolic
wants to merge
4
commits into
coinbase:main
Choose a base branch
from
latticexyz:holic/local-deploys
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,8 @@ | ||
deploy :; source .env && export FOUNDRY_PROFILE=deploy && forge script script/DeployFactory.s.sol --rpc-url $${RPC_URL} --account $${ACCOUNT} --broadcast --verify | ||
deploy :; \ | ||
source .env && \ | ||
export FOUNDRY_PROFILE=deploy && \ | ||
forge script script/DeployFactory.s.sol \ | ||
--rpc-url $${RPC_URL} \ | ||
--account $${ACCOUNT} \ | ||
--broadcast \ | ||
$(if $(ETHERSCAN_API_KEY),--verify) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -7,10 +7,24 @@ import {SafeSingletonDeployer} from "safe-singleton-deployer-sol/src/SafeSinglet | |||||||||
import {CoinbaseSmartWallet, CoinbaseSmartWalletFactory} from "../src/CoinbaseSmartWalletFactory.sol"; | ||||||||||
|
||||||||||
contract DeployFactoryScript is Script { | ||||||||||
address constant EXPECTED_IMPLEMENTATION = 0x000100abaad02f1cfC8Bbe32bD5a564817339E72; | ||||||||||
address constant EXPECTED_FACTORY = 0x0BA5ED0c6AA8c49038F819E587E2633c4A9F428a; | ||||||||||
// cast code 0x914d7Fec6aaC8cd542e72Bca78B30650d45643d7 --rpc-url https://mainnet.base.org | ||||||||||
bytes constant SAFE_SINGLETON_FACTORY_CODE = | ||||||||||
hex"7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe03601600081602082378035828234f58015156039578182fd5b8082525050506014600cf3"; | ||||||||||
|
||||||||||
address constant EXPECTED_IMPLEMENTATION = | ||||||||||
0x000100abaad02f1cfC8Bbe32bD5a564817339E72; | ||||||||||
address constant EXPECTED_FACTORY = | ||||||||||
0x0BA5ED0c6AA8c49038F819E587E2633c4A9F428a; | ||||||||||
|
||||||||||
function run() public { | ||||||||||
// Set the deployer code if it's not already on the chain. | ||||||||||
if (SafeSingletonDeployer.SAFE_SINGLETON_FACTORY.code.length == 0) { | ||||||||||
Comment on lines
+20
to
+21
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this check could alternatively be
Suggested change
|
||||||||||
vm.etch( | ||||||||||
SafeSingletonDeployer.SAFE_SINGLETON_FACTORY, | ||||||||||
SAFE_SINGLETON_FACTORY_CODE | ||||||||||
); | ||||||||||
} | ||||||||||
|
||||||||||
console2.log("Deploying on chain ID", block.chainid); | ||||||||||
address implementation = SafeSingletonDeployer.broadcastDeploy({ | ||||||||||
creationCode: type(CoinbaseSmartWallet).creationCode, | ||||||||||
|
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.
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.
ideally
SafeSingletonDeployer
would export this or a method containing thevm.etch
logic, but hardcoding it here for nowhappy to open a PR over there too if this sounds reasonable!
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.
yeah good idea to export
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.
or alternatively, maybe we should just have a new function like, "deployAnvil"? which uses etch and doesn't have to expose
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.
works for me, should I open a PR?
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.
went ahead and opened one: wilsoncusack/safe-singleton-deployer-sol#2