logoAcademy

Deploy Native Token Home

Deploy the NativeTokenHome contract on the Dijets ECC blockchain.

You may already have TELEPORTER_REGISTRY_ECC and SOURCE_BLOCKCHAIN_ID_HEX set from previous sections. If you do, you can skip to step 5.

Get the Jumper Registry Address of mydijetschain

dijets blockchain describe mydijetschain
+-------------------------------------------------------------------------------------------+
|                                         TELEPORTER                                        |
+---------------+------------------------------+--------------------------------------------+
| Local Network | Jumper Messenger Address | 0x253b2784c75e510dD0fF1da844684a1aC0aa5fcf |
|               +------------------------------+--------------------------------------------+
|               | Jumper Registry Address  | 0xB4DC3d786D658d118631F5C6B75CB5935be8407C |
+---------------+------------------------------+--------------------------------------------+

Save the Jumper Registry Address

Most other environment variables we will need are already set in the devcontainer or from the previous section.

export TELEPORTER_REGISTRY_ECC=0xa3493940a13b426BD2f7dA6E55A39c060C0e6020

Get the Blockchain ID (hex) of mydijetschain

+---------------------------------------------------------------------------------------------------------------+
|                                                 mydijetschain                                                  |
+---------------+-----------------------------------------------------------------------------------------------+
| Name          | mydijetschain                                                                                  |
+---------------+-----------------------------------------------------------------------------------------------+
| VM ID         | qDNV9vtxZYYNqm7TSa9KnDTRabGxtBLv6vd888791J9a89kTF                                             |
+---------------+-----------------------------------------------------------------------------------------------+
| VM Version    | v0.6.9                                                                                        |
+---------------+--------------------------+--------------------------------------------------------------------+
| Local Network | ChainID                  | 1                                                                  |
|               +--------------------------+--------------------------------------------------------------------+
|               | SubnetID                 | 2KhsQJhH3VqS7WWMreodAAHpGfGCUNuGQDSaP2vUT29p1HELBV                 |
|               +--------------------------+--------------------------------------------------------------------+
|               | Owners (Threhold=1)      | P-custom18jma8ppw3nhx5r4ap8clazz0dps7rv5u9xde7p                    |
|               +--------------------------+--------------------------------------------------------------------+
|               | BlockchainID (CB58)      | 2ZempAyezixFRdJhJribDdj2wiK6YFF63CkXKaimfPb3hWeWVH                 |
|               +--------------------------+--------------------------------------------------------------------+
|               | BlockchainID (HEX)       | 0xcdd5b2b99ae462c32a8e4ea47e94f2c7804519353558fd4127cf7ae11d8a6e52 |
+---------------+--------------------------+--------------------------------------------------------------------+

Save the Blockchain ID (hex)

export SOURCE_BLOCKCHAIN_ID_HEX=0xcdd5b2b99ae462c32a8e4ea47e94f2c7804519353558fd4127cf7ae11d8a6e52

Deploy NativeTokenHome on mydijetschain

Using the forge create command, we will deploy the NativeTokenHome.sol contract, passing in the following constructor arguments:

  • InterECC Messaging Registry (for our Dijets ECC)
  • InterECC Messaging Manager (our funded address)
  • Wrapped Token Address (deployed in the last step)
forge create --rpc-url mydijetschain --private-key $PK lib/dijets-interchain-token-transfer/contracts/src/TokenHome/NativeTokenHome.sol:NativeTokenHome --constructor-args $TELEPORTER_REGISTRY_ECC $FUNDED_ADDRESS $WRAPPED_ERC20_ECC
[⠊] Compiling...
[⠊] Compiling 22 files with Solc 0.8.18
[⠒] Solc 0.8.18 finished in 1.95s
Compiler run successful!
Deployer: 0x8db97C7cEcE249c2b98bDC0226Cc4C2A57BF52FC
Deployed to: 0x17aB05351fC94a1a67Bf3f56DdbB941aE6c63E25
Transaction hash: 0x91c60be19a69aadb1415112dd42302764b30bc48f09957c3a191021d70ccc9d4

Save the Native Token Home Address

export ERC20_HOME_BRIDGE_ECC=0x17aB05351fC94a1a67Bf3f56DdbB941aE6c63E25

On this page