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.
Ensure that you have the following installed:
- Rust (via rustup)
- Cosmwasm (check out the Cosmwasm documentation)
- Node.js (for TypeScript integration tests)
- Yarn (as an alternative package manager)
- Docker (to manage images)
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
: Runclippy
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.
To run the integration tests located in the integration_tests
directory:
- Ensure you have Node.js and Yarn installed and you have build the Typescript client
- Navigate to the
integration_tests
folder and install the dependencies:cd integration_tests yarn install
- Prepare the necessary Docker images with:
yarn build-images
- Run the tests using the Vitest framework:
yarn test
This project is licensed under the MIT License. See the LICENSE
file for more details.