Skip to content

hanma46/hanma-polyverse

Repository files navigation

PIT Phase 2 repo project: Cross-chain Proof of NFT

This repository is created to enter the PIT phase 2.

Team Members

  • @hanma46

Description

This application enables a user to submit a vote a ballot on a contract on OP Sepolia. The information about this vote subsequently gets sent to an ERC721 NFT contract on Base Sepolia to mint an NFT related to the vote.

Features:

  • Uses Polymer x IBC as the cross-chain format
  • Commits to the spirit of application specific chains/rollups where voting functionality could be specialized on one chain, NFT marketplace on another and both can form composable applications through interoperability.

Resources used

The repo uses the ibc-app-solidity-template as starting point and adds custom contracts XBallot and XProofOfVoteNFT that implement the custom logic.

It changes the send-packet.js script slightly to adjust to the custom logic.

The expected behaviour from the template should still work but nevertheless we quickly review the steps for the user to test the application... Run just --list for a full overview of the just commands.

Additional resources used:

  • Hardhat
  • Blockscout
  • Tenderly

Steps to reproduce

After cloning the repo, install dependencies:

just install

And add your private key to the .env file (rename it from .env.example).

Sending a packet

Now with an existing channel in the config (your own or the default), run:

just do-it

You'll see an active waiting poll in the terminal and will be informed if the packet was sent successfully.

Proof of testnet interaction

After following the steps above you should have interacted with the testnet. You can check this at the IBC Explorer.

Here's the data of our application:

  • XBallot (OP Sepolia) : 0x01bABE71bAf632d1E3287443816F92a6ce8EC559

  • XProofOfVoteNFT (Base Sepolia): 0xd014d978c0e64e8d9db3656ee637101314b3be6b

  • Channel (OP Sepolia): channel-39842

  • Channel (Base Sepolia): channel-39843

  • Proof of Testnet interaction:

Challenges Faced

  • Debugging used to be tricky when the sendPacket on the contract was successfully submitted but there was an error further down the packet lifecycle. What helped was to verify the contracts and use Tenderly for step-by-step debugging to see what the relayers submitted to the dispatcher etc.

What we learned

How to make the first dApp using Polymer.

Future improvements

Basic functionality was implemented, but the following things can be improved:

  • More tests
  • More input validation
  • Add event listeners related to important IBC lifecycle steps

Licence

Apache 2.0

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published