Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Contributor Covenant Code of Conduct

## Our Pledge

We are committed to providing a harassment-free, inclusive environment for everyone.

## Our Standards

### Positive Behaviors

- Treating all people with respect
- Offering and accepting constructive feedback
- Focusing on collaboration
- Showing empathy towards others

### Unacceptable Behaviors

- Harassment and discrimination
- Offensive comments
- Personal attacks
- Public or private harassment
- Sharing others' private information
- Unprofessional conduct

## Responsibilities

Project maintainers will:

- Clarify conduct standards
- Handle complaints fairly
- Remove or edit inappropriate contributions
- Enforce these guidelines

## Reporting Issues

Report misconduct to emmanuelpaul152@gmail.com
All complaints will be reviewed and investigated.

## Enforcement

Consequences for violations may include:

- Verbal warning
- Temporary ban
- Permanent project exclusion

## Attribution

This Code of Conduct is adapted from the Contributor Covenant, version 2.1.
72 changes: 72 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Contributing to Bitcoin Yield Aggregator

## Welcome Contributors!

We appreciate your interest in contributing to the Bitcoin Yield Aggregator Smart Contract project. This document provides guidelines for contributing effectively.

## Code of Conduct

We are committed to providing a friendly, safe, and welcoming environment for all contributors. Please review our [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md).

## How to Contribute

### Reporting Bugs

1. Check existing issues to avoid duplicates
2. Use the bug report template
3. Provide detailed information
- Clarity version
- Steps to reproduce
- Expected vs. actual behavior
- Any error messages

### Feature Requests

1. Check existing issues
2. Clearly describe the proposed feature
3. Explain the use case and potential implementation

### Pull Request Process

1. Fork the repository
2. Create a feature branch
3. Write clear, concise commit messages
4. Ensure code follows project standards
5. Add/update tests for new functionality
6. Submit pull request with detailed description

## Development Setup

1. Install Clarinet
2. Clone the repository
3. Run `clarinet test` to verify setup
4. Create a new branch for your changes

## Smart Contract Development Guidelines

- Follow Clarity best practices
- Write clear, commented code
- Implement comprehensive error handling
- Add unit tests for new functions
- Perform security audits before complex changes

## Code Review Process

- All submissions require review
- Provide constructive feedback
- Be respectful and inclusive
- Focus on code quality and security

## Communication

- Join our community discussions
- Use GitHub issues for tracking
- Be patient and collaborative

## Recognition

Contributors will be acknowledged in the project's documentation.

## Questions?

Open an issue or reach out to the maintainers.
30 changes: 14 additions & 16 deletions Clarinet.toml
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
[project]
name = "bitcoin-yield-aggregator"
description = ""
name = 'bitcoin-yield-aggregator'
description = ''
authors = []
telemetry = true
cache_dir = "./.cache"

# [contracts.counter]
# path = "contracts/counter.clar"

cache_dir = './.cache'
requirements = []
[contracts.bitcoin-yield]
path = 'contracts/bitcoin-yield.clar'
clarity_version = 2
epoch = 2.5
[repl.analysis]
passes = ["check_checker"]
check_checker = { trusted_sender = false, trusted_caller = false, callee_filter = false }
passes = ['check_checker']

# Check-checker settings:
# trusted_sender: if true, inputs are trusted after tx_sender has been checked.
# trusted_caller: if true, inputs are trusted after contract-caller has been checked.
# callee_filter: if true, untrusted data may be passed into a private function without a
# warning, if it gets checked inside. This check will also propagate up to the
# caller.
# More informations: https://www.hiro.so/blog/new-safety-checks-in-clarinet
[repl.analysis.check_checker]
strict = false
trusted_sender = false
trusted_caller = false
callee_filter = false
21 changes: 21 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# MIT License

Copyright (c) 2024 Emmanuel Paul

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.
76 changes: 76 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Bitcoin Yield Aggregator Smart Contract

## Overview

The Bitcoin Yield Aggregator is a Clarity smart contract designed to manage and aggregate Bitcoin yield across multiple protocols on the Stacks blockchain. This contract allows users to deposit Bitcoin, track yields from different protocols, and withdraw their funds with accrued returns.

## Features

- Multi-protocol yield aggregation
- Secure deposit and withdrawal mechanisms
- Dynamic protocol management
- Risk management through protocol deactivation
- Configurable yield calculations

## Prerequisites

- Stacks Blockchain
- Clarinet (for local development and testing)
- Basic understanding of Clarity smart contracts

## Installation

1. Clone the repository
2. Install Clarinet
3. Run `clarinet console` to interact with the contract

## Contract Capabilities

- Add and manage yield protocols
- Deposit funds into supported protocols
- Calculate yield based on protocol APY
- Withdraw funds and yields
- Deactivate protocols for risk management

## Security Measures

- Owner-only protocol management
- Input validation for all functions
- Maximum deposit and protocol limits
- Protocol activity tracking

## Supported Protocols

- Stacks Core Protocol
- Bitcoin Yield Plus

## Usage Example

```clarity
;; Deposit into a protocol
(contract-call? .bitcoin-yield deposit u1 u10000)

;; Calculate yield
(contract-call? .bitcoin-yield calculate-yield u1 tx-sender)

;; Withdraw funds
(contract-call? .bitcoin-yield withdraw u1 u5000)
```

## Risks and Considerations

- Yield calculations are simplified
- Actual returns may vary
- Smart contract interactions carry inherent blockchain risks

## Contributing

Please read our [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduct and the process for submitting pull requests.

## License

This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details.

## Support

For support, please open an issue in the GitHub repository.
51 changes: 51 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Security Policy

## Supported Versions

| Version | Supported |
| ------- | ------------------ |
| 1.0.x | :white_check_mark: |
| < 1.0 | :x: |

## Reporting a Vulnerability

1. Do NOT open public GitHub issues for security vulnerabilities
2. Email emmanuelpaul152@gmail.com with details
3. Include:
- Vulnerability description
- Potential impact
- Steps to reproduce
- Suggested mitigation

## Security Best Practices

- Regular code audits
- Comprehensive testing
- Minimal external dependencies
- Input validation
- Error handling
- Principle of least privilege

## Smart Contract Security Considerations

- Prevent integer overflow/underflow
- Validate all inputs
- Implement access controls
- Use safe mathematical operations
- Limit external contract interactions

## Response Process

1. Acknowledge receipt within 48 hours
2. Investigate vulnerability
3. Develop mitigation strategy
4. Create and test patch
5. Coordinate responsible disclosure

## Reward Program

Critical vulnerabilities may be eligible for bounties.

## Disclaimer

While we strive for security, no system is completely immune to risks.
Loading