-
Notifications
You must be signed in to change notification settings - Fork 0
Foundry support #26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
bbyalcinkaya
wants to merge
22
commits into
master
Choose a base branch
from
foundry-support
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Foundry support #26
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6958664
to
98fb00c
Compare
031b484
to
fb68459
Compare
472fdce
to
7616bdd
Compare
46d6e33
to
346924c
Compare
e853391
to
16f51cd
Compare
e0d0c5a
to
8a2f2a7
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Foundry Integration for Skribe
skribe build
andskribe run
. Solidity projects are built using Forge under the hood.vm.assume
cheatcode to enable fuzzing.#assume
is implemented using theensures
clause, which only has an effect in symbolic execution.#assume
to work during fuzzing:#assume(true)
acts as a no-op and execution continues normally.#assume(false)
ends execution immediately, treating it as a successful termination (exit code 0), since the path guarded by the assumption is considered infeasible.Integration tests and verification
Integration tests were added to exercise Foundry cheatcodes in various scenarios. Solidity fuzz tests were used to verify that Skribe can successfully build (skribe build) and run (skribe run) Foundry tests end-to-end, ensuring proper handling of state updates, event emission, and returned values. Example tests include:
vm.prank
to simulate calls from different addresses.vm.expectRevert
.vm.expectEmit
.vm.assume
to filter generated fuzzing inputs.Decision Tree Optimizations
Applied several targeted semantics optimizations to reduce the decision tree size from ~1GB to ~665MB.
Simplify
autoalloc.md
: Theautoalloc.md
module is responsible for resolving imports in WASM modules and linking them to host functions. Initially, this was a generic module, but it was specialized for Stylus host function imports.Empty
<stylusvms>
in Skribe commands: Some Skribe commands only apply when there is no active Stylus VM (Wasm) running. Since these commands (e.g.callStylus
,checkOutput
) are executed at the very beginning and end of execution, the<stylusvms>
cell can be assumed empty.Mention
<k>
cell in hostcall rules: Host calls are implemented as internal WASM instructions. During their execution, the<k>
cell typically contains#endWasm
, since the actual execution is being handled in the<instrs>
cell. By making this explicit in the rules, the decision tree was reduced from 800 MB → 690 MB.Installation and Usage
Installation
Install the K framework:
Install the UV Python dependency manager:
Clone the Skribe repository (including submodules) and check out the this branch:
Build the semantics:
Usage
Navigate to the test contract's directory
Build the contract and run the tests: