Skip to content

qperrot/qasr

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Qasr:

Qasr is a simple NFT bridge for Starknet.

Try it out live! 🔥 https://qasr.vercel.app

(special thanks to Argent for their Argent X plugin!)

Technical Details

Here's the L1 -> L2 flow:

  • On L1 we create a gateway (you will find it in ethereum/contracts/Gateway.sol).
  • On L2 we create another gateway (you will find it in starknet/contracts/gateway.cairo).
  • On L2 we create a mirror NFT contract of the NFT we wish to bridge (this should be done once, by the creator of the NFT on L1).
  • We then take our NFT on L1 and send it to our L1 gateway by calling the "warptoStarknet" method.
  • The L1 gateway send a message to the L2 gateway
  • The L2 gateway receives the message and handles it in bridge_from_mainnet. The gateway creates mint credits corresponding to a right to claim an NFT.
  • The L2 user can now go and "claim" his NFT to the L2 gateway with consume_mint_credit. The gateway will call the L2 smart-contract and mint the appropriate NFT (see function create_token).
  • If there is an issue with the consume_mint_credit call (ex: target contract reverts), L2 users can call revoke_mint_credit.

The L2 -> L1 basically works by reverting these steps. Please note that currently, you can only bridge from L2 to L1 an NFT that originated from L1. Meaning native L2 NFT to L1 is NOT supported by Qasr (yet!).

Qasr

About

ETH <=> Starknet NFT Bridge

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 80.1%
  • Solidity 7.2%
  • JavaScript 6.9%
  • HTML 2.6%
  • Python 1.5%
  • Shell 1.3%
  • Other 0.4%