Skip to content

babylonlabs-io/babylon-contract

Folders and files

NameName
Last commit message
Last commit date

Latest commit

e355223 · Feb 11, 2025
Sep 29, 2024
Oct 8, 2024
Feb 11, 2025
Feb 5, 2025
Sep 27, 2024
Feb 11, 2025
Dec 2, 2024
Feb 21, 2024
Nov 28, 2024
Feb 11, 2025
Feb 11, 2025
Feb 11, 2025
Aug 30, 2024
Sep 29, 2024
Sep 3, 2024
Nov 28, 2024
Feb 5, 2025

Repository files navigation

Babylon-contract

This repo contains the Wasm smart contract for Babylon integrations. It will be deployed on a Cosmos zone that integrates Babylon, and will maintain BTC timestamps of headers in this Cosmos zone.

Development

Prerequisites

Make sure you have cargo-run-script installed and docker running.

cargo install cargo-run-script

Clean the build

cargo clean

Build the contract

cargo build

Formatting and Linting

Check whether the code is formatted correctly.

cargo fmt --all -- --check
cargo check
cargo clippy --all-targets -- -D warnings

Alternatively, you can run the following command to run all the checks at once.

cargo run-script lint

Test the contract

Note: Requires the optimized contract to be built (cargo optimize)

Runs all the CI checks locally (in your actual toolchain).

cargo test --lib

Integration tests the contract

Note: Requires the optimized contract to be built (cargo optimize)

cargo test --test integration

Alternatively, you can run the following command, that makes sure to build the optimized contract before running the integration tests.

cargo run-script integration

Generate the schema

cargo run-script gen-schema

Generate the protobuf files

cargo run-script gen-proto

Generate test data

cargo run-script gen-data

Build the optimized contract

cargo run-script optimize