-
Notifications
You must be signed in to change notification settings - Fork 345
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
Implement determinstic contract addresses #1253
Conversation
983e155
to
34ab257
Compare
43922eb
to
d26ba5b
Compare
d26ba5b
to
4287983
Compare
salt: Uint8Array, | ||
prefix: string, | ||
): string { | ||
return _instantiate2AddressIntermediate(checksum, creator, salt, null, prefix).address; |
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 msg is always set to null when instantiate2 while Wasmd v0.31.x include msgs when creating address?
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 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 added #1398 for future readers
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 got it.
However, according to the link you provided, it seems that fix_msg should be null, not that instantiate msg should be null and current code is making instantiate msg to null.
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.
It refers to different aspects of the same thing. If msg
is null or empty during address generation, fixed_msg
must be false in the actual instantiation.
If msg
is null/empty (during address generation) and fixed_msg = false
, then you can instantiate the contract with any msg
you want without affecting the generated address.
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.
To be honest, I am not familiar with wasmd, so I'm not sure how to use instantiate2.
If you have a chance, could you make a test code that compares the address obtained with instantiate2Address and the address of the contract instantiated with instantiate2 in the script/wasmd chain?
And thank you for your kind answers :)
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, it's still early for instantiate2 and not much resources are out there. Feel free to subscribe to #1399 to see
- Pre-calculation
- Actual instantiation
in CosmJS. The tests for this ticket will make a few things clearer I guess.
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.
A Pre-calculation tool here
https://blueprints.juno.giansalex.dev/#/contract/tools
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.
Oh, nice! I strongly advise for removing the msg input field there. Nobody should need to use it.
Implementation for
CosmWasm/wasmd#942CosmWasm/wasmd#1014.The output is available here: https://gist.github.com/webmaster128/e4d401d414bd0e7e6f70482f11877fbe