chore: Add explainer comment to each permission type caveats.ts
#270
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.
Description
It's critically important that the caveats are encoded correctly. This PR adds an explainer comment to the caveats file outlining the terms encoding, and how they relate to the abi encoding of the allowed function.
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Low Risk
Documentation-only updates in caveat builders; no changes to term construction or enforcement logic, so runtime behavior should be unchanged.
Overview
Adds/expands in-file JSDoc explainers across ERC-20 and native-token permission caveat builders (periodic, streaming, and ERC-20 allowance revocation) to clarify what each enforcer restricts.
For
erc20TokenRevocation, documents the ABI calldata layout forapprove(address,uint256)and howAllowedCalldataEnforcerusesstartIndexto pin the selector and zero amount, plus comments clarifyingValueLteEnforcerusage.Written by Cursor Bugbot for commit 3b77826. This will update automatically on new commits. Configure here.