https://github.com/hadronlabs-org/drop-contracts
Drop is an integrated cross-chain liquid staking protocol
https://github.com/hadronlabs-org/drop-contracts
Last synced: over 1 year ago
JSON representation
Drop is an integrated cross-chain liquid staking protocol
- Host: GitHub
- URL: https://github.com/hadronlabs-org/drop-contracts
- Owner: hadronlabs-org
- License: apache-2.0
- Created: 2023-08-08T10:51:51.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-10-29T08:35:53.000Z (over 1 year ago)
- Last Synced: 2024-10-29T09:53:10.303Z (over 1 year ago)
- Language: Rust
- Homepage: https://drop.money
- Size: 10.9 MB
- Stars: 35
- Watchers: 8
- Forks: 11
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ccamel - hadronlabs-org/drop-contracts - Drop is an integrated cross-chain liquid staking protocol (Rust)
README
# Drop Protocol Contracts

This repository contains the smart contracts of Drop Protocol. The project is organized into three main directories:
- `contracts`: This directory contains the core smart contracts for the Drop Protocol, written in Rust using the Cosmwasm framework.
- `integration_tests`: This directory includes comprehensive integration tests written in TypeScript and leveraging the Vitest testing framework. These tests verify the contracts' behavior in various scenarios, ensuring correctness and reliability.
- `packages`: This directory contains reusable Rust packages that are shared across different contracts or tools. It helps modulate and streamline the codebase.
## Getting Started
### Prerequisites
Ensure that you have the following installed:
- Rust (via [rustup](https://rustup.rs/))
- Node.js (for TypeScript integration tests)
- Yarn (as an alternative package manager)
- Docker (to manage images)
### Building Contracts
All build, test, and code quality tasks are managed using `make`. Below are the primary commands:
- `make build`: Compile the contracts to WebAssembly (Wasm) format.
- `make check_contracts`: Verify all contracts for issues.
- `make clippy`: Run `clippy` for Rust linting and suggestions.
- `make compile`: Compile the contracts to the Wasm target.
- `make compile_arm64`: Compile for the ARM64 architecture.
- `make fmt`: Format the Rust code.
- `make schema`: Generate and validate JSON schemas.
- `make test`: Run all tests to ensure contract correctness.
- `make build_ts_client`: Build the TypeScript client for the integration tests and coordinator. It uses generated json schema from the contracts.
### Running Integration Tests
To run the integration tests located in the `integration_tests` directory:
1. Ensure you have Node.js and Yarn installed and you have build the Typescript client
2. Navigate to the `integration_tests` folder and install the dependencies:
```bash
cd integration_tests
yarn install
```
3. Prepare the necessary Docker images with:
```bash
yarn build-images
```
4. Run the tests using the Vitest framework:
```bash
yarn test
```
## License
This project is licensed under the MIT License. See the `LICENSE` file for more details.