In the cryptocurrency world, we are bombarded with various kinds of wallet options. Nevertheless, the majority of the public still hesitate to get one due to the lack of time needed for the research, and the pain of going through the tedious process like KYC.
We want to make transfer easy for people that have yet to onboard to the De-Fi world or have their crypto-wallet ready. Making it possible for people to receive crypto funds immediately without breaking a sweat.
The thought of using a smart contract and linking the Twitter handle(username) to a wallet address makes the transfer easy. At the same time, we also get the benefit of transferring funds using a recognizable name.
What it does
Sending fund to Twitter @handler Assuming a user does not have any wallet ready. The fund that was transferred to their @handle will be stored in a contract. This acts as a vault for keeping the transferred fund.
Claiming the fund effortlessly Once the user links their @handle and wallet address through the contract, the contract will release all the funds to the user. Any future transfers going through this contract will also be released to the wallet immediately.
How we built it
We use Solidity smart contract to handle the logic of transferring the fund. And, we use Twitter API to validate the user and send a notification to their Twitter @handle to inform the transaction. The fund is kept safe in the contract as a vault until they redeem it.
For the contract to work, we use an oracle to communicate with the De-Fi world. Its core feature is to verify the authenticity of the Twitter user and register the address into the oracle. This is done by using the Direct Message (DM) feature to inform the user about the transfer, and then redirect them to our application to proceed with the fund claiming.
Other than that, we also developed a minimalist web application for the user to interact with the contract. Key features are: transferring the fund using @handle; updating the wallet address; and viewing the transaction history.
Challenges we ran into
Unlike the other platform for smart contract development, using TRON-IDE lacks the DevEx for us to make and test the changes to our code.
To add on, due to the limited amount that was given on the TRON Faucet testnet, we need to constantly create new wallets and transfer funds to the main wallet for us to have enough funds for testing. Also, there is some small behavior difference when we were developing on NILE vs Shasta testnet, especially when we tried the
shouldPoll options. Nevertheless, we managed to figure out and adopted a much leaner/quicker approach when signing the transactions.
Also, the documentation was lacking a lot of detail that we should be aware of as a developer. For example, the options that are available when doing a call to the smart contract from the TRON library. We had to debug and read directly from the source code to identify the param that we need.
It is also the first time we build on TRC20 where we were stuck at the
transferFrom logic for quite some time. The community in the discord was helpful to unblock us within a day.
Other than that, it was quite straightforward in the development of the application.
Accomplishments that we're proud of
This is the second time we worked on writing smart-contract on solidity. Quite proud that we manage to unblock ourselves and built a complete solution. We also managed to improve the workflow of the user experience which we think is nice and easy to use.
We submitted the first iteration quite early at first. Since the progress and feedback from the DAO forum were good. It motivated us to continue to stabilize and add features such as support of the TRC20 token.
It is sort of production-ready for test in the Shasta Testnet currently. Feel free to head to our demo link to test it out! The contract address is
TH3ovtppS46QZqY2rU52cWg7M56x6j4iXr which you can find out more on the Shasta Testnet.
What's next for Twittron
- More web2 login method We started with Twitter, but the potential is unlimited. Instagram, TicTok, Google, Facebook, etc…
More token in the ecosystem Like previously, we can make it to support other tokens such as BTT, JUST, WIN, SUN, etc…
Reduce the gas fee Continue to optimize the smart contract so that we reduce the gas fee to help new joiners onboard easier…
Log in or sign up for Devpost to join the conversation.