-
Notifications
You must be signed in to change notification settings - Fork 50
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
Use array to create deployment command #753
Use array to create deployment command #753
Conversation
79aa953
to
5b2eb75
Compare
8e77f64
to
36b2c7f
Compare
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.
Are you able to run the script anymore?
Later update: this fails only when running with --deterministic
flag
Although I have my MNEMONIC
set up correctly in both .env
.env.deployment
but it still uses the default one:
It might be from multiple environments.
I have an idea, why aren't we changing the scripts from script/
to pass 2 uint256
for chain id and version instead of a string since it is this problematic.
Forgot to add this, I suggest we change with: # Choose the script based on the flag
if [[ $DETERMINISTIC_DEPLOYMENT == true ]]; then
echo -e "\n${IC}Deploying deterministic contracts to $chain...${NC}"
# Construct the command as an array
deployment_command=("forge" "script" "script/DeployDeterministicCore3.s.sol")
deployment_command+=("--rpc-url" "$rpc_url")
deployment_command+=("--sig" "run(string,address,address,uint256)")
deployment_command+=("ChainID ${chain_id}, Version 1.1.1")
deployment_command+=("$admin")
deployment_command+=("$comptroller")
deployment_command+=("$MAX_SEGMENT_COUNT")
deployment_command+=("-vvv")
else
echo -e "\n${IC}Deploying contracts to $chain...${NC}"
# Construct the command as an array
deployment_command=("forge" "script" "script/DeployCore3.s.sol")
deployment_command+=("--rpc-url" "$rpc_url")
deployment_command+=("--sig" "run(address,address,uint256)")
deployment_command+=("$admin")
deployment_command+=("$comptroller")
deployment_command+=("$MAX_SEGMENT_COUNT")
deployment_command+=("-vvv")
fi
FOUNDRY_PROFILE=optimized "${deployment_command[@]}" Each part of the command is an element in the array. This helps in keeping arguments that contain spaces grouped correctly and when expanding the array to run the command |
I know that version has this format "1.1.1" but we can make something to work |
I have seen this error. This is because you may be trying to simulate to deploy the deterministic address on a forked chain where it already exists, for example Sepolia where I deployed them already while testing (Now I think thats a problem and should be avoided). But if you try other chains, it should work.
The problem is to be able to construct the expected
Agree. Fixed in #765. |
yeah, but we are now using a new compiler
Yes, the problem is to construct the expected deployment_command. Passing the chain id and the version as uint256 would solve this because you wouldn't have With string: FOUNDRY_PROFILE=optimized \
forge script script/DeployDeterministicLockupLinear.s.sol \
--rpc-url $SEPOLIA_RPC_URL \
--sig "run(string,address,address,address)" \
"ChainID 11155111, Version 1.1.2" \
0x79Fb3e81aAc012c08501f41296CCC145a1E15844 \
0xC3Be6BffAeab7B297c03383B4254aa3Af2b9a5BA \
0x23eD5DA55AF4286c0dE55fAcb414dEE2e317F4CB
-vvvv vs With uint256: FOUNDRY_PROFILE=optimized \
forge script script/DeployDeterministicLockupLinear.s.sol \
--rpc-url $SEPOLIA_RPC_URL \
--sig "run(uint256,uint256,address,address,address)" \
11155111 \ -> chainid
4 \ -> version
0x79Fb3e81aAc012c08501f41296CCC145a1E15844 \
0xC3Be6BffAeab7B297c03383B4254aa3Af2b9a5BA \
0x23eD5DA55AF4286c0dE55fAcb414dEE2e317F4CB
-vvvv |
I agree, this could be an alternate solution to this. I think what we have now is good enough. It works as it should be. |
Closes #750