Inspiration
Decentralized finance (DeFi) is a system that uses blockchain and cryptocurrency to manage financial transactions without the involvement of intermediaries like banks. DeFi aims to democratize finance by replacing centralized institutions with peer-to-peer relationships
What it does
- Create a developer account with Hedera Portal
- Create a Hedera account on Testnet.
- Create a developer account with Twitter Portal
- Create a new Project. Enable OAuth1.0, OAuth2.0, Automated App or Bot, and Direct Message.
- Insert the callback url:
http://localhost:3000/api/auth/callback/twitter. Update the localhost accordingly on prod or ngrok. - Create an account with MongoDB.
- Create a new database and collection.
How we built it
- install Hashpack browser extension
- install Ngrok
cd contract&yarn install- rename
.env.sampleto.envand fill in the variable from the pre-requisite. yarn build- to build (rollup) the stratojs and
.solinto adist/*.jslibrary for web-browser usage
- to build (rollup) the stratojs and
- copy
dist/hedera-strato.hashpack.jstonextapp/public/hedera-strato.hashpack-esm.js. cd nextapp&yarn install- rename
.env.local.sampleto.env.localand fill in the variable- not that twitter DM has limited quota per day.
DISABLE_DMif not necessary for development.
- not that twitter DM has limited quota per day.
yarn dev- start
ngrok http 3000- This is needed due to "HashPack" only validate from
https://.
- This is needed due to "HashPack" only validate from
Challenges we ran into
We use Hedera smart contract. More specifically, we use the Strato library to communicate with the smart contract. We use Twitter API which to validate the user and send a notification to them when there is a fund transferred to their name.
Accomplishments that we're proud of
- This maybe costly (gas fee) if not optimize to query from MongoDB.
- Certain API depends on reading the value from Smart Contract.
- Can consider check for changes before update smart contract to reduce cost.
- Additional work flow for user to directly update Hedera Account within the DM.
- Expanding similar use case to other social media platform.
What we learned
- Get started with smart contract
- Solidity Dev
- First contract Eg
- Oracle reference
- Using Oracle Example
- Next JS doc
What's next for Money-3.0-TwittBar
The thought of using a smart contract and linking the Twitter handle(username) to a wallet address helps to make the transfer easy. At the same time, we also get the benefit of transferring funds using a recognizable name.
Built With
- shell-script
- smart-contract
- typescript
Log in or sign up for Devpost to join the conversation.