Skip to content

Conversation

@bbyalcinkaya
Copy link
Member

@bbyalcinkaya bbyalcinkaya commented Dec 2, 2025

This PR introduces the new skribe-rs library, which provides a Rust interface for Foundry cheatcodes and is intended for Skribe users to depend on in their projects.

All existing test contracts are migrated to use this library, removing the per-contract copies of skribe.rs. Alongside the migration, several missing host functions and cheatcodes were implemented and tested. The fuzzing pipeline was also fixed to correctly preserve our recursion limit, which Hypothesis silently reset.

Key additions

  • New skribe-rs library for the cheatcode interface.
  • All test contracts updated to use the shared library.
  • Added integration tests for calling cheatcodes from Stylus.

Implemented host functions

  • account_balance
  • block_timestamp
  • block_number
  • contract_address

Supported & tested cheatcodes

  • deal
  • warp
  • roll
  • load
  • store

Other fixes

  • Applied recursion-limit override inside KometFuzzHandler.handle_test to counter Hypothesis resets.

This PR completes the foundation for cheatcode support in Skribe and expands host function and cheatcode coverage.

@bbyalcinkaya bbyalcinkaya changed the title Skribe Rust library for Cheatcodes skribe-rs Cheatcode Library and Extended Host Function Support Dec 8, 2025
@bbyalcinkaya
Copy link
Member Author

Instructions

1. Install the Kup package manager

bash <(curl https://kframework.org/install)

2. Install skribe

kup install skribe --version skribe-rs-lib

3. Clone the repository and switch to the required branch

git clone git@github.com:runtimeverification/skribe.git --recurse-submodules
cd skribe
git switch skribe-rs-lib

4. Run tests

Foundry contract tested from Stylus

skribe build -C src/tests/integration/data/contracts/test-foundry-from-stylus/
skribe run   -C src/tests/integration/data/contracts/test-foundry-from-stylus/

The Foundry contract used in this test is precompiled.
It is deployed from a .bin file generated using Foundry with the --extra-output-files bin option.

Stylus contract tested from Foundry

skribe build -C src/tests/integration/data/contracts/test-stylus-from-foundry/
skribe run   -C src/tests/integration/data/contracts/test-stylus-from-foundry/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants