The goal of this projects is to allow you to safely exchange tokens between you and another party. For this purpose a smart contract will be used and act as a trustee that performs the exchange.
- A seller will make an offer ("I want to sell 100k MEX")
- Multiple parties can place bids ("I bid 0.5 EGLD", "I give you 150k LKMEX")
- The seller accepts one of the bids and both parties come to an agreement.
- The seller initiates the trade and sends the offered tokens to the smart contract. The buyer gets notified.
- The buyer sends the bid tokens to the smart contract.
- The smart contract sends back the traded tokens to each party.
The catch here is that the smart contract will only release the tokens, if both parties send the exact number of tokens that both parties have agreed on. This way both the seller and the buyer are protected from being scammed.
This repository contains two components:
This is a telegram bot, that interacts with our smart contract. It acts as our user interface and is written in C# / hosted in a .NET 6 ASP.NET application.
This is the smart contract written in RUST which plays the role of the trustee between two partys. All funds are being held by the smart contract, until either
- the bidding party is sending their tokens to the SC or...
- ... you cancel the offer you initiated.