Add simulate-before-send pattern to all skill examples#5
Merged
critesjosh merged 1 commit intomainfrom Mar 2, 2026
Merged
Conversation
Without .simulate() before .send(), failing Aztec transactions hang
for up to 600s with opaque errors. .simulate() surfaces revert reasons
instantly. This adds the pattern to all ~60 .send() calls across 15
skill files plus documents it in CLAUDE.md.
Transformation rules applied:
- Standard sends: add .simulate({ from }) before .send()
- Deploy chains: break .deploy().send() into variable, simulate, send
- Account deploys: break getDeployMethod().send() chains similarly
- Error tests: replace .send() with .simulate() entirely
- Helper functions: add .simulate() inside before .send()
- Parallel sends: simulate all upfront, then send in parallel
- AuthWit: simulate without authWitnesses (only from)
Refs: AztecProtocol/aztec-starter#245
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.
Summary
.simulate()before every.send()call across all 15 TypeScript skill files (~60 instances).simulate()surfaces revert reasons instantlyTransformation rules applied
.simulate({ from })before.send().deploy().send()→ variable, simulate, sendgetDeployMethod().send()→ variable, simulate, send.send()with.simulate()entirely.simulate()inside before.send()authWitnesses(onlyfrom)Key constraints followed
.simulate()only uses{ from }— nofee,wait, orauthWitnessesdeployRequestfor contract deploys,deployMethodfor account deploysMotivation
Since this plugin is referenced by the Aztec MCP server, these examples directly influence how AI agents write Aztec code. Ref: aztec-starter#245
Test plan
grep -r '\.deploy(.*).send(' skills/returns 0 results (all deploy chains broken)grep -r 'getDeployMethod()).send(' skills/returns 0 results (all inline chains broken).simulate()calls includefee,wait, orauthWitnessesparams.simulate()instead of.send()🤖 Generated with Claude Code