Skip to content

Decentralized Twitter clone on the Ethereum blockchain. Deployed to Goerli and Ropsten.

License

Notifications You must be signed in to change notification settings

maxpetretta/twitt3r.xyz

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

81 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

twitt3r.xyz

This repo contains the source code for Twitt3r, a decentralized Twitter clone built on the Ethereum blockchain. The project utilizes a custom smart contract for message storage, and ENS lookups for profile information. It is deployed to the Goerli and Ropsten testnets.

Want to learn more? Read all the details in this blog post!

Demo

A quick 60 second demo of twitt3r.xyz

Tech Stack

Built with the following technologies:

Installation

Prereqs

To set up your own instance of Twitt3r, you will need:

These values are specified in a .env file. Once you have those, clone the repo with the following commands:

git clone https://github.com/maxpetretta/twitt3r.xyz
cd twitt3r.xyz/hardhat
npm install

This will install all dependencies for the hardhat environment.

Smart Contract

Once you have chosen your network, use these commands to deploy:

npx hardhat run scripts/deploy.js --network <NETWORK_NAME>
npx hardhat verify --network <NETWORK_NAME> <CONTRACT_ADDRESS> "10" "1000000000000000" "100000000000000000"

Additionally, you can deploy to a local testnet by running npx hardhat node in a separate terminal.

Frontend

After you've deployed the contract, you are ready to set up the frontend website. Copy the contract address to contract.js, and optionally the ABI if you've modified the contract. Then run:

cd ../react
npm install
npm run dev
open http://localhost:3000

Tests

Testing your smart contract is not suggested, it is required. Twitt3r comes with a baseline suite of unit tests, to ensure the contract functions as expected. To run the test suite:

cd ./hardhat
npx hardhat test

Note: Must be running on local testnet

Mock Data

Along with testing our contract, we can also add some mock data for demoing the UI. Add mocks with npx hardhat run scripts/mock.js

Future Changes

Some ideas for future enhancements to Twitt3r:

  • Suite of unit tests
  • Live demonstration video
  • Gasless "likes" using wallet signatures
  • Display messages from multiple networks simultaneously
  • Private DMs that only the sender/receiver can decrypt
  • Overhaul frontend to take advantage of Lens Protocol 🌿

Contributions

PRs are always welcome, please tag me when you're ready for merge.