BabyFind – is a telegram bot for making acquaintances. It helps to find boys and girls who you can talk to. Our team has developed a Smart contract on Ethereum for the local currency of the service.
What has been done:
- There has been written a Smart contract on Solidity for the Ethereum blockchain.
- Local currency has been issued (tokens).
- There has been implemented Oraclize to make the blockchain interact with the bot.
- A Web interface has been created to buy the local currency.
The implementation process has been described in this case.
BFT is local currency for the dating bot
The idea of local currency holds great promise. Being a bonus program in a store or in-game coins, BFT can be spent on purchases inside the service. To extend the functionality, to activate new services.
Currency is tokens which are issued on the Ethereum blockchain. Smart contract deals with the issuance, purchase and administering of tokens.
Visually, the token purchase scheme looks the following way:
Ethereum blockchain and ERC-20 standard
The blockchain provides transparency. The user is sure of the openness due to the decentralizing. The tokens he purchased will stay with him.
Ethereum was chosen as the most global platform for the smart contracts.
The contract was written in the Solidity language, you can find more detailed information about this language here.
It’s important to make tokens according to the ERC-20 standard. The standard allows the token to be supported by different wallets and be listed on the exchange. Any Ethereum-wallet can work with BFT.
In brief, the standard describes which functions and variables shall be in the contract. The specifications are available by the link.
Purchase process. As a first step, the team has elaborated the scenario of the purchase and use, the structure of the Smart contract (the amount of tokens, the rate of payment, how to use less gas and other parameters). All the additional services are planned to be used on account of the chain of new smart contracts.
The User in the bot chooses to buy a Pro-account. The bot sends a link to the Web interface for purchasing the currency and the ID.
For convenience, there was written a Web interface – html-page where it’s possible to buy tokens. The library Web3.js. was used.
In order to buy currency the User enters the ID and the number of Ethereum he wants to spend. The ID is used to identify the user in the bot. The function of payment receipt in the Smart contract accepts this ID and records it in the blockchain.
The Smart contract is performed in the Ethereum network.
The User can see tokens in the Ethereum wallet.
If the record in the blockchain succeeds, the Oraclize notifies the service.
In order to notify the User about a successful transaction and activation of the Pro-account, a so-called Oraclize was used. They are special contracts which provide interaction with the offchain services.
The bot sends a notification that the Pro-account has been activated and the tokens are purchased.
The process of token purchase is tested in the RinkeBy Test Net.