Improve safety of CaveatBuilder interface#24
Merged
Conversation
- rename allowEmptyCaveats to allowInsecureFullAuthorityDelegations - require allowInsecureFullAuthorityDelegations when signing and creating delegations
d350250 to
420b110
Compare
420b110 to
f002d56
Compare
hanzel98
reviewed
Jul 9, 2025
hanzel98
reviewed
Jul 9, 2025
hanzel98
reviewed
Jul 9, 2025
hanzel98
reviewed
Jul 9, 2025
hanzel98
previously approved these changes
Jul 9, 2025
hanzel98
approved these changes
Jul 9, 2025
Jekyle94444
approved these changes
Aug 5, 2025
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.
📝 Description
Improves the safety of the caveat builder interface, to reduce the likelihood of insufficiently restricted delegations being signed.
🔄 What Changed?
List the specific changes made:
allowEmptyCaveatstoallowInsecureUnrestrictedDelegationallowInsecureUnrestrictedDelegationwhen creating and signing delegations with no caveatscalldataparameter in @metamask/delegation-core (previously included somecallDataparameters)🚀 Why?
This is the first in a number of changes aimed at reducing the likelihood of insufficiently restricted delegations being created and signed.
allowInsecureUnrestrictedDelegationis a more meaningful flag thanallowEmptyCaveats, and stands out as a red flag to developers.🧪 How to Test?
Describe how to test these changes:
allowInsecureUnrestrictedDelegationand expect success.allowInsecureUnrestrictedDelegationand expect success.There is good existing and new unit test coverage over this functionality.
allowInsecureUnrestrictedDelegationmust be passed to emptycaveatBuidlers, calls tocreateDelegationandsignDelegation📋 Checklist
Check off completed items:
🔗 Related Issues
Link to related issues:
Closes #
Related to #
📚 Additional Notes
Code snippet for each caveat builder
Allowed Calldata
Allowed Methods
Allowed Targets
Args Equality Check
Block Number
Deployed
ERC1155 Balance Change
ERC20 Balance Change
ERC20 Period Transfer
ERC20 Streaming
ERC20 Transfer Amount
ERC721 Balance Change
ERC721 Transfer
Exact Calldata
Exact Calldata Batch
Exact Execution
Exact Execution Batch
ID
Limited Calls
Multi Token Period
Native Balance Change
Native Token Payment
Native Token Period Transfer
Native Token Streaming
Native Token Transfer Amount
Nonce
Ownership Transfer
Redeemer
Specific Action ERC20 Transfer Batch
Timestamp
Value LTE