A web3 decentralized social platform built on the Ethereum blockchain
- Tweeting: Users can create, edit, and delete tweets.
- Contract Management: Owners can update settings, pause and unpause the contract.
- Lottery System: Tweeting offers a chance to win a bet.
- Tweet Clearing: Owners can clear all tweets in extreme cases.
- Information & Logging: The contract's status can be checked and key events are logged.
- Funding: The contract can be funded for bet payouts, with a withdrawal option for owners.
Built with the following technologies:
-
frontend
- wagmi.sh: React hooks for Ethereum
- RainbowKit: React components for connecting wallets
- Next.js: Static site builds and routing
- Tailwind: Adaptive CSS page styling
-
smart contract
- Hardhat: Smart contract development and testing
- openzeppelin: an framework for building secure and auditable smart contracts
-
Vercel: Web hosting and automatic deployments
https://tmac-twitt3r.netlify.app
https://i.imgur.com/WnSkTgw.gif
Use AI to generate spec.md for main file
smol-dev-js setup
smol-dev-js code2spec
[spec](./spec/)
├─hardhat
│ └─contracts
│ Twitt3r.sol.md
│
└─react
├─components
│ Address.tsx.md
│ AppProvider.tsx.md
│ Avatar.tsx.md
│ Controls.tsx.md
│ EditModal.tsx.md
│ Editor.tsx.md
│ Layout.tsx.md
│ Nav.tsx.md
│ ReplyModal.tsx.md
│ Sidebar.tsx.md
│ Tweet.tsx.md
│ TweetList.tsx.md
│ TweetModal.tsx.md
│
└─pages
404.tsx.md
index.tsx.md
[address].tsx.md
- Etherscan API key
- Infura API key(s) for your chosen networks
Update .env file, and then:
git clone https://github.com/maxpetretta/twitt3r.xyz
cd twitt3r.xyz/hardhat
npm install
npx hardhat node
npx hardhat run scripts/deploy.js --network <NETWORK_NAME>
npx hardhat verify --network <NETWORK_NAME> <CONTRACT_ADDRESS> "10" "1000000000000000" "100000000000000000"
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
cd ./hardhat
npx hardhat test