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

Fix CREATE2 salt interpolation in multi-chain deployment script #750

Closed
PaulRBerg opened this issue Dec 17, 2023 · 5 comments
Closed

Fix CREATE2 salt interpolation in multi-chain deployment script #750

PaulRBerg opened this issue Dec 17, 2023 · 5 comments
Assignees

Comments

@PaulRBerg
Copy link
Member

Here:

\'ChainID $chain_id, Version 1.1.1\' \

I've tried all of the following approaches. None worked:

Approach Result in Terminal
Surround with \" '"ChainID' 43114, Version '1.1.1"'
Surround with \' '\'\''ChainID' 43114, Version '1.1.1\'\'''
Surround with ' ''\''ChainID' 43114, Version '1.1.1'\'''
Surround with ' Broken script

What should be generated is this:

"ChainID 43114, Version 1.1.1"

Or this:

'ChainID 43114, Version 1.1.1'

Note: this is best debugged by adding the -x flag here:

$ set -euxo pipefail
@smol-ninja
Copy link
Member

Interestingly, it works for v2-periphery. When I was polishing these scripts, even I couldn't manage to make it work for v2-core while it works totally fine for v2-periphery. Although everything looks same including the foundry version (may be I am missing something). Did you try to run the script for v2-periphery with --deterministic flag?

Screenshot 2023-12-17 at 19 30 25

@PaulRBerg
Copy link
Member Author

Interesting. I haven't run the script in V2 Periphery just yet.

@smol-ninja
Copy link
Member

smol-ninja commented Dec 18, 2023

There was an issue with our deployment script. See PR: #753.

Bash is very smart to interpret string as executable command. Expanding string using multi line comments doesn't work as intended sometimes. Source https://google.github.io/styleguide/shellguide.html#arrays.

For future, we should adhere to the best practices from Google styleguide.

@smol-ninja
Copy link
Member

smol-ninja commented Dec 18, 2023

Update on v2-periphery

It was not even working in v2-periphery correctly. The create2Salt was interpreted as ''''ChainID' 11155111, Version '1.1.0''''. Fixed in sablier-labs/v2-periphery#240.

@PaulRBerg
Copy link
Member Author

Nice finding with the Google styleguide!

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

No branches or pull requests

3 participants