diff --git a/axelar-chains-config/info/devnet-amplifier.json b/axelar-chains-config/info/devnet-amplifier.json index 8b13c4832..087a4b3e5 100644 --- a/axelar-chains-config/info/devnet-amplifier.json +++ b/axelar-chains-config/info/devnet-amplifier.json @@ -1434,7 +1434,37 @@ "address": "0xEf0Bd4b5FBa26eC06D7827f4526Bc70Ee6614a81" } } - } + }, + "ton2": { + "name": "TON", + "axelarId": "ton2", + "rpc": "https://testnet.toncenter.com/api/v3", + "tokenSymbol": "TON", + "decimals": 9, + "explorer": { + "name": "tonscan", + "url": "https://testnet.tonscan.org" + }, + "contracts": { + "AxelarGateway": { + "deployer": "0:e1e633eb701b118b44297716cee7069ee847b56db88c497efea681ed14b2d2c7", + "address": "0:294d72ec421b930c60854f413478c162fdceec65746084ebace25227182979a2", + "implementationCodehash": "0xe7919cecb61a2a6382cfe0b09cf85bd432399e38a6d1367a816156c082baf5b5" + }, + "AxelarGasService": { + "collector": "0:903d58430732c1c0896df0cb4384fc08ac035f347d994275f4712be1083e0395", + "address": "0:5c7ce881e1217bdef1059b589cb9fde8a9a1478f56cd420c6fc072a4c408888f", + "implementationCodehash": "0x350d8fff90a94b80d65f75a065a40042d8cb6592f3ed73b507ee9d91dead620c", + "deployer": "0:e1e633eb701b118b44297716cee7069ee847b56db88c497efea681ed14b2d2c7" + }, + "InterchainTokenService": { + "deployer": "0:5ce8d72d353e3073ef1ec1e224368d497127b334af4b02b47f94cc0c5eaa2aff", + "implementationCodehash": "0x044004d6900727dca0ab7dd00b5780585bbe0aa278e93cf2b92562da756fa3fb", + "address": "0:dd53a319657fd060ee113d331a3c9f64154757db8ef8cf6cb146f0ee8675d9bf", + "msg_translator": "axelar13kj7wfmy42wwa6cxrlf6ahpkud0772x6fpct4y8myknjnan4khcqqqlwt7" + } + } + } }, "axelar": { "contracts": { @@ -1525,6 +1555,10 @@ "maxUintBits": 64, "maxDecimalsWhenTruncating": 255 }, + "ton2": { + "maxUintBits": 256, + "maxDecimalsWhenTruncating": 255 + }, "storeCodeProposalId": "989", "storeCodeProposalCodeHash": "ba46bfa2daa4f5d8ac77f456aecafb63a2e13c7a7965fa5c3e2af05dbd865e97", "lastUploadedCodeId": 1406 @@ -1684,6 +1718,38 @@ "storeCodeProposalId": "1005", "storeCodeProposalCodeHash": "52af1024c7548a724ec97728a1748bd1ce4ccb80bfb5c2a0ed7e57ee5ce5275c" }, + "TonVotingVerifier": { + "lastUploadedCodeId": 1428, + "storeCodeProposalCodeHash": "ccecb5e036be2d6156a4e19f4bc4e222923a2fa829d05a6aaf2b4027004e4c13", + "ton2": { + "codeId": 1428, + "address": "axelar1pc2j76m3g7ef6tv84wh89thse9z2eltxettpp00nxvj68dl52t0q0wlvqr", + "governanceAddress": "axelar1zlr7e5qf3sz7yf890rkh9tcnu87234k6k7ytd9", + "adminAddress": "axelar1fgg7mer9ljjj94jzxeha3svg8u3kp8sxqzygh7", + "serviceName": "validators", + "sourceGatewayAddress": "0:294d72ec421b930c60854f413478c162fdceec65746084ebace25227182979a2", + "votingThreshold": ["2", "2"], + "msgIdFormat": "hex_tx_hash", + "addressFormat": "ton" + }, + "storeCodeProposalId": "0" + }, + "TonMultisigProver": { + "lastUploadedCodeId": 1500, + "storeCodeProposalCodeHash": "bf0e3c4466e5b88db34b5d02fbd58b9cb62353c6171dd58f5da46be48ba4f59a", + "ton2": { + "codeId": 1500, + "address": "axelar1pdk92hqcy38cwyktph59a0hsvv4f35naspn5ggrvpf8ve7zf3wuqqk0q56", + "governanceAddress": "axelar1zlr7e5qf3sz7yf890rkh9tcnu87234k6k7ytd9", + "adminAddress": "axelar1fgg7mer9ljjj94jzxeha3svg8u3kp8sxqzygh7", + "signingThreshold": ["1", "1"], + "serviceName": "validators", + "verifierSetDiffThreshold": 0, + "encoder": "ton", + "keyType": "ed25519" + }, + "storeCodeProposalId": "0" + }, "Gateway": { "avalanche-fuji": { "codeId": 848, @@ -1731,6 +1797,10 @@ "hedera-2": { "codeId": 848, "address": "axelar1ldaas8zj0u9vmnss09nx7v6j6nvw2ntxwc98m8kpzrv5zezdesxslyl4p2" + }, + "ton2": { + "codeId": 1349, + "address": "axelar1qr2e4l4ap6wef7gdd5de9sr3hvzgw46ctp2e0axd598alt6nu6aqusaaw3" } }, "XrplMultisigProver": { @@ -1749,6 +1819,9 @@ } }, "MultisigProver": { + "ton2": { + "address": "axelar1pdk92hqcy38cwyktph59a0hsvv4f35naspn5ggrvpf8ve7zf3wuqqk0q56" + }, "avalanche-fuji": { "governanceAddress": "axelar1zlr7e5qf3sz7yf890rkh9tcnu87234k6k7ytd9", "adminAddress": "axelar1zlr7e5qf3sz7yf890rkh9tcnu87234k6k7ytd9", diff --git a/cosmwasm/utils.js b/cosmwasm/utils.js index 1fb77c8e0..1c060f789 100644 --- a/cosmwasm/utils.js +++ b/cosmwasm/utils.js @@ -1185,6 +1185,10 @@ const CONTRACTS = { scope: CONTRACT_SCOPE_CHAIN, makeInstantiateMsg: makeVotingVerifierInstantiateMsg, }, + TonVotingVerifier: { + scope: CONTRACT_SCOPE_CHAIN, + makeInstantiateMsg: makeVotingVerifierInstantiateMsg, + }, XrplVotingVerifier: { scope: CONTRACT_SCOPE_CHAIN, makeInstantiateMsg: makeXrplVotingVerifierInstantiateMsg, @@ -1205,6 +1209,10 @@ const CONTRACTS = { scope: CONTRACT_SCOPE_CHAIN, makeInstantiateMsg: makeMultisigProverInstantiateMsg, }, + TonMultisigProver: { + scope: CONTRACT_SCOPE_CHAIN, + makeInstantiateMsg: makeMultisigProverInstantiateMsg, + }, XrplMultisigProver: { scope: CONTRACT_SCOPE_CHAIN, makeInstantiateMsg: makeXrplMultisigProverInstantiateMsg, diff --git a/releases/cosmwasm/2025-07-TON-v1.0.0.md b/releases/cosmwasm/2025-07-TON-v1.0.0.md new file mode 100644 index 000000000..da33b1a64 --- /dev/null +++ b/releases/cosmwasm/2025-07-TON-v1.0.0.md @@ -0,0 +1,438 @@ +# TON GMP Amplifier + +| | **Owner** | +| -------------- | ------------------------------------ | +| **Created By** | @dfapel | +| **Deployment** | @makischristou | + +| **Network** | **Deployment Status** | **Date** | +| -------------------- | --------------------- | ---------- | +| **Devnet Amplifier** | Completed | 2025-07-01 | +| **Stagenet** | - | TBD | +| **Testnet** | - | TBD | +| **Mainnet** | - | TBD | + +- [Amplifier Releases](https://github.com/axelarnetwork/axelar-amplifier/releases) +- [TonVotingVerifier v1.0.0](https://github.com/commonprefix/axelar-amplifier/releases/tag/ton-voting-verifier-v1.0.0) +- [Gateway v1.1.1](https://github.com/axelarnetwork/axelar-amplifier/releases/tag/gateway-v1.1.1) +- [TonMultisigProver v1.0.0](https://github.com/axelarnetwork/axelar-amplifier/releases/tag/ton-multisig-prover-v1.0.0) + +## Background + +These are the instructions for deploying Amplifier contracts for TON connection. + +### Pre-requisites + +Ensure that the [External Gateway](../ton/2025-07-GMP-v1.0.0.md) is deployed first, as `TonVotingVerifier` needs the `sourceGatewayAddress` which is the External Gateway address. + +## Deployment + +- Create an `.env` config. `CHAIN` is set to `ton2` for Devnet Amplifier and should be `ton` on all other networks. `ENV` is either `devnet-amplifier`, `stagenet`, `testnet` or `mainnet`. + +```yaml +MNEMONIC=xyz +ENV=xyz +CHAIN=xyz +RELEASES_BASE_URL=https://pub-7233af746dc8432f8d9547af0133309d.r2.dev +ARTIFACT_PATH=wasm +``` + +- Confirm `Gateway(v1.1.1)` contract is already stored in `$ENV.json` + +```bash +Gateway(v1.1.1) -> "storeCodeProposalCodeHash": "2ba600ee0d162184c9387eaf6fad655f1d75db548f93e379f0565cb2042d856f" +``` + +### Store Amplifier contracts + +1. Download the TON CosmWasm smart contracts' wasm bytecode. + +```bash +mkdir $ARTIFACT_PATH +wget $RELEASES_BASE_URL/releases/cosmwasm/ton-voting-verifier/1.0.0/ton_voting_verifier.wasm --directory-prefix=$ARTIFACT_PATH +wget $RELEASES_BASE_URL/releases/cosmwasm/ton-multisig-prover/1.0.0/ton_multisig_prover.wasm --directory-prefix=$ARTIFACT_PATH +``` + +2. Download and verify checksum. + +```bash +wget -O checksums.txt $RELEASES_BASE_URL/releases/cosmwasm/ton-voting-verifier/1.0.0/checksums.txt +CHECKSUM=$(cat checksums.txt | grep voting_verifier.wasm | awk '{print $1}') +shasum -a 256 $ARTIFACT_PATH/ton_voting_verifier.wasm | grep $CHECKSUM + +wget -O checksums.txt $RELEASES_BASE_URL/releases/cosmwasm/ton-multisig-prover/1.0.0/checksums.txt +CHECKSUM=$(cat checksums.txt | grep multisig_prover.wasm | awk '{print $1}') +shasum -a 256 $ARTIFACT_PATH/ton_multisig_prover.wasm | grep $CHECKSUM +``` + +3. Make sure your output matches with the following expected output before proceeding. + +``` +c032a01481ecc3250fa359b14b6a12cfa84f1ec3ce7f788b3975bb9767827240 wasm/ton_voting_verifier.wasm +9905f6358854c2b243edcae4bf4529109ace9c0e1897353ebeda4f977b03a982 wasm/ton_multisig_prover.wasm +``` + +- Add `TonVotingVerifier` and `TonMultisigProver` contract to `$ENV.json`. +```bash +# Add under `config.axelar.contracts` +"TonVotingVerifier": {}, +"TonMultisigProver": {} +``` + +4. Add `INIT_ADDRESSES` to `.env`. + +| Network | `INIT_ADDRESSES` | +| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | +| **Devnet-amplifier** | `axelar10d07y265gmmuvt4z0w9aw880jnsr700j7v9daj,axelar1zlr7e5qf3sz7yf890rkh9tcnu87234k6k7ytd9` | +| **Stagenet** | `axelar1pumrull7z8y5kc9q4azfrmcaxd8w0779kg6anm,axelar10d07y265gmmuvt4z0w9aw880jnsr700j7v9daj,axelar12qvsvse32cjyw60ztysd3v655aj5urqeup82ky` | +| **Testnet** | `axelar1uk66drc8t9hwnddnejjp92t22plup0xd036uc2,axelar10d07y265gmmuvt4z0w9aw880jnsr700j7v9daj,axelar12f2qn005d4vl03ssjq07quz6cja72w5ukuchv7` | +| **Mainnet** | `axelar1uk66drc8t9hwnddnejjp92t22plup0xd036uc2,axelar10d07y265gmmuvt4z0w9aw880jnsr700j7v9daj,axelar1nctnr9x0qexemeld5w7w752rmqdsqqv92dw9am` | + +- Gov proposal environment variables. Update these for each network + +| Network | `PROVER_ADMIN` | `DEPOSIT_VALUE` | `REWARD_AMOUNT` | `RUN_AS_ACCOUNT` | +| -------------------- | ----------------------------------------------- | --------------- | ------------------- | ----------------------------------------------- | +| **Devnet-amplifier** | `axelar1zlr7e5qf3sz7yf890rkh9tcnu87234k6k7ytd9` | `100000000` | `1000000uamplifier` | `axelar1zlr7e5qf3sz7yf890rkh9tcnu87234k6k7ytd9` | +| **Stagenet** | `axelar1l7vz4m5g92kvga050vk9ycjynywdlk4zhs07dv` | `100000000` | `1000000uaxl` | `axelar10d07y265gmmuvt4z0w9aw880jnsr700j7v9daj` | +| **Testnet** | `axelar17qafmnc4hrfa96cq37wg5l68sxh354pj6eky35` | `2000000000` | `1000000uaxl` | `axelar10d07y265gmmuvt4z0w9aw880jnsr700j7v9daj` | +| **Mainnet** | `axelar1pczf792wf3p3xssk4dmwfxrh6hcqnrjp70danj` | `2000000000` | `1000000uaxl` | `axelar10d07y265gmmuvt4z0w9aw880jnsr700j7v9daj` | + +```bash +PROVER_ADMIN=[prover admin who is responsible for the contract's operations] +DEPOSIT_VALUE=[deposit value] +REWARD_AMOUNT=[reward amount] +RUN_AS_ACCOUNT=[wasm deployer/governance address] +``` + +> **_NOTE:_** +> Set `RUN_AS_ACCOUNT` to an EOA account's address instead of the governance address to avoid having to instantiate the contracts via another governance proposal. + +- Store `TonVotingVerifier` + +```bash +ts-node cosmwasm/submit-proposal.js store \ + -c TonVotingVerifier \ + -t "Upload TonVotingVerifier contract v1.0.0" \ + -d "Upload TonVotingVerifier contract v1.0.0" \ + -a "$ARTIFACT_PATH/ton_voting_verifier.wasm" \ + --deposit $DEPOSIT_VALUE \ + --instantiateAddresses $INIT_ADDRESSES +``` + +- Store `TonMultisigProver` + +```bash +ts-node cosmwasm/submit-proposal.js store \ + -c TonMultisigProver \ + -t "Upload TonMultisigProver contract v1.0.0" \ + -d "Upload TonMultisigProver contract v1.0.0" \ + -a "$ARTIFACT_PATH/ton_multisig_prover.wasm" \ + --deposit $DEPOSIT_VALUE \ + --instantiateAddresses $INIT_ADDRESSES +``` + +- Add config in `$ENV.json` to deploy Amplifier contracts. + +| Network | `governanceAddress` | `adminAddress` | +| -------------------- | ----------------------------------------------- | ----------------------------------------------- | +| **Devnet-amplifier** | `axelar1zlr7e5qf3sz7yf890rkh9tcnu87234k6k7ytd9` | `axelar1zlr7e5qf3sz7yf890rkh9tcnu87234k6k7ytd9` | +| **Stagenet** | `axelar10d07y265gmmuvt4z0w9aw880jnsr700j7v9daj` | `axelar1l7vz4m5g92kvga050vk9ycjynywdlk4zhs07dv` | +| **Testnet** | `axelar10d07y265gmmuvt4z0w9aw880jnsr700j7v9daj` | `axelar17qafmnc4hrfa96cq37wg5l68sxh354pj6eky35` | +| **Mainnet** | `axelar10d07y265gmmuvt4z0w9aw880jnsr700j7v9daj` | `axelar1pczf792wf3p3xssk4dmwfxrh6hcqnrjp70danj` | + +| Network | `serviceName` | `votingThreshold` | `signingThreshold` | +| -------------------- | ------------- | ----------------- | ------------------ | +| **Devnet-amplifier** | `validators` | `["6", "10"]` | `["6", "10"]` | +| **Stagenet** | `amplifier` | `["51", "100"]` | `["51", "100"]` | +| **Testnet** | `amplifier` | `["51", "100"]` | `["51", "100"]` | +| **Mainnet** | `amplifier` | `["2", "3"]` | `["2", "3"]` | + +```bash +GOVERNANCE_ADDRESS= +SERVICE_NAME= +SOURCE_GATEWAY_ADDRESS=[the address of the TON edge gateway] +VOTING_THRESHOLD= +ADMIN_ADDRESS= +``` + +Add under `config.axelar.contracts.TonVotingVerifier` based on Network: +```bash +\"$CHAIN\" : { + "governanceAddress": "$GOVERNANCE_ADDRESS", + "serviceName": "$SERVICE_NAME", + "sourceGatewayAddress": "$SOURCE_GATEWAY_ADDRESS", + "votingThreshold": "$VOTING_THRESHOLD", + "msgIdFormat": "hex_tx_hash", + "addressFormat": "ton" +} +``` + +Add under `config.axelar.contracts.TonMultisigProver` based on Network +```bash +\"$CHAIN\" : { + "governanceAddress": "$GOVERNANCE_ADDRESS", + "adminAddress": "$ADMIN_ADDRESS", + "signingThreshold": "$SIGNING_THRESHOLD", + "serviceName": "$SERVICE_NAME", + "verifierSetDiffThreshold": 0, + "encoder": "ton", + "keyType": "ed25519" +} +``` + +### Instantiate Amplifier contracts + +| Network | `CONTRACT_ADMIN` | +| -------------------- | ----------------------------------------------- | +| **Devnet-amplifier** | `axelar1zlr7e5qf3sz7yf890rkh9tcnu87234k6k7ytd9` | +| **Stagenet** | `axelar12qvsvse32cjyw60ztysd3v655aj5urqeup82ky` | +| **Testnet** | `axelar12f2qn005d4vl03ssjq07quz6cja72w5ukuchv7` | +| **Mainnet** | `axelar1nctnr9x0qexemeld5w7w752rmqdsqqv92dw9am` | + +```bash +CONTRACT_ADMIN=[wasm contract admin address for the upgrade and migration based on network] +``` + +1. Instantiate `VotingVerifier` + +```bash +ts-node ./cosmwasm/deploy-contract.js instantiate -c TonVotingVerifier --fetchCodeId --instantiate2 --admin $CONTRACT_ADMIN +``` + +2. Instantiate `Gateway` + +```bash +ts-node ./cosmwasm/deploy-contract.js instantiate -c Gateway --fetchCodeId --instantiate2 --admin $CONTRACT_ADMIN +``` + +3. Instantiate `MultisigProver` + +```bash +ts-node ./cosmwasm/deploy-contract.js instantiate -c TonMultisigProver --fetchCodeId --instantiate2 --admin $CONTRACT_ADMIN +``` + +**Note**: +Additionally add the address of the instantiated TonMultisigProver to `config.axelar.contracts.MultisigProver` as well to allow to use the canonical cosmwasm scripts (e.g., signer rotation). + +4. Set environment variables + +- Network-specific environment variables: These variables need to be updated by the network. + +```bash +VOTING_VERIFIER=$(cat "./axelar-chains-config/info/$ENV.json" | jq ".axelar.contracts.TonVotingVerifier[\"$CHAIN\"].address" | tr -d '"') +GATEWAY=$(cat "./axelar-chains-config/info/$ENV.json" | jq ".axelar.contracts.Gateway[\"$CHAIN\"].address" | tr -d '"') +MULTISIG_PROVER=$(cat "./axelar-chains-config/info/$ENV.json" | jq ".axelar.contracts.TonMultisigProver[\"$CHAIN\"].address" | tr -d '"') +MULTISIG=$(cat "./axelar-chains-config/info/$ENV.json" | jq ".axelar.contracts.Multisig.address" | tr -d '"') +REWARDS=$(cat "./axelar-chains-config/info/$ENV.json" | jq ".axelar.contracts.Rewards.address" | tr -d '"') +ROUTER=$(cat "./axelar-chains-config/info/$ENV.json" | jq ".axelar.contracts.Router.address" | tr -d '"') +``` + +5. Register TON Gateway at the Router + +```bash +ts-node cosmwasm/submit-proposal.js execute \ + -c Router \ + -t "Register Gateway for TON" \ + -d "Register Gateway address for TON at Router contract" \ + --runAs $RUN_AS_ACCOUNT \ + --deposit $DEPOSIT_VALUE \ + --msg "{ + \"register_chain\": { + \"chain\": \"$CHAIN\", + \"gateway_address\": \"$GATEWAY\", + \"msg_id_format\": \"hex_tx_hash\" + } + }" +``` + +- Approve Proposal (must be done within 5 minutes on devnet-amplifier/stagenet and 1 hour on testnet/mainnet) + +- Verify Gateway Registration: + +```bash +axelard q wasm contract-state smart $ROUTER "{\"chain_info\": \"$CHAIN\"}" --output json --node [axelar rpc address] | jq . +``` + +```bash +# You should see something like this: +{ + "data": { + "name": "ton2", + "gateway": { + "address": "axelar1qr2e4l4ap6wef7gdd5de9sr3hvzgw46ctp2e0axd598alt6nu6aqusaaw3" + }, + "frozen_status": 0, + "msg_id_format": "hex_tx_hash" + } +} +``` + +6. Register prover contract on coordinator + +```bash +ts-node cosmwasm/submit-proposal.js execute \ + -c Coordinator \ + -t "Register Multisig Prover for TON" \ + -d "Register Multisig Prover address for $CHAIN at Coordinator contract" \ + --runAs $RUN_AS_ACCOUNT \ + --deposit $DEPOSIT_VALUE \ + --msg "{ + \"register_prover_contract\": { + \"chain_name\": \"$CHAIN\", + \"new_prover_addr\": \"$MULTISIG_PROVER\" + } + }" +``` + +7. Authorize TON Multisig prover on Multisig + +```bash +ts-node cosmwasm/submit-proposal.js execute \ + -c Multisig \ + -t "Authorize Multisig Prover for TON" \ + -d "Authorize Multisig Prover address for $CHAIN at Multisig contract" \ + --runAs $RUN_AS_ACCOUNT \ + --deposit $DEPOSIT_VALUE \ + --msg "{ + \"authorize_callers\": { + \"contracts\": { + \"$MULTISIG_PROVER\": \"$CHAIN\" + } + } + }" +``` + +```bash +axelard q wasm contract-state smart $MULTISIG "{\"is_caller_authorized\": {\"contract_address\": \"$MULTISIG_PROVER\", \"chain_name\": \"$CHAIN\"}}" --output json --node [axelar rpc address] --chain-id $ENV | jq . + +# Result should look like: +{ + "data": true +} +``` + +8. Create reward pool for voting verifier + +#### Rewards + +| Network | `epoch_duration` | `participation_threshold` | `rewards_per_epoch` | +| -------------------- | ---------------- | ------------------------- | ------------------- | +| **Devnet-amplifier** | `100` | `["7", "10"]` | `100` | +| **Stagenet** | `600` | `["7", "10"]` | `100` | +| **Testnet** | `14845` | `["7", "10"]` | `100` | +| **Mainnet** | `14845` | `["8", "10"]` | `1260000000` | + +```bash +EPOCH_DURATION= +PARTICIPATION_THRESHOLD= +REWARDS_PER_EPOCH= +``` + +```bash +ts-node cosmwasm/submit-proposal.js execute \ + -c Rewards \ + -t "Create pool for TON in $CHAIN voting verifier" \ + -d "Create pool for TON in $CHAIN voting verifier" \ + --runAs $RUN_AS_ACCOUNT \ + --deposit $DEPOSIT_VALUE \ + --msg "{ + \"create_pool\": { + \"params\": { + \"epoch_duration\": \"$EPOCH_DURATION\", + \"participation_threshold\": $PARTICIPATION_THRESHOLD, + \"rewards_per_epoch\": \"$REWARDS_PER_EPOCH\" + }, + \"pool_id\": { + \"chain_name\": \"$CHAIN\", + \"contract\": \"$VOTING_VERIFIER\" + } + } + }" +``` + +9. Create reward pool for multisig + +```bash +ts-node cosmwasm/submit-proposal.js execute \ + -c Rewards \ + -t "Create pool for TON in $CHAIN multisig" \ + -d "Create pool for TON in $CHAIN multisig" \ + --runAs $RUN_AS_ACCOUNT \ + --deposit $DEPOSIT_VALUE \ + --msg "{ + \"create_pool\": { + \"params\": { + \"epoch_duration\": \"$EPOCH_DURATION\", + \"participation_threshold\": [$PARTICIPATION_THRESHOLD], + \"rewards_per_epoch\": \"$REWARDS_PER_EPOCH\" + }, + \"pool_id\": { + \"chain_name\": \"$CHAIN\", + \"contract\": \"$MULTISIG\" + } + } + }" +``` + +10. Update ampd config file with the TON chain configuration. Verifiers should use their own TON RPC node for the `rpc_url` in production. + +| Network | `rpc_url` | +| -------------------- | -------------------------------------- | +| **Devnet-amplifier** | `https://testnet.toncenter.com/api/v3` | +| **Stagenet** | `https://testnet.toncenter.com/api/v3` | +| **Testnet** | `https://testnet.toncenter.com/api/v3` | +| **Mainnet** | `https://toncenter.com/api/v3` | + +```bash +RPC_URL= +``` + +```toml +[[handlers]] +type="TonMsgVerifier" +rpc_url="$RPC_URL" +cosmwasm_contract="$VOTING_VERIFIER" + +[[handlers]] +type="TonVerifierSetVerifier" +rpc_url="$RPC_URL" +cosmwasm_contract="$VOTING_VERIFIER" + +[[handlers]] +type="MultisigSigner" +chain_name="$CHAIN" +cosmwasm_contract="$MULTISIG" +``` + +11. Register chain support for + +```bash +ampd register-public-key ed25519 + +ampd register-chain-support $SERVICE_NAME $CHAIN +``` + +12. Add funds to reward pools from a wallet containing the reward funds `$REWARD_AMOUNT` + +```bash +axelard tx wasm execute $REWARDS "{ \"add_rewards\": { \"pool_id\": { \"chain_name\": \"$CHAIN\", \"contract\": \"$MULTISIG\" } } }" --amount $REWARD_AMOUNT --from $WALLET +axelard tx wasm execute $REWARDS "{ \"add_rewards\": { \"pool_id\": { \"chain_name\": \"$CHAIN\", \"contract\": \"$VOTING_VERIFIER\" } } }" --amount $REWARD_AMOUNT --from $WALLET + +# Check reward pool to confirm funding worked +ts-node cosmwasm/query.js rewards -n $CHAIN +``` + +13. Create genesis verifier set + +Note that this step can only be run once a sufficient number of verifiers have registered. + +```bash +axelard tx wasm execute $MULTISIG_PROVER '"update_verifier_set"' --from $PROVER_ADMIN --gas auto --gas-adjustment 1.2 + +# Query the multisig prover for active verifier set +axelard q wasm contract-state smart $MULTISIG_PROVER '"current_verifier_set"' +``` + +## Checklist + +The [TON GMP checklist](../ton/2025-07-GMP-v1.0.0.md) will test GMP call. diff --git a/releases/ton/2025-07-GMP-v1.0.0.md b/releases/ton/2025-07-GMP-v1.0.0.md new file mode 100644 index 000000000..f9fb2c90a --- /dev/null +++ b/releases/ton/2025-07-GMP-v1.0.0.md @@ -0,0 +1,178 @@ +# TON v1.0.0 + +| | **Owner** | +|-----------|------------| +| **Created By** | @makischristou | +| **Deployment** | @makischristou | + +| **Network** | **Deployment Status** | **Date** | +|-------------|----------------------|----------| +| **Devnet Amplifier** | Deployed | 2025-07-01 | +| **Stagenet** | - | TBD | +| **Testnet** | - | TBD | +| **Mainnet** | - | TBD | + +## Background + +This is the initial v1.0.0 release. + +## Deployment + +1. Clone the [axelar-gmp-sdk-ton](https://github.com/commonprefix/axelar-gmp-sdk-ton) repository: + +```bash +git clone git@github.com:commonprefix/axelar-gmp-sdk-ton.git +``` + +2. Install dependencies: + +```bash +npm i +``` + +3. Deploy AxelarGateway: + +Prerequisites: +- A funded testnet TON wallet. The easiest choice is to use [Tonkeeper](https://tonkeeper.com/) on a mobile device and fund it using the [testgiver](https://t.me/testgiver_ton_bot) testnet faucet. + +To deploy the AxelarGateway, we first need to choose a signer set to initialize it with. Create a new `signers.json` file in the root of the project and populate it with the initial signer set. For example: + +```json +{ + "signers": [ + { + "signer": "79607624103790023686192160900267678169386878801005916234280733090365959006096", + "weight": 1 + } + ], + "threshold": 1, + "nonce": 7336708 +} +``` + +Run the AxelarGateway deployment script: + +```bash +npx blueprint run +? Choose file to use (Use arrow keys) +? Choose file to use deployAxelarGateway +? Which network do you want to use? +? Which network do you want to use? testnet +? Which wallet are you using? (Use arrow keys) +? Which wallet are you using? TON Connect compatible mobile +wallet (example: Tonkeeper) +``` + +Choose `deployAxelarGateway`, then `testnet` and then `TON Connect compatible wallet`. Scan the QR code from Tonkeeper on your mobile device to connect it. Approve the 2 transactions on your Tonkeeper wallet (one is for deployment and one for signer initialization). + + +4. Deploy Governance: + +When deploying Governance, you will be prompted to provide 3 arguments. The first is the AxelarGateway address which we can use from the previous step. The governance needs this since it's an executable and should only allow execution commands from the trusted gateway. The gas for execution argument is a lower bound of gas (in nanoton) which needs to be sent to the governance contract when executing a proposal. Finally, we need to include an operator address who is able to run operator proposals without a timelock. + + +```bash +? Choose file to use +? Choose file to use deployGovernance +? Which network do you want to use? +? Which network do you want to use? testnet +? Which wallet are you using? (Use arrow keys) +? Which wallet are you using? TON Connect compatible mobile wallet (example: Tonkeeper) +Connected to wallet at address: +? AxelarGateway address +? Gas for execution +? Operator address +``` + +5. Deploy GasService: + +To deploy the GasService, follow the steps below. You will be prompted to provide the address of the gasCollector. + +```bash +npx blueprint run +? Choose file to use +? Choose file to use deployGasService +? Which network do you want to use? +? Which network do you want to use? testnet +? Which wallet are you using? (Use arrow keys) +? Which wallet are you using? TON Connect compatible mobile wallet (example: Tonkeeper) +Connected to wallet at address: +? GasCollector address +``` + +## Checklist +The following checks should be performed after the rollout: + +Required environment variables: + +``` +MNEMONIC= +TONCENTER_API_KEY= +TON_GATEWAY_ADDRESS= +TON_GAS_SERVICE_ADDRESS= +TON_GOVERNANCE_ADDRESS= +``` + +### Approving a message + +Run this with the hex encoded payload produced by the TON MultisigProver: + +```bash +node ton/approveMessages.js +``` + + +### Executing a message + +Run this to execute an approved message: + +```bash +node ton/relayerExecute.js +``` + + +### Sending a message from TON + +```bash +node ton/callContract.js +``` + + +### Post Deployment (Initialize Signers) + +```bash +node ton/initializeSigners.js +``` + +### Signer Rotation +In our design, signer rotation is a 2-step process. Thus, we need both the proof generated by the MultisigProver and the new signer config separately, as it is not included in that proof. You can get the signer config after rotating the signer set as described in step 13 in the [TON cosmwasm release doc](../cosmwasm/2025-07-TON-v1.0.0.md) by querying the multisig prover using + +```bash +axelard query wasm contract-state smart $MULTISIG_PROVER "{\"proof\":{\"multisig_session_id\":\"$SESSION_ID\"}}" --node $RPC --output json +``` + +```bash +node ton/signerRotation.js +``` + +Where `weighted-signers-json` would be in the format: + +```json +{ + "signers": [ + { + "signer": "79607624103790023686192160900267678169386878801005916234280733090365959006096", + "weight": "1" + } + ], + "threshold": "1", + "nonce": "0" +} +``` + +Note that the signer public keys need to be sorted. + +### Transfer Operatorship +```bash +node ton/transferOperatorship.js +``` diff --git a/releases/ton/2025-08-ITS-v1.0.0.md b/releases/ton/2025-08-ITS-v1.0.0.md new file mode 100644 index 000000000..8461c643d --- /dev/null +++ b/releases/ton/2025-08-ITS-v1.0.0.md @@ -0,0 +1,135 @@ +# TON ITS v1.0.0 + +| | **Owner** | +| -------------- | -------------------------------------- | +| **Created By** | @dfapel | +| **Deployment** | @makischristou | + +| **Network** | **Deployment Status** | **Date** | +| -------------------- | --------------------- | ---------- | +| **Devnet Amplifier** | Deployed | 2025-08-15 | +| **Stagenet** | - | TBD | +| **Testnet** | - | TBD | +| **Mainnet** | - | TBD | + +## Background + +This is the initial v1.0.0 release. + +## Deployment + +- Ensure that ITS Hub has been upgraded to [v1.3.0](../cosmwasm/2025-07-ITS-v1.3.0.md) first. +- The rollout involves deploying TON ITS contracts version `v1.0.` on TON. + +1. Clone the [axelar-gmp-sdk-ton](https://github.com/commonprefix/axelar-gmp-sdk-ton) repository: + +```bash +git clone git@github.com:commonprefix/axelar-gmp-sdk-ton.git +``` + +2. Install dependencies: + +```bash +npm i +``` + +3. Deploy InterchainTokenService: + +Prerequisites: +- A funded testnet TON wallet. The easiest choice is to use [Tonkeeper](https://tonkeeper.com/) on a mobile device and fund it using the [testgiver](https://t.me/testgiver_ton_bot) testnet faucet. +- [GMP](2025-07-GMP-v1.0.0.md) is already correctly set up. Let `TON_EDGE_GATEWAY` be the address of the deployed edge gateway. +- Follow the [README instructions](../ton/README.md) to setup the environment + +Let `ITS_OPERATOR` be the address of the intended ITS operator. +Run the DeployInterchainTokenService deployment script: + +```bash +npx blueprint run +? Choose file to use (Use arrow keys) +? Choose file to use deployInterchainTokenService +? Which network do you want to use? +? Which network do you want to use? testnet +? Which wallet are you using? (Use arrow keys) +? Which wallet are you using? TON Connect compatible mobile wallet (example: Tonkeeper) +? AxelarGateway address $TON_EDGE_GATEWAY +? Operator address $ITS_OPERATOR +wallet (example: Tonkeeper) +``` + +Choose `deployInterchainTokenService`, then `testnet` and then `TON Connect compatible wallet`. Scan the QR code from Tonkeeper on your mobile device to connect it. Approve the popup on your Tonkeeper wallet. + +### Register TON ITS on ITS Hub + +Note: TON ITS doesn't use a custom ITS ABI Translator. +ITS hub contract configuration in json file must include the following attributes per chain: + +```bash +"axelar": { + "contracts": { + ... + "InterchainTokenService": { + ... + "$CHAIN": { + "maxUintBits": 256, + "maxDecimalsWhenTruncating": 255 + } + } + ... + } +} +``` + +_Note: Mainnet proposal should include a community post for the Registering ITS_ + +deposit amount is one of: + +| Network | Deposit Amount | +| ---------------- | -------------- | +| devnet-amplifier | 100000000 | +| stagenet | 100000000 | +| testnet | 2000000000 | +| mainnet | 2000000000 | + +```bash +ts-node cosmwasm/submit-proposal.js its-hub-register-chains $CHAIN -t "Register ITS for TON chain" -d "Register ITS for TON chain at ITS Hub contract" --deposit $DEPOSIT_AMOUNT +``` + +### Set trusted chains on TON ITS + +To add a trusted chain to TON ITS, run this command: + +```bash +node ton/its.js add-trusted-chain +``` + +To remove a trusted chain from TON ITS, run this command: + +```bash +node ton/its.js remove-trusted-chain +``` + +### Trust TON on ITS edge contracts + +```bash +# For these commands, set PRIVATE KEY in .env to the private key for the ITS operator on EVM chains +node evm/its.js --action setTrustedAddress --trustedChain $CHAIN --trustedAddress hub --chainNames all +``` + +## Checklist + +The following checks should be performed after the rollout + +- [ ] Test ITS token deployment + +```bash +# Deploy Test Tokens +node ton/its.js deploy-interchain-token [minter] + +# Deploy Remote Interchain Token +node ton/its.js deploy-remote-interchain-token [remote-minter] + +# Perform Interchain Token Transfer (Outgoing) +node ton/its.js transfer-interchain-token + +# Test incoming Interchain Token Transfer +```