PR for Build error-trigger smart contract (#72)#88
Merged
Ibinola merged 3 commits intoIbinola:mainfrom Feb 24, 2026
Merged
Conversation
Owner
|
looks good @clintjeff2 |
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
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.
feat: build error-trigger smart contract (#72)
Closes #72
Summary
Implements the
error-triggerSoroban smart contract introduced in issue #72. The contract is purpose-built to validate error boundaries and diagnostic tooling by failing in controlled, predictable ways.Changes
New files
contracts/error-trigger/Cargo.toml— Rust package manifest; targetswasm32-unknown-unknownwith release optimisations suitable for Soroban deployment.contracts/error-trigger/src/lib.rs— Contract implementation.Contract details
Custom error enum (
#[contracterror])InvalidInput1Unauthorized2Overflow3Exported functions
trigger_panic(env)panic!()→ VM traptrigger_assert(env, value)assert!(value == 0)→ VM trap whenvalue != 0trigger_custom_error(env, code)Err(Error::*)mapped fromcode(1–3), orOk(code)otherwiseProof of compilation
How to get the attachment
Run the build yourself and capture the terminal output:
cd contracts/error-trigger cargo build --target wasm32-unknown-unknown --releaseExpected last line:
Steps to screenshot:
Compiling error-trigger …line and theFinished …line.PrtScnorShift+PrtScnto capture a region; the image saves to~/Pictures.Cmd+Shift+4→ drag to select the terminal area.Win+Shift+S→ drag to select, then paste into an image editor and save.Testing
Checklist
wasm32-unknown-unknownwithout warningstrigger_panicproduces a VM trap (panic!)trigger_assertproduces a VM trap when the assertion failstrigger_custom_errorreturns the correctcontracterrorcode for inputs 1–3