Ordinal Synthetic Market to convert bridged Ordinal to an ERC20, increasing interopability.
This project combines a Bitcoin Ordinal / Runes, smart contracts and browser-based frontend to allow users to mint and redeem synthetic ERC20 tokens of their favourite ordinals / runes on Rootstock instantly.
The users can use this synthetic ERC20 token for better interoperability, allowing it to be used in money markets, staking, yield farming and Dexes. This synthetic also allow users to own a fraction of the token instead of the entire, leading to better capital efficiency.
Our platform allows users to do 4 main actions:
This project comprises of 3 main parts:
There are 3 main smart contracts, all built with Solidity and Hardhat. We used the rootstock hardhat starter kit was especially helpful in getting us started. The first smart contract is the RuneToken ERC1155 token that is adapted from the Rootstock Rune Bridge RuneToken. This represents the Bridged Ordinal / Rune from BTC to Rootstock. Secondly, it's the SyntheticToken which is essentially just a typical ERC20 token. Lastly, it's the OrdiSynth contract that interacts with UniswapV2 Router, RuneToken and the Synthetic Token. OrdiSynth has 4 main functions, minting, redeeming, adding liquidity and swapping. The last 2 functions are built on top of the first 2 minting and redeeming which are essentially a lock and mint system.
Similarly, the frontend was built with the Rootstock wagmi starter kit which was equally helpful. We used wagmi to interface with the OrdiSynth smart contract and provided a testing page to allow users to mint test RuneTokens to test the project out.
Lastly, we created an Envio Indexer to utilise the hypersync feature to listen for the events of both the OrdiSynth and Synthetic Token smart contract. We were able to use the RPC sync feature to use our own rpc configuration for Rootstock.