-
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(evm)!: support its v2 deployment #332
Conversation
@milapsheth Should we make it |
Yeah, would be a nice improvement. We should add a specific new action that sets the trusted address to |
This PR adds ITS hub support. ITS hub is deployed from this commit. It's linked to the
axelarnet-gateway
contract which is registered under the chain nameaxelarnet
.An EVM ITS v2 pre-release contract (with ITS Hub support) is deployed to Amplifier EVM chains. The relayer also has support for processing ITS hub calls.
See the setup and test sections to try sending ITS calls.
Setup Repo
npm ci
Deploy EVM ITS
To deploy your own ITS contracts on an EVM chain, run the following:
npm ci && npm run build && npm run test
PRIVATE_KEY=...
andENV=devnet-amplifier
in.env
package.json
in this repo to point to the local ITS path. For example:"@axelar-network/interchain-token-service": "file:../interchain-token-service",
npm install
node evm/deploy-its.js -s "v2.0.0rc2 devnet-amplifier" --proxySalt 'v2.0.0 devnet-amplifier' -m create2 -e devnet-amplifier -n [chain name]
node evm/its.js -n [chain] --action setTrustedAddress --trustedChain axelar
node evm/its.js -n [chain] --action setTrustedAddress --trustedChain [remote chain, e.g. avalanche-fuji, xrpl] --trustedAddress hub
Upgrade EVM ITS
npm install
again to point to the updated version.node evm/deploy-its.js -s "v2.0.0rc3 devnet-amplifier" -m create2 -n [chain name] --reuseProxy
node evm/deploy-its.js -n [chain name] --upgrade
Verify EVM ITS on explorer (optional)
keys.json
in this repo for your chain, and updating local ITS repo'shardhat.config.js
).devnet-amplifier.json
config for the chain has the API listed, example:node ./evm/verify-contract.js -c InterchainTokenService -d ../interchain-token-service/ -n [chain name]
Test
All registered ITS contracts on the ITS Hub can be queried via:
axelard q wasm contract-state smart axelar10jzzmv5m7da7dn2xsfac0yqe7zamy34uedx3e28laq0p6f3f8dzqp649fp '"all_its_addresses"' --node http://devnet-amplifier.axelar.dev:26657
Deploy Token
node ./evm/interchainTokenFactory.js -n avalanche-fuji --action deployInterchainToken --name 'Test' --symbol 'TEST' --decimals 6 -s [salt] --initialSupply 10000
tokenId
of the deployed token is printed in the outputsalt
as the above when deploying the same token to remote chains:node ./evm/interchainTokenFactory.js -n avalanche-fuji --action deployRemoteInterchainToken -s [salt] --destinationChain optimism-sepolia
0x
shouldn't be added to the payload below:axelard tx wasm execute axelar1yvfcrdke7fasxfaxx2r706h7h85rnk3w68cc5f4fkmafz5j755ssl8h9p0 '{ "execute": { "cc_id": { "source_chain": "avalanche-fuji" , "message_id": "[message id]" }, "payload": "[hex encoded payload without leading 0x]" } }' --from amplifier --gas auto --gas-adjustment 1.2
contract_called
event with themessage_id
for the second GMP call, and the newpayload
node evm/gateway.js -n [chain] --action submitProof --multisigSessionId [session id]
node evm/gateway.js -n optimism-sepolia --action execute --messageId [message id] --sourceChain axelarnet --sourceAddress axelar10jzzmv5m7da7dn2xsfac0yqe7zamy34uedx3e28laq0p6f3f8dzqp649fp --destination [destination its contract] --payload [payload]
Send Token
tokenId
needs to be provided:node evm/its.js -n avalanche-fuji --action interchainTransfer --tokenId [tokenId] --destinationChain optimism-sepolia --destinationAddress 0xba76c6980428A0b10CFC5d8ccb61949677A61233 --amount 1