From 2ff1a29c7c169baf5350c1e82a8139c7876e2496 Mon Sep 17 00:00:00 2001 From: Idris Olubisi Date: Thu, 19 Dec 2024 17:54:29 +0000 Subject: [PATCH] fix: update interchain token developer guides to use sepolia (#1276) --- ...multiple-chains-into-interchain-tokens.mdx | 34 +++++++++---------- ...grammatically-create-a-canonical-token.mdx | 30 ++++++++-------- .../programmatically-create-a-token.mdx | 28 +++++++-------- 3 files changed, 46 insertions(+), 46 deletions(-) diff --git a/src/content/docs/dev/send-tokens/interchain-tokens/developer-guides/link-custom-tokens-deployed-across-multiple-chains-into-interchain-tokens.mdx b/src/content/docs/dev/send-tokens/interchain-tokens/developer-guides/link-custom-tokens-deployed-across-multiple-chains-into-interchain-tokens.mdx index e3673e34a..122b89440 100644 --- a/src/content/docs/dev/send-tokens/interchain-tokens/developer-guides/link-custom-tokens-deployed-across-multiple-chains-into-interchain-tokens.mdx +++ b/src/content/docs/dev/send-tokens/interchain-tokens/developer-guides/link-custom-tokens-deployed-across-multiple-chains-into-interchain-tokens.mdx @@ -232,7 +232,7 @@ async function deployTokenManager() { const interchainTokenServiceContract = await getContractInstance( interchainTokenServiceContractAddress, interchainTokenServiceContractABI, - signer + signer, ); // Generate a random salt @@ -241,7 +241,7 @@ async function deployTokenManager() { // Create params const params = ethers.utils.defaultAbiCoder.encode( ["bytes", "address"], - [signer.address, fantomCustomTokenAddress] + [signer.address, fantomCustomTokenAddress], ); // Deploy the token manager @@ -250,13 +250,13 @@ async function deployTokenManager() { "", MINT_BURN, params, - ethers.utils.parseEther("0.01") + ethers.utils.parseEther("0.01"), ); // Get the tokenId const tokenId = await interchainTokenServiceContract.interchainTokenId( signer.address, - salt + salt, ); // Get the token manager address @@ -269,7 +269,7 @@ async function deployTokenManager() { Transaction Hash: ${deployTxData.hash}, Token ID: ${tokenId}, Expected token manager address: ${expectedTokenManagerAddress}, - ` + `, ); } ``` @@ -345,7 +345,7 @@ async function gasEstimator() { EvmChain.POLYGON, GasToken.FTM, 700000, - 1.1 + 1.1, ); return gas; @@ -370,13 +370,13 @@ async function deployRemoteTokenManager() { const interchainTokenServiceContract = await getContractInstance( interchainTokenServiceContractAddress, interchainTokenServiceContractABI, - signer + signer, ); // Create params const param = ethers.utils.defaultAbiCoder.encode( ["bytes", "address"], - [signer.address, polygonCustomTokenAddress] + [signer.address, polygonCustomTokenAddress], ); const gasAmount = await gasEstimator(); @@ -388,13 +388,13 @@ async function deployRemoteTokenManager() { MINT_BURN, param, ethers.utils.parseEther("0.01"), - { value: gasAmount } + { value: gasAmount }, ); // Get the tokenId const tokenId = await interchainTokenServiceContract.interchainTokenId( signer.address, - "0x7f5fe989334ad23b77e8da841f672394d021ae83ff0a24afb461ba19d72e3553" // change salt + "0x7f5fe989334ad23b77e8da841f672394d021ae83ff0a24afb461ba19d72e3553", // change salt ); // Get the token manager address @@ -406,7 +406,7 @@ async function deployRemoteTokenManager() { Transaction Hash: ${deployTxData.hash}, Token ID: ${tokenId}, Expected token manager address: ${expectedTokenManagerAddress}, - ` + `, ); } ``` @@ -481,7 +481,7 @@ async function transferMintAccessToTokenManagerOnFantom() { const tokenContract = await getContractInstance( fantomCustomTokenAddress, customTokenABI, - signer + signer, ); // Get the minter role @@ -489,7 +489,7 @@ async function transferMintAccessToTokenManagerOnFantom() { const grantRoleTxn = await tokenContract.grantRole( getMinterRole, - "0xad8Cf8FF7BBe82269844bBcbA60bAa8f02781f13" + "0xad8Cf8FF7BBe82269844bBcbA60bAa8f02781f13", ); console.log("grantRoleTxn: ", grantRoleTxn.hash); @@ -551,7 +551,7 @@ async function transferMintAccessToTokenManagerOnPolygon() { const tokenContract = await getContractInstance( polygonCustomTokenAddress, customTokenABI, - signer + signer, ); // Get the minter role @@ -559,7 +559,7 @@ async function transferMintAccessToTokenManagerOnPolygon() { const grantRoleTxn = await tokenContract.grantRole( getMinterRole, - "0xad8Cf8FF7BBe82269844bBcbA60bAa8f02781f13" + "0xad8Cf8FF7BBe82269844bBcbA60bAa8f02781f13", ); console.log("grantRoleTxn: ", grantRoleTxn.hash); @@ -627,7 +627,7 @@ async function transferTokens() { const interchainTokenServiceContract = await getContractInstance( interchainTokenServiceContractAddress, interchainTokenServiceContractABI, - signer + signer, ); const gasAmount = await gasEstimator(); const transfer = await interchainTokenServiceContract.interchainTransfer( @@ -640,7 +640,7 @@ async function transferTokens() { { // Transaction options should be passed here as an object value: gasAmount, - } + }, ); console.log("Transfer Transaction Hash:", transfer.hash); diff --git a/src/content/docs/dev/send-tokens/interchain-tokens/developer-guides/programmatically-create-a-canonical-token.mdx b/src/content/docs/dev/send-tokens/interchain-tokens/developer-guides/programmatically-create-a-canonical-token.mdx index 4497c02c5..4b97ed347 100644 --- a/src/content/docs/dev/send-tokens/interchain-tokens/developer-guides/programmatically-create-a-canonical-token.mdx +++ b/src/content/docs/dev/send-tokens/interchain-tokens/developer-guides/programmatically-create-a-canonical-token.mdx @@ -20,7 +20,7 @@ In this tutorial, you will learn how to: You will need: - A basic understanding of [Solidity](https://www.tutorialspoint.com/solidity/index.htm) and [JavaScript](https://www.w3schools.com/js/) -- A [wallet](https://metamask.io/) with FTM and MATIC funds for testing. If you don’t have these funds, you can get FTM from the [Fantom faucet](https://faucet.fantom.network/) and MATIC from the Mumbai faucets ([1](https://faucet.polygon.technology/), [2](https://faucet.quicknode.com/polygon/mumbai)). +- A [wallet](https://metamask.io/) with FTM and MATIC funds for testing. If you don’t have these funds, you can get FTM from the [Fantom faucet](https://faucet.fantom.network/) and MATIC from the Amoy faucets ([1](https://faucet.polygon.technology/), [2](https://faucet.quicknode.com/polygon/amoy)). ## Deploy an ERC-20 token on the Fantom testnet @@ -181,24 +181,24 @@ async function registerCanonicalInterchainToken() { const interchainTokenFactoryContract = await getContractInstance( interchainTokenFactoryContractAddress, interchainTokenFactoryContractABI, - signer + signer, ); const interchainTokenServiceContract = await getContractInstance( interchainTokenServiceContractAddress, interchainTokenServiceContractABI, - signer + signer, ); // Register a new Canonical Interchain Token const deployTxData = await interchainTokenFactoryContract.registerCanonicalInterchainToken( - customTokenAddress // Your token address + customTokenAddress, // Your token address ); // Retrieve the token ID of the newly registered token const tokenId = await interchainTokenFactoryContract.canonicalInterchainTokenId( - customTokenAddress + customTokenAddress, ); const expectedTokenManagerAddress = @@ -209,7 +209,7 @@ async function registerCanonicalInterchainToken() { Transaction Hash: ${deployTxData.hash}, Token ID: ${tokenId}, Expected Token Manager Address: ${expectedTokenManagerAddress}, - ` + `, ); } ``` @@ -284,7 +284,7 @@ async function gasEstimator() { EvmChain.POLYGON, GasToken.FTM, 700000, - 1.1 + 1.1, ); return gas; @@ -295,7 +295,7 @@ async function gasEstimator() { ### Perform remote token deployment -Create a `deployRemoteCanonicalInterchainToken()` function that will perform token remote canonical deployment on the Polygon Mumbai testnet. +Create a `deployRemoteCanonicalInterchainToken()` function that will perform token remote canonical deployment on the Polygon Amoy testnet. ```javascript //... @@ -309,7 +309,7 @@ async function deployRemoteCanonicalInterchainToken() { const interchainTokenFactoryContract = await getContractInstance( interchainTokenFactoryContractAddress, interchainTokenFactoryContractABI, - signer + signer, ); // Estimate gas fees @@ -322,7 +322,7 @@ async function deployRemoteCanonicalInterchainToken() { customTokenAddress, // Your token address "Polygon", gasAmount, - { value: gasAmount } + { value: gasAmount }, ); console.log(`Transaction Hash: ${txn.hash}`); @@ -369,7 +369,7 @@ Transaction Hash: 0xb963f5ce3402e1787ead0c8f421be79ac06e5b78305b1dbce184806e099d ### Check the transaction on the Axelar testnet scanner -Check the [Axelarscan testnet scanner](https://testnet.axelarscan.io/) to see if you have successfully deployed the remote Canonical Interchain Token “MAT” on the Polygon Mumbai testnet. It should look something like [this](https://testnet.axelarscan.io/gmp/0xb963f5ce3402e1787ead0c8f421be79ac06e5b78305b1dbce184806e099d54fd). Make sure that Axelar shows a successful transaction before continuing on to the next step. +Check the [Axelarscan testnet scanner](https://testnet.axelarscan.io/) to see if you have successfully deployed the remote Canonical Interchain Token “MAT” on the Polygon Amoy testnet. It should look something like [this](https://testnet.axelarscan.io/gmp/0xb963f5ce3402e1787ead0c8f421be79ac06e5b78305b1dbce184806e099d54fd). Make sure that Axelar shows a successful transaction before continuing on to the next step. ## Transfer your token between chains @@ -389,18 +389,18 @@ async function transferTokens() { const interchainTokenServiceContract = await getContractInstance( interchainTokenServiceContractAddress, interchainTokenServiceContractABI, - signer + signer, ); const customTokenContract = await getContractInstance( customTokenAddress, customTokenContractABI, - signer + signer, ); // Approve ITS to spend tokens await customTokenContract.approve( interchainTokenServiceContractAddress, - ethers.utils.parseEther("50") + ethers.utils.parseEther("50"), ); const gasAmount = await gasEstimator(); @@ -413,7 +413,7 @@ async function transferTokens() { ethers.utils.parseEther("50"), // Amount to transfer "0x00", gasAmount, // gasValue - { value: gasAmount } + { value: gasAmount }, ); console.log("Transfer Transaction Hash:", transfer.hash); diff --git a/src/content/docs/dev/send-tokens/interchain-tokens/developer-guides/programmatically-create-a-token.mdx b/src/content/docs/dev/send-tokens/interchain-tokens/developer-guides/programmatically-create-a-token.mdx index 5dfc6dcff..9828750fe 100644 --- a/src/content/docs/dev/send-tokens/interchain-tokens/developer-guides/programmatically-create-a-token.mdx +++ b/src/content/docs/dev/send-tokens/interchain-tokens/developer-guides/programmatically-create-a-token.mdx @@ -20,7 +20,7 @@ In this tutorial, you will learn how to: You will need: - A basic understanding of [Solidity](https://www.tutorialspoint.com/solidity/index.htm) and [JavaScript](https://www.w3schools.com/js/) -- A [MetaMask wallet](https://metamask.io/) with FTM and MATIC funds for testing. If you don’t have these funds, you can get FTM from the [Fantom faucet](https://faucet.fantom.network/) and MATIC from the Mumbai faucets ([1](https://faucet.polygon.technology/), [2](https://faucet.quicknode.com/polygon/mumbai)). +- A [MetaMask wallet](https://metamask.io/) with FTM and MATIC funds for testing. If you don’t have these funds, you can get FTM from the [Fantom faucet](https://faucet.fantom.network/) and MATIC from the Amoy faucets ([1](https://faucet.polygon.technology/), [2](https://faucet.quicknode.com/polygon/amoy)). ## **Set up your development environment** @@ -183,18 +183,18 @@ async function registerAndDeploy() { const interchainTokenFactoryContract = await getContractInstance( interchainTokenFactoryContractAddress, interchainTokenFactoryContractABI, - signer + signer, ); const interchainTokenServiceContract = await getContractInstance( interchainTokenServiceContractAddress, interchainTokenServiceContractABI, - signer + signer, ); // Generate a unique token ID using the signer's address and salt const tokenId = await interchainTokenFactoryContract.interchainTokenId( signer.address, - salt + salt, ); // Retrieve new token address @@ -213,7 +213,7 @@ async function registerAndDeploy() { symbol, decimals, initialSupply, - signer.address + signer.address, ); console.log( @@ -223,7 +223,7 @@ async function registerAndDeploy() { Transaction Hash: ${deployTxData.hash}, salt: ${salt}, Expected Token Manager Address: ${expectedTokenManagerAddress}, - ` + `, ); } ``` @@ -302,7 +302,7 @@ async function gasEstimator() { EvmChain.POLYGON, GasToken.FTM, 700000, - 1.1 + 1.1, ); return gas; @@ -313,7 +313,7 @@ async function gasEstimator() { ### Perform remote token deployment -Create a `deployToRemoteChain()` function that will perform token remote deployment on the Polygon Mumbai testnet. Make sure to replace the `salt` value with the salt returned to your terminal from when you ran `registerAndDeploy()`: +Create a `deployToRemoteChain()` function that will perform token remote deployment on the Polygon Amoy testnet. Make sure to replace the `salt` value with the salt returned to your terminal from when you ran `registerAndDeploy()`: ```javascript //... @@ -326,7 +326,7 @@ async function deployToRemoteChain() { const interchainTokenFactoryContract = await getContractInstance( interchainTokenFactoryContractAddress, interchainTokenFactoryContractABI, - signer + signer, ); // Estimate gas fees @@ -343,7 +343,7 @@ async function deployToRemoteChain() { signer.address, "Polygon", gasAmount, - { value: gasAmount } + { value: gasAmount }, ); console.log(`Transaction Hash: ${txn.hash}`); @@ -390,7 +390,7 @@ Transaction Hash: 0xca901048c74c3757fcea5d309cd53ef6e21816c841e85145ac8586fa71a9 ### Check the transaction on the Axelar testnet scanner -Check the [Axelarscan testnet scanner](https://testnet.axelarscan.io/) to see if you have successfully created and remotely deployed NIT on the Polygon Mumbai testnet. It should look something like [this](https://testnet.axelarscan.io/gmp/0xca901048c74c3757fcea5d309cd53ef6e21816c841e85145ac8586fa71a9cc48). Make sure that Axelar shows a successful transaction before continuing on to the next step. +Check the [Axelarscan testnet scanner](https://testnet.axelarscan.io/) to see if you have successfully created and remotely deployed NIT on the Polygon Amoy testnet. It should look something like [this](https://testnet.axelarscan.io/gmp/0xca901048c74c3757fcea5d309cd53ef6e21816c841e85145ac8586fa71a9cc48). Make sure that Axelar shows a successful transaction before continuing on to the next step. ## Transfer your token between chains @@ -410,7 +410,7 @@ async function transferTokens() { const interchainToken = await getContractInstance( "0xc028ebdF906a890be73C594b6a14858D0552544A", // Update with new token address interchainTokenContractABI, // Interchain Token contract ABI - signer + signer, ); // Calculate gas amount @@ -422,7 +422,7 @@ async function transferTokens() { "0x510e5EA32386B7C48C4DEEAC80e86859b5e2416C", // Update with your own wallet address ethers.utils.parseEther("25"), // Transfer 25 tokens "0x", // Empty data payload - { value: gasAmount } // Transaction options + { value: gasAmount }, // Transaction options ); console.log("Transfer Transaction Hash:", transfer.hash); } @@ -470,7 +470,7 @@ If you see this, it means that your interchain transfer has been successful! ### Check the transaction on the Axelar testnet scanner -Check the [Axelarscan testnet scanner](https://testnet.axelarscan.io/) to see if you have successfully transferred NIT from the Fantom testnet to the Polygon testnet. It should look something like [this](https://mumbai.polygonscan.com/token/0xc028ebdf906a890be73c594b6a14858d0552544a). +Check the [Axelarscan testnet scanner](https://testnet.axelarscan.io/) to see if you have successfully transferred NIT from the Fantom testnet to the Polygon testnet. It should look something like [this](https://testnet.axelarscan.io/gmp/0x205554f5e39e29b21f3110ebf813579a3826465746c37a151ed18c992004c6b5). ### Import the new token into your wallet