Skip to content
Merged
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
87 changes: 43 additions & 44 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 8 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
[package]
name = "simplicityhl_std"
name = "simplicityhl-std"
edition = "2024"
rust-version = "1.91.0"
version = "0.1.0"
description = "SimplicityHL Standard Library"
license = "MIT"
repository = "https://github.com/BlockstreamResearch/simplicityhl-std"
readme = "README.md"
keywords = ["simplicity", "liquid", "elements", "smart-contracts"]
categories = ["cryptography::cryptocurrencies"]

[dependencies]
smplx-std = "0.0.8"

[dev-dependencies]
anyhow = { version = "1.0.101" }
rand = { version = "0.8.6" }
primitive-types = { version = "0.14" }
71 changes: 70 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,68 @@ This repository contains the standard library for [SimplicityHL](https://github.
> [!NOTE]
> The VS Code syntax-highlighting extension does not yet support modules and imports, so you may see spurious errors when editing files in this repo.

## Modules:

- asserts
- logical_operations
- op_return
- u8
- u16
- u32
- u64
- u128

---
`Asserts`

Generic assertion helpers with equality checks between uint values and validation of Option uint variants.

---
`Logical operations`

Basic boolean logic operations: and, or, not.

---
`OP_RETURN`

Utilities for detecting and enforcing OP_RETURN (null data) outputs.

---
`u8`

Operations for the u8 type:
- overflow-checked arithmetic operations;
- comparison helpers.

---
`u16`

Operations for the u16 type:
- overflow-checked arithmetic operations;
- comparison helpers.

---
`u32`

Operations for the u32 type:
- overflow-checked arithmetic operations;
- comparison helpers.

---
`u64`

Operations for the u64 type:
- overflow-checked arithmetic operations;
- comparison helpers.

---
`u128`

Operations for the u128 type:
- overflow-checked arithmetic operations;
- comparison helpers;
- basic operations that are available as jets for `u8`-`u64` but are missing for `u128`.

## Installation

Install `simplexup`, then use it to install the pinned Simplex toolchain:
Expand All @@ -14,7 +76,14 @@ curl -L https://smplx.simplicity-lang.org | bash
simplexup
```

## Usage
```bash
simplex install simplicityhl-std
```

> [!NOTE]
> Library works with Simplex version 0.0.7 or higher.

## Contributing

### Build

Expand Down