Repository navigation
feat(sdk): check conditions on nested calldata before they are applied - #13
Merged
Merged
Conversation
targetIntegrity now also rejects two kinds of condition whose safety depends on the contract receiving the call: - calldataMatches / abiEncodedMatches on calldata nested in a `bytes` parameter - a bitmask on a `bytes` value that expects the last bytes it checks to be zero The error links a new docs page, general/nested-calldata, which says what to check, and reports an acknowledgement. Once checked, a condition passes with `acknowledged: [acknowledgement]`, in targetIntegrity's options or in the permissions posted to the Roles app. An acknowledgement covers the condition on one function of one target only. The app runs the check on every condition it adds and shows the error on the diff page. conditionHash now hashes with ethers' sha256 (same output), so the check also runs in the browser. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DvEkN8jKo5TwdxzerGzeoG
jfschwarz
approved these changes
Nov 25, 2026
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.
Adds a check to
targetIntegrityfor two kinds of condition whose safety depends on the contract that receives the call:calldataMatches/abiEncodedMatcheson calldata nested in abytesparameterbitmaskon abytesvalue that expects the last bytes it checks to be zeroMost such permissions are fine. The new docs page, Nested Calldata (
general/nested-calldata), explains the edge case and what to check on the receiving contract.Acknowledging a checked condition. The error (
ReadingIntegrityError) links the docs page and reports anacknowledgement. Once the receiving contract is checked, the condition passes with:targetIntegrity(targets, { acknowledged: [...] }), or"acknowledged": [...]in the permissions posted to the Roles app.An acknowledgement covers that condition on one function of one target. The same condition elsewhere, or a changed condition, is checked again.
Roles app:
planApplyRoleruns the check on every condition it adds. Conditions already on chain are left alone.acknowledgedthrough.Also:
conditionHashnow uses ethers'sha256instead of Node'scrypto(same output), so the check runs in the browser too.Tests: 348 SDK tests pass, including new ones for the check, acknowledgements and their scope, and the bitmask rule. The 24 app tests pass, and the app builds. Type errors in the SDK swaps files and the app (
ChainIcon,derivePermissions.test) are the same as on main.🤖 Generated with Claude Code
https://claude.ai/code/session_01DvEkN8jKo5TwdxzerGzeoG