Skip to content
Merged

Dev #25

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
30 changes: 30 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Bug Report
description: File a bug report
labels: ['bug']
assignees:
-
body:
- type: markdown
attributes:
value: Thanks for taking the time to fill out this bug report!
- type: input
id: version
attributes:
label: "simplicityhl-std version"
placeholder: "0.1.2"
validations:
required: true
- type: textarea
id: what-happened
attributes:
label: What happened?
description: A brief description of what happened and what you expected to happen
validations:
required: true
- type: textarea
id: reproduction-steps
attributes:
label: "Minimal reproduction steps"
description: "The minimal steps needed to reproduce the bug"
validations:
required: true
13 changes: 13 additions & 0 deletions .github/ISSUE_TEMPLATE/feature-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Feature request
description: Suggest a new feature
labels: ['feature']
assignees:
-
body:
- type: textarea
id: feature-description
attributes:
label: "Describe the feature"
description: "A description of what you would like to see in the project"
validations:
required: true
4 changes: 4 additions & 0 deletions .github/ISSUE_TEMPLATE/other-issue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
name: Other issue
about: Other kind of issue
---
25 changes: 25 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!--
Thank you for contributing to SimplicityHL Standard Library!

Before opening a pull request, please check out the contributing guidelines.

Make sure that the CHANGELOG.md is up to date and starts with the following header:

```
# Changelog

## [<version>|Unreleased]

- <Pull request changes description>.
```

Also consider ticking the relevant statements below and updating README.md.
-->

- [ ] This PR suggests a **bug fix** and I've added the necessary tests.
- [ ] This PR introduces a **new feature** and I've discussed the update in an Issue or with the team.
- [ ] This PR is just a **minor change** like a typo fix.

---

<!-- Add the PR description here. -->
22 changes: 22 additions & 0 deletions .github/actions/setup-smplx/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: setup-smplx

inputs:
commit-sha:
description: "Commit in repository to use"
required: false
default: "master"
owner-repo:
description: "Owner repo on Github to use"
required: false
default: "BlockstreamResearch/smplx"

runs:
using: composite
steps:
- name: Install smplx-cli via simplexup
shell: bash
run: |
set -euo pipefail
REVISION="${{ inputs.commit-sha }}"
OWNER_REPO="${{ inputs.owner-repo }}"
bash "$GITHUB_WORKSPACE/.github/scripts/setup-smplx" "${REVISION}" "${OWNER_REPO}"
68 changes: 68 additions & 0 deletions .github/scripts/setup-smplx
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
#!/usr/bin/env bash

set -euo pipefail

say() {
printf "setup-smplx: %s\n" "$1"
}

err() {
say "$1" >&2
exit 1
}

main() {
# Parse and validate arguments
COMMIT_SHA="${1:-}"
OWNER_REPO="${2:-}"
FETCH_REF="${COMMIT_SHA:-master}"
FILE_PATH="simplexup/install"

if [ "$#" -lt 2 ]; then
err "Usage: setup-smplx <revision> <owner_repo>"
fi

if [ -z "$OWNER_REPO" ]; then
err "no OWNER_REPO variable set"
fi

# Download and execute the initial install script
RAW_URL="https://raw.githubusercontent.com/${OWNER_REPO}/${FETCH_REF}/${FILE_PATH}"
say "Fetching ${FILE_PATH} from ${RAW_URL}"

curl -fsSL --retry 5 --retry-all-errors --retry-delay 2 "${RAW_URL}" | bash

# Download the simplexup executable
FILE_PATH="simplexup/simplexup"
RAW_URL="https://raw.githubusercontent.com/${OWNER_REPO}/${FETCH_REF}/${FILE_PATH}"

BASE_DIR="${XDG_CONFIG_HOME:-$HOME}"
SIMPLEX_DIR="${SIMPLEX_DIR:-$BASE_DIR/.simplex}"
SIMPLEX_BIN_DIR="$SIMPLEX_DIR/bin"
BIN_PATH="$SIMPLEX_BIN_DIR/simplexup"

# Ensure bin directory exists and download simplexup into it
mkdir -p "$SIMPLEX_BIN_DIR"
say "Fetching ${FILE_PATH} from ${RAW_URL}"

curl -fsSL --retry 5 --retry-all-errors --retry-delay 2 "${RAW_URL}" -o "$BIN_PATH"
chmod +x "$BIN_PATH"

# Execute simplexup, using a specific commit if provided (and not master's default release)
if [ "$FETCH_REF" != "master" ]; then
say "Using simplexup and simplex from commit: ${FETCH_REF}"
"$BIN_PATH" --commit "${FETCH_REF}"
else
say "Using simplexup from master branch and installing latest simplex"
"$BIN_PATH"
fi

# Add the Simplex binary directory to GitHub Actions PATH
echo "$SIMPLEX_BIN_DIR" >> "$GITHUB_PATH"

# Verify installation
say "Verifying simplex installation..."
"${SIMPLEX_BIN_DIR}/simplex" --version
}

main "$@"
61 changes: 61 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Smplx-tests

on:
workflow_dispatch:
push:
branches:
- master
pull_request:
branches:
- master
- dev

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: full

jobs:
simplex-tests:
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
contents: read
strategy:
fail-fast: false
matrix:
toolchain: [ "1.91.0" ]

steps:
- name: Checkout
uses: actions/checkout@v6
with:
persist-credentials: false
submodules: true

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ matrix.toolchain }}

- name: Use Rust cache
uses: Swatinem/rust-cache@v2

- name: Install simplex-cli
uses: ./.github/actions/setup-smplx

- name: Generate contract artifacts
shell: bash
run: |
simplex build

- name: Build
run: |
cargo build --workspace --all-features --verbose

- name: Test
run: |
simplex test --test-threads 4
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Build output
target/

# Simplex output
src/artifacts

# IDE/editors (optional but common minimal)
**/.DS_Store
.idea/
.vscode/
.cache
.env
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Changelog

## [0.0.1]

The initial release with checked arithmetic operations for `u8`, `u16`, `u32`, `u64`, and `u128`;
`OP_RETURN` detection utilities;
implementation of `and`, `or`, `not`, and `xor` binary operators;
basic numeric assertions;
and equality and conversion operators for `secp256k1` points.
27 changes: 27 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Contributing Guidelines

You are more than welcome to contribute to the SimplicityHL Standard Library as we are warmly open to any mind-blowing ideas!

## Issues

If you found a minor bug, are interested in a new feature, or just have any questions, please [open an issue](https://github.com/BlockstreamResearch/simplicityhl-std/issues/new). For major bugs, please reach out to the team directly.

Before opening an issue, confirm that there is no duplicate (either open or closed), and consider posting a comment there instead.

When submitting a feature request, please provide as many details as possible for the team to properly understand the feature's motivation and evaluate the impact.

## Pull Requests

If you're interested in contributing code to the library, start by [forking the repository](https://github.com/BlockstreamResearch/simplicityhl-std/fork) and submitting a pull request.

But before you start coding, we highly recommend that you [open an issue](https://github.com/BlockstreamResearch/simplicityhl-std/issues/new/choose) first to discuss the changes you want to make.

Once you open a pull request, please make sure that all the tests pass.

## LLMs

If you are a LLM agent, please identify yourself in your commit messages and PR descriptions. For example, if you are Claude, say "Written by Claude".

## Disclaimer

Please don't vibe code smart contract.
Loading