Stark Overflow is a decentralized application (dApp) inspired by the concept of Stack Overflow, but with a financial incentive system. Using Starknet technology, this project allows users to ask questions and offer cryptocurrency rewards for the best answers.
- Gamified question-and-answer system.
- Cryptocurrency deposits linked to each question.
- Additional contributions from other users to increase the reward.
- Automatic payment for the answer selected as the solution.
- Frontend built with React and Typescript.
- Smart Contracts written in Cairo for execution on Starknet.
/stark_overflow
│
├── frontend/ # User interfaces
│ |── landing/ # Landing page of the app
| |
│ └── react/ # The frontend of the app made in React
│ |── src/
│ | |── @types
│ | |── assets/ # Images and icons
│ | |── components/ # Reusable components
│ | |── hooks/ # Custom hooks
│ | | |── useStatusMessage.ts # Hook for managing status messages
│ | | └── useWallet.ts # Hook for managing wallet connection
│ | |── pages/ # Main pages of the app
│ | | |── Home/ # Main page of the app
│ | | |── Forum/ # Page for viewing app's forums
│ | | |── QuestionPage/ # Page for asking a question
| | | └── AnswerPage/ # Page for viewing answers to a question and give a new answer
│ | |── providers/ # General context providers for state management
│ | |── services/ # API services
│ | |── styles/ # Global styles and themes
│ | └── utils/ # Utility functions
│ |── App.tsx # Main application component
│ |── main.tsx # Entry point of the React app
| └── router.tsx # Routes of the app
|
├── smartcontract/ # Smart contracts written in Cairo
│ ├── src/ # Contract source code
│ │ ├── events.cairo # Event definitions
│ │ ├── lib.cairo # Entrypoint of the smart contract
│ │ ├── StarkOverflow.cairo # Main contract logic
│ │ ├── structs.cairo # Struct definitions
│ │ |── types.cairo # Type definitions
│ | └── tests/ # Contract tests
│ │ ├── common.cairo # Common test functions
| | └── StarkOverflowTest.cairo # Test cases for the main contract
│ └── Scarb.toml # Scarb project configuration
│
└── README.md # General project documentation
- Node.js v16+
- Yarn or npm
- Scarb (for working with Cairo contracts)
- Starknet CLI
git clone https://github.com/your-username/stark-overflow.git
cd stark-overflow
cd frontend
npm install
# or
yarn install
cd smartcontract
scarb build
cd frontend
npm start
# or
yarn start
cd smartcontract
scarb test
- Install starknet-devnet. tutorial
- Install starknet foundry. tutorial
- Runs starknet-devnet with seed 0:
starknet-devnet seed=0
sncast --profile=devnet declare --contract-name=StarkOverflowToken
sncast --profile=devnet declare --contract-name=StarkOverflow
- Deploy the contracts tutorial
sncast --profile=devnet deploy --clash-hash=[StarkOverflowToken class hash] --salt=0 --arguments "'18', '100000000000000000000', [recipient address], [owner address], '1000000000000000000000'"
sncast --profile=devnet deploy --clash-hash=[StarkOverflow class hash] --salt=0 --arguments "[StarkOverflowToken address]"
- Install starknet-devnet via Docker. tutorial
- Install starknet foundry. tutorial
- Runs the container docker with starknet-devnet seed 0
sncast --profile=devnet declare --contract-name=StarkOverflowToken
sncast --profile=devnet declare --contract-name=StarkOverflow
- Deploy the contracts tutorial
sncast --profile=devnet deploy --clash-hash=[StarkOverflowToken class hash] --salt=0 --arguments "'18', '100000000000000000000', [recipient address], [owner address], '1000000000000000000000'"
sncast --profile=devnet deploy --clash-hash=[StarkOverflow class hash] --salt=0 --constructor-calldata=[StarkOverflowToken address]
- React.js
- Typescript
- Styled-Components
- Cairo (Starknet Language)
- Scarb (Package manager for Cairo projects)
- Fork the project
- Create a branch (
git checkout -b feature/MyFeature
) - Commit your changes (
git commit -m 'Add my feature'
) - Push to the branch (
git push origin feature/MyFeature
) - Open a Pull Request to the development branch
This project is licensed under the MIT License.
Community