-
Notifications
You must be signed in to change notification settings - Fork 29
fix: sui migration release doc #1020
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
Merged
Merged
Changes from 10 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
740d729
fix: update snapshot on doc
blockchainguyy e8c9d70
adds post-upgrade instructions for re-deploying example contract, tes…
drewstaylor 652fb96
Merge branch 'main' into fix/update-sui-release-doc
drewstaylor d6d196a
Fix grammar style
drewstaylor ede975d
fix typo
drewstaylor 96473bf
clarify instruction
drewstaylor f55adeb
simplify instruction
drewstaylor f2c6c8b
Update releases/sui/2025-07-ITS-0.0.0-snapshot.a9aee72.md
drewstaylor c2fd177
Update releases/sui/2025-07-ITS-0.0.0-snapshot.a9aee72.md
drewstaylor cbdf8e1
normalize command syntax style
drewstaylor 97a31e9
Updated release documentation
drewstaylor ae552c4
Merge branch 'main' into fix/update-sui-release-doc
drewstaylor eaf46e5
improved instructions for custom token linking test
drewstaylor 12788a5
improved instructions for custom token linking test
drewstaylor 362c0eb
fix typos and streamline command syntax in instructions
drewstaylor 3800d92
Remove redundant section that would test the same flow
drewstaylor f3b36f0
Merge branch 'main' into fix/update-sui-release-doc
drewstaylor bd360ed
rename release doc to next minor version
drewstaylor e1fc6d6
fix: snapshot on release doc
blockchainguyy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,235 @@ | ||
# Sui ITS 0.0.0-snapshot.a9aee72 | ||
|
||
| | **Owner** | | ||
|----------------|----------------------------------------| | ||
| **Created By** | @drewstaylor <[email protected]> | | ||
| **Deployment** | @blockchainguyy <[email protected]> | | ||
|
||
| **Network** | **Deployment Status** | **Date** | | ||
|----------------------|-----------------------|----------| | ||
| **Devnet Amplifier** | TBD | TBD | | ||
| **Stagenet** | TBD | TBD | | ||
| **Testnet** | TBD | TBD | | ||
| **Mainnet** | TBD | TBD | | ||
|
||
[Release](https://www.npmjs.com/package/@axelar-network/axelar-cgp-sui/v/0.0.0-snapshot.a9aee72) | ||
|
||
## Deployment | ||
|
||
```bash | ||
# Clone latest main and update deps | ||
npm ci && npm run build | ||
``` | ||
|
||
Create a `.env` config. Use `all` for `CHAINS` to run the cmd for every EVM chain, or set a specific chain. On `devnet-amplifier` chain name will be set to `sui-2`. | ||
|
||
```yaml | ||
PRIVATE_KEY=<sui-deployer-key> | ||
PRIVATE_KEY_TYPE="mnemonic" # Optional | ||
SIGNATURE_SCHEME=secp256k1 | ||
ENV=<devnet-amplifier|stagenet|testnet|mainnet> | ||
CHAIN=sui | ||
``` | ||
|
||
### ITS Contract Admin & Roles | ||
|
||
Many of the below commands require either Owner or Operator privileges on the ITS contract. | ||
|
||
#### OwnerCap | ||
|
||
Some commands require a wallet that owns the contract's admin capability (`OwnerCap`). By default, this will be the address that deployed the ITS v0 contract. | ||
|
||
The commands requiring this capability are: | ||
* [Upgrading the ITS move contract][] | ||
* [Enabling the Upgrade][] | ||
* [Disabling the Legacy Contract][] | ||
|
||
#### OperatorCap | ||
|
||
Migrating legacy coin metadata requires a `OperatorCap` capability. This is any address added as an operator for the affected coin. By default, the address that deployed and initialized the ITS v0 contract possesses a `OperatorCap`. | ||
|
||
The commands requiring this capability are: | ||
* [Migrating Legacy Tokens][] | ||
|
||
### Fetching Legacy Tokens | ||
|
||
To fix the issue of some tokens not displaying correctly in wallets, we need to fetch the affected tokens. This list can be fetched before, or after the upgrade. | ||
|
||
```bash | ||
# Save legacy tokens for later migration | ||
ts-node sui/tokens legacy-coins | ||
``` | ||
|
||
### Upgrading the ITS move contract ### | ||
|
||
1. Update the release dependency in `package.json` | ||
|
||
```diff | ||
- "@axelar-network/axelar-cgp-sui": "1.1.3", | ||
+ "@axelar-network/axelar-cgp-sui": "0.0.0-snapshot.a9aee72", | ||
``` | ||
|
||
and run | ||
```bash | ||
npm i | ||
``` | ||
|
||
2. Update the move contracts locally | ||
|
||
```bash | ||
node sui/deploy-contract sync | ||
``` | ||
3. Do the upgrade tx | ||
|
||
```bash | ||
# Upgrade InterchainTokenService v0 -> v1 | ||
ts-node sui/deploy-contract upgrade InterchainTokenService any_upgrade | ||
``` | ||
|
||
### Enabling the Upgrade ### | ||
|
||
Migrate version control state to enable the upgrade. | ||
|
||
```bash | ||
ts-node sui/deploy-contract migrate InterchainTokenService | ||
``` | ||
|
||
## Checklist | ||
|
||
The following post-upgrade tasks should be performed after the rollout | ||
|
||
- [ ] Disable the legacy ITS contract | ||
- [ ] Verify Version Control state (v0 and v1) | ||
- [ ] Re-deploy Example contract | ||
- [ ] Fetch metadata of legacy coins (if not already fetched) | ||
- [ ] Migrate metadata of legacy coins | ||
- [ ] Test ITS token deployment and transfers | ||
- [ ] Test custom token linking | ||
|
||
### Disabling the Legacy Contract ### | ||
|
||
```bash | ||
# Disallow all functions in the legacy ITS package | ||
ts-node sui/contract pause --functions "all" --version "0" InterchainTokenService | ||
``` | ||
|
||
### Verify Version Control State | ||
|
||
1. All functions should be enabled on v1 | ||
|
||
```bash | ||
ts-node sui/its check-version-control 1 | ||
``` | ||
|
||
2. Only `allow_function` and `disallow_function` should be enabled on v0 | ||
|
||
```bash | ||
ts-node sui/its check-version-control 0 | ||
``` | ||
|
||
### Re-deploy Example contract | ||
|
||
Manually Configure Move.toml and Lock File of the `InterchainTokenService` package | ||
|
||
Edit `./sui/move/interchain_token_service/Move.toml` with the following changes: | ||
|
||
1. Remove the published at field | ||
```diff | ||
- published-at = "..." | ||
``` | ||
|
||
2. Update the package address in the `addresses` block: | ||
|
||
```diff | ||
[addresses] | ||
- interchain_token_service = "0x..." | ||
+ interchain_token_service = "0x0" | ||
``` | ||
|
||
Edit `./sui/move/interchain_token_service/Move.lock` with the following changes: | ||
|
||
1. Append the following blocks to the Lock file: | ||
|
||
```diff | ||
+ | ||
+ [env] | ||
+ | ||
+ [env.testnet] | ||
+ chain-id = "4c78adac" | ||
+ original-published-id = "..." | ||
+ latest-published-id = "..." | ||
+ published-version = "2" | ||
drewstaylor marked this conversation as resolved.
Show resolved
Hide resolved
|
||
``` | ||
|
||
2. Ensure the value of `original-published-id` matches the value of `chains.sui.contracts.InterchainTokenService.versions["0"]`, and the value of `latest-published-id` matches the value of `chains.sui.contracts.InterchainTokenService.address`, in the contracts config. | ||
|
||
Now, you can re-deploy the Example contract: | ||
|
||
```bash | ||
ts-node sui/deploy-contract deploy Example | ||
``` | ||
|
||
### Migrating Legacy Tokens | ||
|
||
```bash | ||
# Migrate legacy tokens in batches of 10 coins per tx | ||
ts-node sui/its migrate-coin-metadata-all --batch 10 | ||
# Or | ||
# Migrate legacy tokens in batches of 10, with verbose logging | ||
ts-node sui/its migrate-coin-metadata-all --batch 10 --logging 10 | ||
``` | ||
|
||
### Test ITS token deployment and transfers | ||
|
||
Test Sui Token Deployment using either lock / unlock or mint / burn token manager | ||
|
||
```bash | ||
# Register token with manager type: lock / unlock | ||
ts-node sui/its-example deploy-token --origin TST "Test Token" 6 | ||
``` | ||
```bash | ||
# Register token with manager type: mint / burn | ||
ts-node sui/its-example deploy-token --tokenManagerMode "mint_burn" --origin TST "Test Token" 6 | ||
``` | ||
|
||
Testing Sui <-> EVM transfers | ||
|
||
1. Send Token Deployment to `<ChainName>` | ||
```bash | ||
ts-node sui/its-example send-deployment TST $CHAIN [gas-value] | ||
drewstaylor marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
``` | ||
|
||
2. Send Token to EVM `<ChainName>` | ||
```bash | ||
ts-node sui/its-example send-token TST $CHAIN [destination-address] [gas-value] 1 | ||
drewstaylor marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
``` | ||
|
||
3. Send token back to sui from EVM `<ChainName>` | ||
```bash | ||
ts-node evm/its interchain-transfer sui [token-id] [recipient] 1 --gasValue [gas-value] -n $CHAIN | ||
drewstaylor marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
``` | ||
|
||
Testing Sui <-> Stellar deployment and transfers: | ||
|
||
1. Deploy token to stellar from `<ChainName>` | ||
```bash | ||
ts-node evm/interchainTokenFactory --action deployRemoteInterchainToken --destinationChain stellar --salt "salt1234" --gasValue [gas-value] -y -n $CHAIN | ||
``` | ||
|
||
2. Transfer token to stellar | ||
```bash | ||
ts-node evm/its interchain-transfer stellar [token-id] [recipient] 1 --gasValue [gas-value] -n $CHAIN | ||
``` | ||
|
||
3. Transfer token back from stellar | ||
```bash | ||
ts-node stellar/its interchain-transfer [token-id] $CHAIN [destination-address] 1 --gas-amount [gas-amount] | ||
``` | ||
|
||
### Test custom token linking | ||
|
||
Deploy a custom token and link it. | ||
|
||
```bash | ||
ts-node sui/its link-coin LINK "Custom link coin" 10 ethereum-sepolia 0x3fc29836e84e471a053d2d9e80494a867d670ead | ||
``` | ||
drewstaylor marked this conversation as resolved.
Show resolved
Hide resolved
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.