Skip to content

OlympiHacks Winner - Taking Axelar GMP to the next level by enabling cross-chain calls to NEAR from any EVM or Cosmos chain!

Notifications You must be signed in to change notification settings

AdnanSlef/Nearly-Intergalactic-Axelar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

63 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Intergalactic PioNEARing with Axelar

✨ Inspiration

This cutting-edge technology is enabled by the release of Aurora Engine 2.9.0 on April 21st 2023, which allows Near XCC cross-contract calls from within Aurora EVM. We combine this capability with the power of Axelar GMP to allow users in any EVM or Cosmos chain to make a cross-chain call to NEAR smart contracts.

πŸ‘€ What it does

To showcase this technique, we developed an intergalactic themed passport dApp which allows users to gain a stamp in their passport for each chain they use along the way. Once the space traveler makes it all the way to NEAR, a celebratory social media post is created on Near Social, a smart contract on the NEAR blockchain. Overall, a smart contract on Avalanche (or any other Axelar-supported chain) makes a successful Interchain Message and Cross-Chain Call to a smart contract in the NEAR blockchain.

🌌 Example Interchain Transaction to NEAR

  1. Using Axelar Explorer, you can see how we sent the transaction using General Message Passing: Successful Transaction on Axelar Explorer.
  2. That transaction continues on through to NEAR, which is best viewed on NEAR explorer: Successful Transaction on NEAR Explorer.
  3. As a result, the social media post requested in the body of the call on Avalanche is successfully posted to a NEAR smart contract, and the results can be viewed on the Near Social website: Successful Near Social Passport Post Creation.

πŸ’» How we built it

We created 2 EVM smart contracts in Solidity, HomePlanet.sol and NearlyIntergalactic.sol. These contracts use Axelar General Message Passing to make a cross-chain call from the Home Planet (any chain supported by Axelar; we used Avalanche) to the Nearly Intergalactic contract in Aurora. This contract uses a version of Aurora SDK that we customized for this purpose (seen here) to make an XCC cross-contract call at the NEAR level.

For the front end, we used React-Typescript with ethers.js and MetaMask integration to create an intergalactic traveler passport dApp, showcasing the interchain functionality by awarding the user with a stamp for each chain visited along the way, and finally posting the completed passport to Near Social by successfully making a NEAR call all the way from our Home Planet of Avalanche.

πŸš€ Accomplishments that we're proud of

  • We connected two blockchains that were never before possible to connect in this way!
  • We demonstrated how to expand the capabilities of Axelar to include support for Interchain calls to NEAR.
  • We created a dApp frontend which we enjoy using and which integrates multiple chains.

Experience learning and using Axelar

βœ… The interchain capability allowed us to really bring this idea to life
βœ… Tutorials and docs were really well made so really helped hitting the ground running
βœ… AxelarScan made it really easy to visualize the GMP transactions as they went through

βž– When running on testnet, the time seemed to vary from 1 minute 30 to 4 minutes 30 for the same transaction
βž– When AxelarScan errors, it isn't too verbose on the cause of error

πŸ“ˆ What's next for Intergalactic PioNEARing with Axelar

We are excited to have been successful in connecting NEAR with Axelar. Some of the next steps we look forward to include:

  • Interchain Tokens (ERC-20 to NEP-141)
  • Interchain NFTs (ERC-721 to NEP-171)
  • Arbitrary Near Cross-Contract Calls
  • 2-way GMP Equivalent

πŸ“„ Links

Powerpoint Presentation

Thank you! We hope you enjoy our multi-chain, multi technology project which opens more doors in the web3 ecosystem.

πŸ§‘β€πŸ’» Instructions for testing locally

  1. Deploy NearlyIntergalactic on Aurora with the following values:

    • nearSocialAccountId = v1.social08.testnet
    • wNEAR = 0x4861825E75ab14553E5aF711EbbE6873d369d146
    • gateway = 0x304acf330bbE08d1e512eefaa92F6a57871fD895
    • gasReceiver = 0xA2C84547Db9732B27D45c06218DDAEFcc71e452D
  2. Deploy HomePlanet on any Axelar-supported chain, such as Avalanche shown here:

    • gateway = 0xC249632c2D40b9001FE907806902f63038B737Ab
    • gasReceiver = 0xbE406F0189A0B4cf3A05C286473D23791Dd44Cc6
  3. Ensure that NearlyIntergalactic has the needed wNEAR.

  4. Use the dApp web UI to begin your journey, which will call HomePlanet.travelToNear():

    • destinationChain = aurora
    • destinationAddress = <NearlyIntergalactic address>
    • attachedNear = <Quantity of wNEAR to attach, ex. 3000000000000000000000000>
    • data = <Near Social DB, as Bytes Encoded JSON>
    • {msg.value} = 100000000000000000 wei

About

OlympiHacks Winner - Taking Axelar GMP to the next level by enabling cross-chain calls to NEAR from any EVM or Cosmos chain!

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •