Repository navigation
Escrow: describe the degenerate-offer checks the program now makes - #191
Merged
Merged
Conversation
quicknode/solana-program-examples#169 added them: make_offer() refuses a zero amount on either side with ZeroAmount, and a same-token offer is refused by Anchor's duplicate-writable-account check before the handler runs. Name both and the tests that check them, in place of the paragraph that said a production escrow should add them. Claude-Session: https://claude.ai/code/session_01JGEoAUjMm7Evv69k46eNcn
mikemaccana
pushed a commit
that referenced
this pull request
Sep 30, 2026
Keeps this branch's abandoned-offer sentence and main's degenerate-offers bullet from #191. Claude-Session: https://claude.ai/code/session_01JGEoAUjMm7Evv69k46eNcn
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.
The Escrow chapter's "Degenerate offers" item said two checks "belong in any escrow headed to production", which described a flaw the companion program had. quicknode/solana-program-examples#169 has now merged and fixes it, so, following CLAUDE.md, the chapter describes the fix and names the tests:
make_offer()refuses an offer of zero tokens on either side withZeroAmount. This is checked bytest_make_offer_rejects_zero_offered_amountandtest_make_offer_rejects_zero_wanted_amount.ConstraintDuplicateMutableAccount.test_make_offer_rejects_same_mintchecks this.Every name above exists in
finance/escrow/anchoron the companion repository'smain.npm run lintandnpm run build-pdfpass.This is independent of quicknode/solana-book#190, which doesn't touch this paragraph.
🤖 Generated with Claude Code
https://claude.ai/code/session_01JGEoAUjMm7Evv69k46eNcn
Generated by Claude Code