Effortless Cross-Chain Communication with Neon EVM, Hyperlane and Solana’s Speed (Part 2)

Effortless Cross-Chain Communication with Neon EVM, Hyperlane and Solana’s Speed (Part 2)

In the previous post on cross-chain interoperability we explored cross-chain messaging. In this post, we will delve into cross-chain transfers with Hyperlane warp routes.

In this blog post, we will go through the process of deploying Hyperlane contracts to Neon EVM and utilizing Warp routes for token transfers. And we're not just connecting Ethereum to another EVM-compatible chain. Through Neon EVM, we're actually opening a fast lane directly to Solana.


By the end of this guide, you'll have a clear understanding of how to:


  1. Set up Warp routes for seamless token transfers
  2. Leverage Neon EVM as a bridge to tap into Solana's unique capabilities
  3. Send and receive tokens on different chains.

To refresh the cross-messaging process, you can read Part 1 here.

In this tutorial, we will deploy a Hyperlane warp route and seamlessly send tokens across chains.


Deploying a Warp Route

Prerequisites:

For this step, we will again need to use our a private key from our wallet. To retrieve the private key from the Metamask wallet, follow these steps.

  1. From your local environment, source the private key or seed phrase of your funded deployer address via HYPKEY. For example: export HYPKEY=''
  2. Verify your HYPKEY is sourced correctly via echo $HYPKEY
  3. From the same instance, run:
hyperlane warp init


This will create a new deployment config.

Hyperlane CLI
Hyperlane Warp Configure
------------------------
Creating a new warp route deployment config...
? Enter the desired owner address: YOUR_ADDRESS
? Select network type Testnet
Use SPACE key to select at least 1 chains, then press ENTER
? Select chains to connect holesky, neondev
holesky: Configuring warp route...
? Select holesky's token type collateral
? Detected mailbox address as YOUR_MAILBOX_ADDR from hyperlane-registry, is this correct? yes
? Enter the existing token address on chain holesky YOUR_MAILBOX_ADDR
neondev: Configuring warp route...
? Select neondev's token type synthetic
? Detected mailbox address as YOUR_MAILBOX_ADDR from hyperlane-registry, is this correct? yes


For this example, we will create a warp route that bridges an ERC20 token (WETH) to NeonEVM.

This will create a config file similar to this:

Warp Route config is valid, writing to file ./configs/warp-route-deployment.yaml:

    holesky:
      isNft: false
      type: collateral
      token: "0x94373a4919B3240D86eA41593D5eBa789FEF3848"
      owner: "YOUR_WALLET_ADDR"
      mailbox: "YOUR_MAILBOX_ADDR"
      interchainSecurityModule:
        type: staticAggregationIsm
        modules:
          - type: trustedRelayerIsm
            relayer: "YOUR_WALLET_ADDR"
          - owner: "YOUR_WALLET_ADDR"
            type: defaultFallbackRoutingIsm
            domains: {}
        threshold: 1
    neondev:
      isNft: false
      type: synthetic
      owner: "YOUR_WALLET_ADDR"
      mailbox: "YOUR_MAILBOX_ADDR"
      interchainSecurityModule:
        type: staticAggregationIsm
        modules:
          - type: trustedRelayerIsm
            relayer: "YOUR_WALLET_ADDR"
          - owner: "YOUR_WALLET_ADDR"
            type: defaultFallbackRoutingIsm
            domains: {}
        threshold: 1


After this, we can start the route deployment:

hyperlane warp deploy


Your deployment plan will look similar to this:

Screenshot 2024-08-27 at 12.25.43.png


Before confirming, make sure you have enough devnet NEON for gas, since we are deploying many contracts.


Screenshot 2024-08-27 at 12.26.46.png


After the deployment is complete, this configuration will be added into warp confugrations in your .hyperlane folder.

Finally, we can send the tokens:

hyperlane warp send --relay --warp $HOME/.hyperlane/deployments/warp_routes/WETH/holesky-neondev-config.yaml --amount 9  


Follow the prompts and enter your private key:

Please enter private key or use the HYP_KEY environment variable. <YOUR_PRIVATE_KEY>


Screenshot 2024-08-26 at 22.09.59.png


Make sure your origin network is holesky, since this is there we created the collateral contract. And the destination network is Neon Devnet.

? Select network type Testnet
? Select the origin chain holesky
? Select network type Testnet
? Select the destination chain neondev


This will start the message relay.

Screenshot 2024-08-27 at 12.33.12.png


And after the transaction is confirmed on both chains, we can head over to Neon block explorer and check it out.

https://neon-devnet.blockscout.com/tx/0x384a599697d203402d65d836887450ead99da024bb79eba644274bc0c9a9acdd

If we scroll down to transaction input and view is as UTF-8, we can see than the transaction value of 9 wei is the very beginning of the data.


Screenshot 2024-08-27 at 12.34.13.png

Screenshot 2024-08-27 at 12.38.35.png


Let’s also go to neon scan and check the corresponding Solana transactions.

https://devnet.neonscan.org/tx/0x384a599697d203402d65d836887450ead99da024bb79eba644274bc0c9a9acdd


In the first Solana tx we can now also see our message in hex format relayed on solana.


Screenshot 2024-08-27 at 12.40.07.png


Great, we have successfully deployed and used a warp route to bridge test funds from holesky to Neon. We've explored the powerful integration of NeonEVM and Hyperlane, demonstrating cross-chain messaging and token transfers between Ethereum and Neon as well as Solana. Our journey covered:

  1. Adding NeonEVM to Hyperlane's supported networks
  2. Sending messages from Ethereum to Solana via NeonEVM
  3. Setting up a Warp route for token transfers between chains

This integration bridges Ethereum's smart contract capabilities with Solana's speed and efficiency, opening up new possibilities for decentralized applications. It paves the way for innovative cross-chain DeFi, NFTs, and governance systems…

Daria Agadzhanova
Daria AgadzhanovaDevRel
Sep 19, 2024

Other articles