Inspiration
Our main goal is to build cross-chain lending. So first we have to build a protocol or a bridge between chains to be able to exchange crypto. GoldenStar swap is a demo for this main product, the first two chains we aim to be Ethereum and Harmony because they have some common point such as the smart contract building language (Solidity) as well as the use of Oracle Chainlink are available on Harmony and Ethereum.
What it does
GoldenStar swap allows you to convert between Erc-20s, ETH on Eth to One (native token in harmony). Thanks to Chainlink Oracle, we can optimize the exchange value between two tokens to help you have the most profitable cost. You can convert any type of ERC-20s to One, otherwise we have perfected the core but haven't really built the interface yet, but it will be finalized soon.
How I built it
Goldenstar is built on three main modules including EthBridge, HmyBridge and Relayer. In which the pricing of exchange tokens used through Oracle Chainlink is on Ethereum and Harmony.
EthBridge: Lock the amount of tokens exchanged into the contract and calculate the value of the locked token at that time through Oracle Chainlink, emit Event Lock token for Relayer
Relayer: Subcription EthBridge to receive Event Lock and moderate them before transferring to HmyBridge
HmyBridge: Receive events from Relayer and parse the data, calculate the corresponding number of One through Oracle Chainlink located on Harmony and transfer amount One accordingly.
Inspired by the open source https://github.com/harmony-one/ethhmy-bridge ,we have built a swapable POC from ETH, erc20 to One.
Architecture Diagram
Challenges I ran into
To combine different blockchains, there are always difficulties, especially operational problems. In addition, the use case of the exchange between tokens requires updating the price between the two parties quickly enough to avoid detrimental to users. Chainlink Oracle on Harmony side is quite simple but we were able to run a complete version on their testnet. The challenges we will face will still lie ahead when incorporating more blockchains, establishing validates between relays (consensus), establishing liquidity pools between blockchains.
Accomplishments that I'm proud of
All the team members tried their best to come up with a product that could compete in a short time. Although the project is just a small use case in the product that we are researching and building, we have worked together to build a complete demo.
What I learned
After completing this project, the entire team has clearly improved their skills in writing smart contracts, interacting with Oracle Chainlink as well as skills in building frontend.
What's next for GoldenStarSwap
As mentioned above the goldenstar swap is a demo of the product we are looking to build: Lending cross-chain. We are continuing to build bridges between blockchains. In the next versions we will incorporate additional blockchains:
- Tomochain (with native token Tomo)
- Cosmos hub (with native token Atom) Build up an interface for the user to provide liquidity to receive farming tokens.
Log in or sign up for Devpost to join the conversation.