A decentralized finance protocol built on StarkNet that combines token distribution and payment streaming capabilities. Fundable enables both bulk token distributions and continuous, real-time token streaming with advanced management features.
Fundable Protocol provides two main functionalities:
-
Token Distribution: Efficiently distribute tokens to multiple recipients in either:
- Equal amounts across all recipients
- Custom weighted amounts per recipient
-
Payment Streaming: Create and manage token streams that automatically distribute tokens over time with features like:
- Linear token streaming
- Stream management (pause, restart, cancel)
- Partial withdrawals
- Stream status tracking
The protocol consists of two main components:
- Handles bulk token distributions
- Manages token allowances and transfers
- Emits distribution events
- Supports both equal and weighted distributions
- Manages stream creation and lifecycle
- Handles withdrawals and stream modifications
- Tracks stream states and balances
- Provides stream query functions
- Scarb v2.8.5
- StarkNet Foundry v0.31.0
- Cairo v2.8.3
- Clone the repository
git clone https://github.com/fundable-protocol/fundable.git
cd fundable
- Install dependencies
scarb build
Run the test suite:
snforge test
For verbose output:
scarb test -v
use fundable::distributor::Distributor;
// Create a distribution with equal amounts
let recipients = array![addr1, addr2, addr3];
distributor.distribute_equal(token, total_amount, recipients);
// Create a weighted distribution
let amounts = array![100, 200, 300];
distributor.distribute_weighted(token, recipients, amounts);
use fundable::payment_stream::PaymentStream;
// Create a new stream
let stream = payment_stream.create_stream(
recipient,
total_amount,
start_time,
end_time,
token
);
// Withdraw from stream
payment_stream.withdraw(stream_id, amount);
// Pause stream
payment_stream.pause_stream(stream_id);
We welcome contributions! Please follow these steps:
- Fork the repository
- Create a new branch (
git checkout -b feature/amazing-feature
) - Make your changes and write tests to ensure your changes are working as expected
- Run tests (
snforge test
) - Commit your changes (
git commit -m 'feat: add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
We use Conventional Commits. Examples:
feat: add new streaming feature
fix: handle edge case in calculation
docs: update installation instructions
test: add test for edge case
chore: update dependencies
- Use
snake_case
for functions and variables - Use
PascalCase
for types and traits - Use
SCREAMING_SNAKE_CASE
for constants - Add documentation comments (
///
) for public interfaces - Follow Cairo code style guidelines
For security concerns, please email security@fundable.com or open a draft security advisory on Github.
This project is licensed under the MIT License - see the LICENSE file for details.
- StarkWare for the Cairo programming language
- OpenZeppelin for security best practices and implementations
- The StarkNet community for their continuous support
- Telegram: Join our channel
- Twitter: @fundable