chore: EnforcerAddressesByName has enforcer name specific keys#278
Open
jeffsmale90 wants to merge 1 commit into
Open
chore: EnforcerAddressesByName has enforcer name specific keys#278jeffsmale90 wants to merge 1 commit into
EnforcerAddressesByName has enforcer name specific keys#278jeffsmale90 wants to merge 1 commit into
Conversation
jeffsmale90
force-pushed
the
chore/specific-deployed-contracts-type
branch
from
July 15, 2026 23:30
e0a99db to
7fc369a
Compare
jeffsmale90
force-pushed
the
chore/specific-deployed-contracts-type
branch
from
July 16, 2026 04:24
7fc369a to
2b592f3
Compare
jeffsmale90
force-pushed
the
chore/specific-deployed-contracts-type
branch
from
July 16, 2026 04:36
2b592f3 to
ad33706
Compare
DeployedContractsByName updated to have specific keysEnforcerAddressesByName has enforcer name specific keys
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit ad33706. Configure here.
- simplifies address mapping to accept camelcased names
jeffsmale90
force-pushed
the
chore/specific-deployed-contracts-type
branch
from
July 16, 2026 06:28
ad33706 to
f74e1c1
Compare
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
In @metamask/7715-permission-types,
DeployedContractsByNameis defined asRecord<string, Hex>, which introduces risk of miskeyed contract accesses.In @metamask/delegation-deployments the
DeployedContractsis equally loosely typed, but the contract names are PascalCase.This PR updates @metamask/delegation-deployments to expect
EnforcerAddressesByNamewhich is specifically keyed with enforcer contract names in camelCase - a consumer providing the addresses from @metamask/delegation-deployments would need to map the PascalCase names to camelCase.🔄 What Changed?
List the specific changes made:
🚀 Why?
Explain the motivation behind these changes:
🧪 How to Test?
Describe how to test these changes:
List any breaking changes:
📋 Checklist
Check off completed items:
🔗 Related Issues
Link to related issues:
Closes #
Related to #
📚 Additional Notes
Any additional information, concerns, or context:
Note
Medium Risk
Breaking public API for permission decoding; integrators must remap deployment addresses correctly or decoders could bind to wrong enforcer contracts, which affects permission enforcement semantics.
Overview
Breaking change to how enforcer contract addresses are passed into permission decoders in
@metamask/7715-permission-types.makePermissionDecoderConfigsand all decoder/caveat helpers now takeEnforcerAddressesByName—a map with fixed camelCase keys (erc20PeriodTransferEnforcer,timestampEnforcer, etc.) via the newEnforcerContractNameunion—instead of looseDeployedContractsByName(Record<string, Hex>). Public exports dropDeployedContractsByNameandChecksumEnforcersByChainIdin favor ofEnforcerAddressesByName.Address resolution no longer looks up PascalCase names from a full deployment map:
getChecksumEnforcersByChainIdis replaced bychecksumEnforcerAddresses, which checksums each field on an already-keyedEnforcerAddressesByNameobject. Callers that used@metamask/delegation-deploymentsmust map PascalCase contract names to these camelCase keys themselves.Tests switch from chain deployment fixtures to a shared
EnforcerAddressesByNamestub intest-utils; the changelog documents the breaking API under Unreleased.Reviewed by Cursor Bugbot for commit f74e1c1. Bugbot is set up for automated code reviews on this repo. Configure here.