-
Notifications
You must be signed in to change notification settings - Fork 16
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
feat(cosmwasm): save salt in config file #217
base: main
Are you sure you want to change the base?
Conversation
@@ -35,20 +35,21 @@ const uploadContract = async (client, wallet, config, options) => { | |||
return client.upload(account.address, wasm, uploadFee).then(({ checksum, codeId }) => ({ checksum, codeId, account })); | |||
}) | |||
.then(({ account, checksum, codeId }) => { | |||
const usedSalt = salt || contractName.concat(chainNames); |
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.
const usedSalt = salt || contractName.concat(chainNames); | |
let salt = options.salt || contractName.concat(chainNames); |
to reuse salt
name
const address = instantiate2 | ||
? instantiate2Address( | ||
fromHex(checksum), | ||
account.address, | ||
fromHex(getSaltFromKey(salt || contractName.concat(chainNames))), | ||
fromHex(getSaltFromKey(usedSalt)), |
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.
fromHex(getSaltFromKey(usedSalt)), | |
fromHex(getSaltFromKey(salt)), |
'axelar', | ||
) | ||
: null; | ||
|
||
return { codeId, address }; | ||
return { codeId, address, usedSalt }; |
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.
return { codeId, address, usedSalt }; | |
return { codeId, address, salt }; |
const address = instantiate2 | ||
? instantiate2Address( | ||
fromHex(checksum), | ||
account.address, | ||
fromHex(getSaltFromKey(salt || contractName.concat(chainNames))), | ||
fromHex(getSaltFromKey(usedSalt)), |
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.
Does the salt need to bytes32, or can it be a string? If the latter, then getSaltFromKey
isn't needed. We could use the readable string as is
No description provided.