BitBase is a decentralized application (dApp) that enables users to manage their Bitcoin-based tokens using the Stacks blockchain, providing a sleek dashboard for viewing balances, transferring tokens, and tracking transaction history. Built with Clarity smart contracts and a React-based frontend, BitBase leverages Bitcoin's security while providing flexible features on a Layer 2 solution.
- View Wallet Balance: Display wallet balances securely using Stacks API.
- Token Transfers: Execute secure token transfers between wallets via Clarity smart contracts.
- Transaction History: View recent transaction history and blockchain interactions.
- Smart Contract: Clarity for contract logic and token management.
- Frontend: React.js for a modern and responsive user interface.
- Blockchain Integration: Stacks.js for interaction between the frontend and the Stacks blockchain.
- Testing: Jest for automated testing of Clarity contracts.
Ensure you have the following software installed:
- Node.js (version 14.x or higher)
- Stacks CLI for deploying and interacting with Clarity contracts.
-
Clone the Repository:
git clone https://github.com/agnes-pro/bitbase.git cd bitbase
-
Install Dependencies:
npm install
Deploy the Clarity smart contract to the Stacks blockchain:
stacks deploy contract clarity/token.clar
Start the React-based frontend for interacting with the contract:
npm start
You can now access the dashboard locally at http://localhost:3000
to view balances, send tokens, and interact with transactions.
The project is organized as follows:
bitbase/
├── clarity/ # Clarity smart contract code
│ └── token.clar # Smart contract handling token transfers
├── frontend/ # Frontend code
│ ├── src/ # React components and logic
│ └── public/ # Static assets
├── tests/ # Unit tests for the smart contract
├── README.md # Documentation
└── package.json # Project metadata and dependencies
Follow a feature-based branching strategy for development:
main
: Production-ready code.feature/*
: Development branches for specific features (e.g.,feature/smart-contract
,feature/frontend-ui
).
Write descriptive commit messages. Example format:
feat: added token transfer functionality
fix: corrected balance display issue
Ensure each pull request (PR) includes:
- A detailed description of the changes.
- The issue or feature it addresses.
- Screenshots (if applicable) and testing notes.
Automated tests are critical for ensuring contract reliability. To run the tests:
npm run test
Tests will cover:
- Clarity Contract: Unit tests for token transfer, wallet interactions, and error handling.
- Frontend: Integration tests for user actions (e.g., viewing balances, transferring tokens).
Security is a top priority. The smart contract includes:
- Transfer Validations: Prevent unauthorized token transfers.
- Revert on Failures: Safeguard transactions to ensure state consistency.
During development, ensure your keys and sensitive information are not exposed. Use .env
files for environment-specific settings and avoid committing them.
We welcome contributions! Follow these steps to contribute:
- Fork the repository.
- Create a new branch for your feature:
git checkout -b feature/your-feature
- Implement your changes.
- Submit a detailed pull request, explaining your contribution.
Ensure that your code adheres to the project's coding standards and passes all tests before submitting.
This project is licensed under the MIT License. See the LICENSE
file for details.
MIT License
Copyright (c) 2024 Agnes Umanah
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
For any questions, feel free to reach out via email at tweetsonly7@gmail.com.