-
Notifications
You must be signed in to change notification settings - Fork 17
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(sui): update its to interchainTokenService #517
base: main
Are you sure you want to change the base?
Conversation
@@ -136,8 +137,8 @@ async function postDeployExample(published, keypair, client, config, chain, opti | |||
// GMP Example Params | |||
const [gmpSingletonObjectId] = getObjectIdsByObjectTypes(published.publishTxn, [`${published.packageId}::gmp::Singleton`]); | |||
|
|||
// ITS Example Params | |||
const itsObjectId = chain.contracts.ITS?.objects?.ITS; |
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.
Grep for all occurrences of .ITS.
across the repo, there's a bunch of other references that need to be fixed
@@ -196,7 +196,7 @@ jobs: | |||
echo "emptyTokenName=Empty" >> $GITHUB_ENV | |||
echo "emptyTokenDecimals=6" >> $GITHUB_ENV |
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.
set the hub chain and address as an env var to avoid duplication and for consistency
sui/deploy-contract.js
Outdated
@@ -404,6 +423,8 @@ const GATEWAY_CMD_OPTIONS = [ | |||
new Option('--previousSigners <previousSigners>', 'number of previous signers to retain').default('15'), | |||
]; | |||
|
|||
const ITS_CMD_OPTIONS = [new Option('--itsHubAddress <itsHubAddress>', 'The address of the ITS HUB').env('ITS_HUB_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.
This should be read from the config config.axelar.contracts.InterchainTokenService.address
instead of provided by the user, see how evm/its.js
gets trusted addresses
|
||
const { OwnerCap, ITS } = itsConfig.objects; | ||
const { OwnerCap, InterchainTokenService } = itsConfig.objects; | ||
|
||
const txBuilder = new TxBuilder(client); | ||
|
||
const trustedChains = parseTrustedChains(config, trustedChain); |
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.
This method is a bit weird. It has some specialized logic for all EVM chains, but doesn't really make sense. We have other non EVM chain ITS contracts as well that should be included
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.
If all
is provided, we should just include the full list of chain's axelarIds where chain.contracts?.InterchainTokenService.address
is set. Makes the initial setup easy after deployment
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.
out of scope for this, maybe ask euro to make that change since he wrote this logic in the first place
await txBuilder.moveCall({ | ||
target: `${itsConfig.address}::its::set_trusted_addresses`, | ||
arguments: [ITS, OwnerCap, trustedAddressesObject], | ||
target: `${itsConfig.address}::interchain_token_service::add_trusted_chains`, |
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.
check if it's already a trusted chain and throw an error. Otherwise, the tx will fail on simulation and it won't be clear to the user
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.
Again, cannot, you specifically asked to remove all getters not used by our contracts in Sui.
AXE-7292