From 83fc3ffefc4ea3c0c735fbe0b08c2f89f6a45bea Mon Sep 17 00:00:00 2001 From: maxnorm Date: Fri, 20 Feb 2026 20:08:33 -0500 Subject: [PATCH 1/6] rename owner storage to fit Dimaond --- src/access/Owner/OwnerFacet.sol | 4 ++-- src/access/Owner/OwnerMod.sol | 4 ++-- src/access/OwnerTwoSteps/OwnerTwoStepsFacet.sol | 2 +- src/access/OwnerTwoSteps/OwnerTwoStepsMod.sol | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/access/Owner/OwnerFacet.sol b/src/access/Owner/OwnerFacet.sol index e809bf25..7249942e 100644 --- a/src/access/Owner/OwnerFacet.sol +++ b/src/access/Owner/OwnerFacet.sol @@ -19,10 +19,10 @@ contract OwnerFacet { */ error OwnerUnauthorizedAccount(); - bytes32 constant STORAGE_POSITION = keccak256("compose.owner"); + bytes32 constant STORAGE_POSITION = keccak256("erc173.owner"); /** - * @custom:storage-location erc8042:compose.owner + * @custom:storage-location erc8042:erc173.owner */ struct OwnerStorage { address owner; diff --git a/src/access/Owner/OwnerMod.sol b/src/access/Owner/OwnerMod.sol index a5eb3bd6..ffefc4e3 100644 --- a/src/access/Owner/OwnerMod.sol +++ b/src/access/Owner/OwnerMod.sol @@ -24,10 +24,10 @@ error OwnerUnauthorizedAccount(); */ error OwnerAlreadyRenounced(); -bytes32 constant STORAGE_POSITION = keccak256("compose.owner"); +bytes32 constant STORAGE_POSITION = keccak256("erc173.owner"); /** - * @custom:storage-location erc8042:compose.owner + * @custom:storage-location erc8042:erc173.owner */ struct OwnerStorage { address owner; diff --git a/src/access/OwnerTwoSteps/OwnerTwoStepsFacet.sol b/src/access/OwnerTwoSteps/OwnerTwoStepsFacet.sol index c71259a4..d979acef 100644 --- a/src/access/OwnerTwoSteps/OwnerTwoStepsFacet.sol +++ b/src/access/OwnerTwoSteps/OwnerTwoStepsFacet.sol @@ -24,7 +24,7 @@ contract OwnerTwoStepsFacet { */ error OwnerUnauthorizedAccount(); - bytes32 constant OWNER_STORAGE_POSITION = keccak256("compose.owner"); + bytes32 constant OWNER_STORAGE_POSITION = keccak256("erc173.owner"); /** * @custom:storage-location erc8042:compose.owner diff --git a/src/access/OwnerTwoSteps/OwnerTwoStepsMod.sol b/src/access/OwnerTwoSteps/OwnerTwoStepsMod.sol index fb9027c8..4137d4b3 100644 --- a/src/access/OwnerTwoSteps/OwnerTwoStepsMod.sol +++ b/src/access/OwnerTwoSteps/OwnerTwoStepsMod.sol @@ -28,10 +28,10 @@ error OwnerUnauthorizedAccount(); */ error OwnerAlreadyRenounced(); -bytes32 constant OWNER_STORAGE_POSITION = keccak256("compose.owner"); +bytes32 constant OWNER_STORAGE_POSITION = keccak256("erc173.owner"); /** - * @custom:storage-location erc8042:compose.owner + * @custom:storage-location erc8042:erc173.owner */ struct OwnerStorage { address owner; From 66c565e5578adadab6fca6671036dd93a3a8a8ba Mon Sep 17 00:00:00 2001 From: maxnorm Date: Fri, 20 Feb 2026 20:24:06 -0500 Subject: [PATCH 2/6] remove compose prefix in storage when erc --- src/access/OwnerTwoSteps/OwnerTwoStepsFacet.sol | 2 +- src/access/OwnerTwoSteps/OwnerTwoStepsMod.sol | 2 +- src/interfaceDetection/ERC165/ERC165Facet.sol | 4 ++-- src/interfaceDetection/ERC165/ERC165Mod.sol | 2 +- src/token/ERC1155/ERC1155Mod.sol | 2 +- src/token/ERC6909/ERC6909/ERC6909Facet.sol | 2 +- src/token/ERC6909/ERC6909/ERC6909Mod.sol | 2 +- src/token/Royalty/RoyaltyFacet.sol | 2 +- src/token/Royalty/RoyaltyMod.sol | 2 +- 9 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/access/OwnerTwoSteps/OwnerTwoStepsFacet.sol b/src/access/OwnerTwoSteps/OwnerTwoStepsFacet.sol index d979acef..e301f046 100644 --- a/src/access/OwnerTwoSteps/OwnerTwoStepsFacet.sol +++ b/src/access/OwnerTwoSteps/OwnerTwoStepsFacet.sol @@ -45,7 +45,7 @@ contract OwnerTwoStepsFacet { } } - bytes32 constant PENDING_OWNER_STORAGE_POSITION = keccak256("compose.owner.pending"); + bytes32 constant PENDING_OWNER_STORAGE_POSITION = keccak256("erc173.owner.pending"); /** * @custom:storage-location erc8042:compose.owner.pending diff --git a/src/access/OwnerTwoSteps/OwnerTwoStepsMod.sol b/src/access/OwnerTwoSteps/OwnerTwoStepsMod.sol index 4137d4b3..64fa0250 100644 --- a/src/access/OwnerTwoSteps/OwnerTwoStepsMod.sol +++ b/src/access/OwnerTwoSteps/OwnerTwoStepsMod.sol @@ -49,7 +49,7 @@ function getOwnerStorage() pure returns (OwnerStorage storage s) { } } -bytes32 constant PENDING_OWNER_STORAGE_POSITION = keccak256("compose.owner.pending"); +bytes32 constant PENDING_OWNER_STORAGE_POSITION = keccak256("erc173.owner.pending"); /** * @custom:storage-location erc8042:compose.owner.pending diff --git a/src/interfaceDetection/ERC165/ERC165Facet.sol b/src/interfaceDetection/ERC165/ERC165Facet.sol index 2ac74c90..64eb061a 100644 --- a/src/interfaceDetection/ERC165/ERC165Facet.sol +++ b/src/interfaceDetection/ERC165/ERC165Facet.sol @@ -33,11 +33,11 @@ contract ERC165Facet { * @notice Storage slot identifier for ERC-165 interface detection * @dev Defined using keccak256 hash following ERC-8042 standard */ - bytes32 constant STORAGE_POSITION = keccak256("compose.erc165"); + bytes32 constant STORAGE_POSITION = keccak256("erc165"); /** * @notice ERC-165 storage layout using the ERC-8042 standard - * @custom:storage-location erc8042:compose.erc165 + * @custom:storage-location erc8042:erc165 */ struct ERC165Storage { /** diff --git a/src/interfaceDetection/ERC165/ERC165Mod.sol b/src/interfaceDetection/ERC165/ERC165Mod.sol index 99a593c2..a7304d89 100644 --- a/src/interfaceDetection/ERC165/ERC165Mod.sol +++ b/src/interfaceDetection/ERC165/ERC165Mod.sol @@ -14,7 +14,7 @@ pragma solidity >=0.8.30; /* * Storage slot identifier, defined using keccak256 hash of the library diamond storage identifier. */ -bytes32 constant STORAGE_POSITION = keccak256("compose.erc165"); +bytes32 constant STORAGE_POSITION = keccak256("erc165"); /* * @notice ERC-165 storage layout using the ERC-8042 standard. diff --git a/src/token/ERC1155/ERC1155Mod.sol b/src/token/ERC1155/ERC1155Mod.sol index 474adfdf..94af7ba2 100644 --- a/src/token/ERC1155/ERC1155Mod.sol +++ b/src/token/ERC1155/ERC1155Mod.sol @@ -129,7 +129,7 @@ event URI(string _value, uint256 indexed _id); /** * @dev Storage position determined by the keccak256 hash of the diamond storage identifier. */ -bytes32 constant STORAGE_POSITION = keccak256("compose.erc1155"); +bytes32 constant STORAGE_POSITION = keccak256("erc1155"); /** * @dev ERC-8042 compliant storage struct for ERC-1155 token data. diff --git a/src/token/ERC6909/ERC6909/ERC6909Facet.sol b/src/token/ERC6909/ERC6909/ERC6909Facet.sol index 4be87a18..2b855a2d 100644 --- a/src/token/ERC6909/ERC6909/ERC6909Facet.sol +++ b/src/token/ERC6909/ERC6909/ERC6909Facet.sol @@ -55,7 +55,7 @@ contract ERC6909Facet { /** * @dev Storage position determined by the keccak256 hash of the diamond storage identifier. */ - bytes32 constant STORAGE_POSITION = keccak256("compose.erc6909"); + bytes32 constant STORAGE_POSITION = keccak256("erc6909"); /** * @custom:storage-location erc8042:compose.erc6909 diff --git a/src/token/ERC6909/ERC6909/ERC6909Mod.sol b/src/token/ERC6909/ERC6909/ERC6909Mod.sol index ed4c84ff..6c15bcec 100644 --- a/src/token/ERC6909/ERC6909/ERC6909Mod.sol +++ b/src/token/ERC6909/ERC6909/ERC6909Mod.sol @@ -87,7 +87,7 @@ event Approval(address indexed _owner, address indexed _spender, uint256 indexed /** * @dev Storage position determined by the keccak256 hash of the diamond storage identifier. */ -bytes32 constant STORAGE_POSITION = keccak256("compose.erc6909"); +bytes32 constant STORAGE_POSITION = keccak256("erc6909"); /** * @custom:storage-location erc8042:compose.erc6909 diff --git a/src/token/Royalty/RoyaltyFacet.sol b/src/token/Royalty/RoyaltyFacet.sol index 6d1e8cbe..098521b0 100644 --- a/src/token/Royalty/RoyaltyFacet.sol +++ b/src/token/Royalty/RoyaltyFacet.sol @@ -16,7 +16,7 @@ contract RoyaltyFacet { /** * @notice Storage slot identifier for royalty storage. */ - bytes32 constant STORAGE_POSITION = keccak256("compose.erc2981"); + bytes32 constant STORAGE_POSITION = keccak256("erc2981"); /** * @dev The denominator with which to interpret royalty fees as a percentage of sale price. diff --git a/src/token/Royalty/RoyaltyMod.sol b/src/token/Royalty/RoyaltyMod.sol index 03026b9b..55acaf4c 100644 --- a/src/token/Royalty/RoyaltyMod.sol +++ b/src/token/Royalty/RoyaltyMod.sol @@ -40,7 +40,7 @@ error ERC2981InvalidTokenRoyalty(uint256 _tokenId, uint256 _numerator, uint256 _ */ error ERC2981InvalidTokenRoyaltyReceiver(uint256 _tokenId, address _receiver); -bytes32 constant STORAGE_POSITION = keccak256("compose.erc2981"); +bytes32 constant STORAGE_POSITION = keccak256("erc2981"); /** * @dev The denominator with which to interpret royalty fees as a percentage of sale price. From 8afa7aaf23f9383071bc7356b33ae24b4045a6b6 Mon Sep 17 00:00:00 2001 From: maxnorm Date: Fri, 20 Feb 2026 20:42:20 -0500 Subject: [PATCH 3/6] fix storage struct comment - erc8042 --- src/access/AccessControl/AccessControlFacet.sol | 1 + src/access/AccessControlPausable/AccessControlPausableMod.sol | 4 ++-- src/access/AccessControlTemporal/AccessControlTemporalMod.sol | 4 ++-- src/access/OwnerTwoSteps/OwnerTwoStepsFacet.sol | 4 ++-- src/access/OwnerTwoSteps/OwnerTwoStepsMod.sol | 2 +- src/interfaceDetection/ERC165/ERC165Mod.sol | 2 +- src/token/ERC1155/ERC1155DataFacet.sol | 2 +- src/token/ERC1155/ERC1155Facet.sol | 2 +- src/token/ERC1155/ERC1155Mod.sol | 2 +- src/token/ERC20/Bridgeable/ERC20BridgeableFacet.sol | 1 + src/token/ERC20/Bridgeable/ERC20BridgeableMod.sol | 3 ++- src/token/ERC20/Burn/ERC20BurnMod.sol | 2 +- src/token/ERC20/Data/ERC20DataFacet.sol | 2 +- src/token/ERC6909/ERC6909/ERC6909Facet.sol | 2 +- src/token/ERC6909/ERC6909/ERC6909Mod.sol | 2 +- src/token/ERC721/Burn/ERC721BurnFacet.sol | 2 +- src/token/ERC721/Burn/ERC721BurnMod.sol | 4 ++-- src/token/ERC721/Metadata/ERC721MetadataFacet.sol | 2 +- src/token/ERC721/Metadata/ERC721MetadataMod.sol | 2 +- src/token/ERC721/Transfer/ERC721TransferMod.sol | 4 ++-- src/token/Royalty/RoyaltyFacet.sol | 2 +- src/token/Royalty/RoyaltyMod.sol | 2 +- 22 files changed, 28 insertions(+), 25 deletions(-) diff --git a/src/access/AccessControl/AccessControlFacet.sol b/src/access/AccessControl/AccessControlFacet.sol index 1a0779b1..dd31dd64 100644 --- a/src/access/AccessControl/AccessControlFacet.sol +++ b/src/access/AccessControl/AccessControlFacet.sol @@ -56,6 +56,7 @@ contract AccessControlFacet { /** * @notice storage struct for the AccessControl. + * @custom:storage-location erc8042:compose.accesscontrol */ struct AccessControlStorage { mapping(address account => mapping(bytes32 role => bool hasRole)) hasRole; diff --git a/src/access/AccessControlPausable/AccessControlPausableMod.sol b/src/access/AccessControlPausable/AccessControlPausableMod.sol index 36d6adba..2b8e0f31 100644 --- a/src/access/AccessControlPausable/AccessControlPausableMod.sol +++ b/src/access/AccessControlPausable/AccessControlPausableMod.sol @@ -42,7 +42,7 @@ bytes32 constant ACCESS_CONTROL_STORAGE_POSITION = keccak256("compose.accesscont */ bytes32 constant PAUSABLE_STORAGE_POSITION = keccak256("compose.accesscontrol.pausable"); -/* +/** * @notice Storage struct for AccessControl (reused struct definition). * @dev Must match the struct definition in AccessControlFacet. * @custom:storage-location erc8042:compose.accesscontrol @@ -52,7 +52,7 @@ struct AccessControlStorage { mapping(bytes32 role => bytes32 adminRole) adminRole; } -/* +/** * @notice Storage struct for AccessControlPausable. * @custom:storage-location erc8042:compose.accesscontrol.pausable */ diff --git a/src/access/AccessControlTemporal/AccessControlTemporalMod.sol b/src/access/AccessControlTemporal/AccessControlTemporalMod.sol index b58e7c17..5e2a6871 100644 --- a/src/access/AccessControlTemporal/AccessControlTemporalMod.sol +++ b/src/access/AccessControlTemporal/AccessControlTemporalMod.sol @@ -48,7 +48,7 @@ bytes32 constant ACCESS_CONTROL_STORAGE_POSITION = keccak256("compose.accesscont */ bytes32 constant TEMPORAL_STORAGE_POSITION = keccak256("compose.accesscontrol.temporal"); -/* +/** * @notice Storage struct for AccessControl (reused struct definition). * @dev Must match the struct definition in AccessControlFacet. * @custom:storage-location erc8042:compose.accesscontrol @@ -58,7 +58,7 @@ struct AccessControlStorage { mapping(bytes32 role => bytes32 adminRole) adminRole; } -/* +/** * @notice Storage struct for AccessControlTemporal. * @custom:storage-location erc8042:compose.accesscontrol.temporal */ diff --git a/src/access/OwnerTwoSteps/OwnerTwoStepsFacet.sol b/src/access/OwnerTwoSteps/OwnerTwoStepsFacet.sol index e301f046..d106537e 100644 --- a/src/access/OwnerTwoSteps/OwnerTwoStepsFacet.sol +++ b/src/access/OwnerTwoSteps/OwnerTwoStepsFacet.sol @@ -27,7 +27,7 @@ contract OwnerTwoStepsFacet { bytes32 constant OWNER_STORAGE_POSITION = keccak256("erc173.owner"); /** - * @custom:storage-location erc8042:compose.owner + * @custom:storage-location erc8042:erc173.owner */ struct OwnerStorage { address owner; @@ -48,7 +48,7 @@ contract OwnerTwoStepsFacet { bytes32 constant PENDING_OWNER_STORAGE_POSITION = keccak256("erc173.owner.pending"); /** - * @custom:storage-location erc8042:compose.owner.pending + * @custom:storage-location erc8042:erc173.owner.pending */ struct PendingOwnerStorage { address pendingOwner; diff --git a/src/access/OwnerTwoSteps/OwnerTwoStepsMod.sol b/src/access/OwnerTwoSteps/OwnerTwoStepsMod.sol index 64fa0250..391f92d7 100644 --- a/src/access/OwnerTwoSteps/OwnerTwoStepsMod.sol +++ b/src/access/OwnerTwoSteps/OwnerTwoStepsMod.sol @@ -52,7 +52,7 @@ function getOwnerStorage() pure returns (OwnerStorage storage s) { bytes32 constant PENDING_OWNER_STORAGE_POSITION = keccak256("erc173.owner.pending"); /** - * @custom:storage-location erc8042:compose.owner.pending + * @custom:storage-location erc8042:erc173.owner.pending */ struct PendingOwnerStorage { address pendingOwner; diff --git a/src/interfaceDetection/ERC165/ERC165Mod.sol b/src/interfaceDetection/ERC165/ERC165Mod.sol index a7304d89..37f86375 100644 --- a/src/interfaceDetection/ERC165/ERC165Mod.sol +++ b/src/interfaceDetection/ERC165/ERC165Mod.sol @@ -18,7 +18,7 @@ bytes32 constant STORAGE_POSITION = keccak256("erc165"); /* * @notice ERC-165 storage layout using the ERC-8042 standard. - * @custom:storage-location erc8042:compose.erc165 + * @custom:storage-location erc8042:erc165 */ struct ERC165Storage { /* diff --git a/src/token/ERC1155/ERC1155DataFacet.sol b/src/token/ERC1155/ERC1155DataFacet.sol index 42a3d643..2a61230f 100644 --- a/src/token/ERC1155/ERC1155DataFacet.sol +++ b/src/token/ERC1155/ERC1155DataFacet.sol @@ -24,7 +24,7 @@ contract ERC1155DataFacet { /** * @dev ERC-8042 compliant storage struct for ERC-1155 token data. - * @custom:storage-location erc8042:compose.erc1155 + * @custom:storage-location erc8042:erc1155 */ struct ERC1155Storage { mapping(uint256 id => mapping(address account => uint256 balance)) balanceOf; diff --git a/src/token/ERC1155/ERC1155Facet.sol b/src/token/ERC1155/ERC1155Facet.sol index c238a5e5..97c26c52 100644 --- a/src/token/ERC1155/ERC1155Facet.sol +++ b/src/token/ERC1155/ERC1155Facet.sol @@ -156,7 +156,7 @@ contract ERC1155Facet { /** * @dev ERC-8042 compliant storage struct for ERC-1155 token data. - * @custom:storage-location erc8042:compose.erc1155 + * @custom:storage-location erc8042:erc1155 */ struct ERC1155Storage { mapping(uint256 id => mapping(address account => uint256 balance)) balanceOf; diff --git a/src/token/ERC1155/ERC1155Mod.sol b/src/token/ERC1155/ERC1155Mod.sol index 94af7ba2..82452b33 100644 --- a/src/token/ERC1155/ERC1155Mod.sol +++ b/src/token/ERC1155/ERC1155Mod.sol @@ -133,7 +133,7 @@ bytes32 constant STORAGE_POSITION = keccak256("erc1155"); /** * @dev ERC-8042 compliant storage struct for ERC-1155 token data. - * @custom:storage-location erc8042:compose.erc1155 + * @custom:storage-location erc8042:erc1155 */ struct ERC1155Storage { mapping(uint256 id => mapping(address account => uint256 balance)) balanceOf; diff --git a/src/token/ERC20/Bridgeable/ERC20BridgeableFacet.sol b/src/token/ERC20/Bridgeable/ERC20BridgeableFacet.sol index e1b2d3d5..d8f87f8b 100644 --- a/src/token/ERC20/Bridgeable/ERC20BridgeableFacet.sol +++ b/src/token/ERC20/Bridgeable/ERC20BridgeableFacet.sol @@ -116,6 +116,7 @@ contract ERC20BridgeableFacet { /** * @notice storage struct for the AccessControl. + * @custom:storage-location erc8042:compose.accesscontrol */ struct AccessControlStorage { mapping(address account => mapping(bytes32 role => bool hasRole)) hasRole; diff --git a/src/token/ERC20/Bridgeable/ERC20BridgeableMod.sol b/src/token/ERC20/Bridgeable/ERC20BridgeableMod.sol index 1f2989cb..2ebf36ba 100644 --- a/src/token/ERC20/Bridgeable/ERC20BridgeableMod.sol +++ b/src/token/ERC20/Bridgeable/ERC20BridgeableMod.sol @@ -114,8 +114,9 @@ function getERC20Storage() pure returns (ERC20Storage storage s) { */ bytes32 constant ACCESS_STORAGE_POSITION = keccak256("compose.accesscontrol"); -/* +/** * @notice storage struct for the AccessControl. + * @custom:storage-location erc8042:compose.accesscontrol */ struct AccessControlStorage { mapping(address account => mapping(bytes32 role => bool hasRole)) hasRole; diff --git a/src/token/ERC20/Burn/ERC20BurnMod.sol b/src/token/ERC20/Burn/ERC20BurnMod.sol index 4c421308..5298589e 100644 --- a/src/token/ERC20/Burn/ERC20BurnMod.sol +++ b/src/token/ERC20/Burn/ERC20BurnMod.sol @@ -38,7 +38,7 @@ event Transfer(address indexed _from, address indexed _to, uint256 _value); */ bytes32 constant STORAGE_POSITION = keccak256("erc20"); -/* +/** * @notice ERC-20 storage layout using the ERC-8042 standard. * @custom:storage-location erc8042:erc20 */ diff --git a/src/token/ERC20/Data/ERC20DataFacet.sol b/src/token/ERC20/Data/ERC20DataFacet.sol index dd1e5660..b6c8713e 100644 --- a/src/token/ERC20/Data/ERC20DataFacet.sol +++ b/src/token/ERC20/Data/ERC20DataFacet.sol @@ -13,7 +13,7 @@ contract ERC20DataFacet { /** * @dev ERC-8042 compliant storage struct for ERC20 token data. - * @custom:storage-location erc8042:erc20.transfer + * @custom:storage-location erc8042:erc20 */ struct ERC20Storage { mapping(address owner => uint256 balance) balanceOf; diff --git a/src/token/ERC6909/ERC6909/ERC6909Facet.sol b/src/token/ERC6909/ERC6909/ERC6909Facet.sol index 2b855a2d..ebac7e47 100644 --- a/src/token/ERC6909/ERC6909/ERC6909Facet.sol +++ b/src/token/ERC6909/ERC6909/ERC6909Facet.sol @@ -58,7 +58,7 @@ contract ERC6909Facet { bytes32 constant STORAGE_POSITION = keccak256("erc6909"); /** - * @custom:storage-location erc8042:compose.erc6909 + * @custom:storage-location erc8042:erc6909 */ struct ERC6909Storage { mapping(address owner => mapping(uint256 id => uint256 amount)) balanceOf; diff --git a/src/token/ERC6909/ERC6909/ERC6909Mod.sol b/src/token/ERC6909/ERC6909/ERC6909Mod.sol index 6c15bcec..d7c9621c 100644 --- a/src/token/ERC6909/ERC6909/ERC6909Mod.sol +++ b/src/token/ERC6909/ERC6909/ERC6909Mod.sol @@ -90,7 +90,7 @@ event Approval(address indexed _owner, address indexed _spender, uint256 indexed bytes32 constant STORAGE_POSITION = keccak256("erc6909"); /** - * @custom:storage-location erc8042:compose.erc6909 + * @custom:storage-location erc8042:erc6909 */ struct ERC6909Storage { mapping(address owner => mapping(uint256 id => uint256 amount)) balanceOf; diff --git a/src/token/ERC721/Burn/ERC721BurnFacet.sol b/src/token/ERC721/Burn/ERC721BurnFacet.sol index 20e84548..2a9d8d54 100644 --- a/src/token/ERC721/Burn/ERC721BurnFacet.sol +++ b/src/token/ERC721/Burn/ERC721BurnFacet.sol @@ -29,7 +29,7 @@ contract ERC721BurnFacet { bytes32 constant STORAGE_POSITION = keccak256("erc721"); /** - * @custom:storage-location erc8042:compose.erc721 + * @custom:storage-location erc8042:erc721 */ struct ERC721Storage { mapping(uint256 tokenId => address owner) ownerOf; diff --git a/src/token/ERC721/Burn/ERC721BurnMod.sol b/src/token/ERC721/Burn/ERC721BurnMod.sol index 7d0f7d58..b99c1d12 100644 --- a/src/token/ERC721/Burn/ERC721BurnMod.sol +++ b/src/token/ERC721/Burn/ERC721BurnMod.sol @@ -24,10 +24,10 @@ event Transfer(address indexed _from, address indexed _to, uint256 indexed _toke */ bytes32 constant STORAGE_POSITION = keccak256("erc721"); -/* - * @custom:storage-location erc8042:erc721 +/** * @notice Storage layout for ERC-721 token management. * @dev Defines ownership, balances, approvals, and operator mappings per ERC-721 standard. + * @custom:storage-location erc8042:erc721 */ struct ERC721Storage { mapping(uint256 tokenId => address owner) ownerOf; diff --git a/src/token/ERC721/Metadata/ERC721MetadataFacet.sol b/src/token/ERC721/Metadata/ERC721MetadataFacet.sol index c44161b4..cb0efe70 100644 --- a/src/token/ERC721/Metadata/ERC721MetadataFacet.sol +++ b/src/token/ERC721/Metadata/ERC721MetadataFacet.sol @@ -20,7 +20,7 @@ contract ERC721MetadataFacet { bytes32 constant STORAGE_POSITION = keccak256("erc721.metadata"); /** - * @custom:storage-location erc8042:erc721 + * @custom:storage-location erc8042:erc721.metadata */ struct ERC721MetadataStorage { string name; diff --git a/src/token/ERC721/Metadata/ERC721MetadataMod.sol b/src/token/ERC721/Metadata/ERC721MetadataMod.sol index af7094a3..c5be1f98 100644 --- a/src/token/ERC721/Metadata/ERC721MetadataMod.sol +++ b/src/token/ERC721/Metadata/ERC721MetadataMod.sol @@ -14,7 +14,7 @@ error ERC721InvalidOwner(address _owner); bytes32 constant STORAGE_POSITION = keccak256("erc721.metadata"); /** - * @custom:storage-location erc8042:erc721 + * @custom:storage-location erc8042:erc721.metadata */ struct ERC721MetadataStorage { string name; diff --git a/src/token/ERC721/Transfer/ERC721TransferMod.sol b/src/token/ERC721/Transfer/ERC721TransferMod.sol index a3f4648a..bd964cd2 100644 --- a/src/token/ERC721/Transfer/ERC721TransferMod.sol +++ b/src/token/ERC721/Transfer/ERC721TransferMod.sol @@ -42,10 +42,10 @@ event Transfer(address indexed _from, address indexed _to, uint256 indexed _toke */ bytes32 constant STORAGE_POSITION = keccak256("erc721"); -/* - * @custom:storage-location erc8042:erc721 +/** * @notice Storage layout for ERC-721 token management. * @dev Defines ownership, balances, approvals, and operator mappings per ERC-721 standard. + * @custom:storage-location erc8042:erc721 */ struct ERC721Storage { mapping(uint256 tokenId => address owner) ownerOf; diff --git a/src/token/Royalty/RoyaltyFacet.sol b/src/token/Royalty/RoyaltyFacet.sol index 098521b0..33cf00a5 100644 --- a/src/token/Royalty/RoyaltyFacet.sol +++ b/src/token/Royalty/RoyaltyFacet.sol @@ -36,7 +36,7 @@ contract RoyaltyFacet { } /** - * @custom:storage-location erc8042:compose.erc2981 + * @custom:storage-location erc8042:erc2981 */ struct RoyaltyStorage { RoyaltyInfo defaultRoyaltyInfo; diff --git a/src/token/Royalty/RoyaltyMod.sol b/src/token/Royalty/RoyaltyMod.sol index 55acaf4c..ecb64dcd 100644 --- a/src/token/Royalty/RoyaltyMod.sol +++ b/src/token/Royalty/RoyaltyMod.sol @@ -62,7 +62,7 @@ struct RoyaltyInfo { } /** - * @custom:storage-location erc8042:compose.erc2981 + * @custom:storage-location erc8042:erc2981 */ struct RoyaltyStorage { RoyaltyInfo defaultRoyaltyInfo; From 8849e26ce13a99827e15878bfaf570445628ce46 Mon Sep 17 00:00:00 2001 From: maxnorm Date: Fri, 20 Feb 2026 20:55:35 -0500 Subject: [PATCH 4/6] remaining fixes --- src/diamond/DiamondUpgradeFacet.sol | 2 +- src/token/ERC1155/ERC1155Facet.sol | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/diamond/DiamondUpgradeFacet.sol b/src/diamond/DiamondUpgradeFacet.sol index 20c585ce..07a75c59 100644 --- a/src/diamond/DiamondUpgradeFacet.sol +++ b/src/diamond/DiamondUpgradeFacet.sol @@ -121,7 +121,7 @@ contract DiamondUpgradeFacet { } /** - * @custom:storage-location erc8042:erc8109.diamond + * @custom:storage-location erc8042:erc8153.diamond */ struct DiamondStorage { mapping(bytes4 functionSelector => FacetNode) facetNodes; diff --git a/src/token/ERC1155/ERC1155Facet.sol b/src/token/ERC1155/ERC1155Facet.sol index 97c26c52..fb551c81 100644 --- a/src/token/ERC1155/ERC1155Facet.sol +++ b/src/token/ERC1155/ERC1155Facet.sol @@ -60,7 +60,7 @@ interface IERC1155Receiver { * * For developers creating custom facets that need to interact with ERC-1155 storage (e.g., custom minting logic), * use the LibERC1155 library which provides helper functions to access this facet's storage. - * This facet does NOT depend on LibERC1155 - both access the same storage at keccak256("compose.erc1155"). + * This facet does NOT depend on LibERC1155 - both access the same storage at keccak256("erc1155"). */ contract ERC1155Facet { /** From 521c2b7923585d02d97c1f51680a79e7f0acafd7 Mon Sep 17 00:00:00 2001 From: maxnorm Date: Fri, 20 Feb 2026 21:00:24 -0500 Subject: [PATCH 5/6] fix solidity coment style check --- src/diamond/DiamondMod.sol | 2 +- src/diamond/DiamondUpgradeFacet.sol | 2 +- src/diamond/DiamondUpgradeMod.sol | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/diamond/DiamondMod.sol b/src/diamond/DiamondMod.sol index b3658889..4cb090fb 100644 --- a/src/diamond/DiamondMod.sol +++ b/src/diamond/DiamondMod.sol @@ -128,7 +128,7 @@ function importSelectors(address _facet) view returns (bytes memory selectors) { } } - // Validate ABI offset == 0x20 for a single dynamic return + /* Validate ABI offset == 0x20 for a single dynamic return */ uint256 offset; assembly ("memory-safe") { offset := mload(add(data, 0x20)) diff --git a/src/diamond/DiamondUpgradeFacet.sol b/src/diamond/DiamondUpgradeFacet.sol index 07a75c59..260bc82c 100644 --- a/src/diamond/DiamondUpgradeFacet.sol +++ b/src/diamond/DiamondUpgradeFacet.sol @@ -228,7 +228,7 @@ contract DiamondUpgradeFacet { } } - // Validate ABI offset == 0x20 for a single dynamic return + /* Validate ABI offset == 0x20 for a single dynamic return */ uint256 offset; assembly ("memory-safe") { offset := mload(add(data, 0x20)) diff --git a/src/diamond/DiamondUpgradeMod.sol b/src/diamond/DiamondUpgradeMod.sol index a4695371..a1892d93 100644 --- a/src/diamond/DiamondUpgradeMod.sol +++ b/src/diamond/DiamondUpgradeMod.sol @@ -201,7 +201,7 @@ function importSelectors(address _facet) view returns (bytes memory selectors) { } } - // Validate ABI offset == 0x20 for a single dynamic return + /* Validate ABI offset == 0x20 for a single dynamic return */ uint256 offset; assembly ("memory-safe") { offset := mload(add(data, 0x20)) From cae703197694df7b6643c36b47e568fe70f3674a Mon Sep 17 00:00:00 2001 From: maxnorm Date: Fri, 20 Feb 2026 21:12:25 -0500 Subject: [PATCH 6/6] add storage position convention in doc --- website/docs/contribution/code-style-guide.mdx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/website/docs/contribution/code-style-guide.mdx b/website/docs/contribution/code-style-guide.mdx index a484a4c8..1ca41b69 100644 --- a/website/docs/contribution/code-style-guide.mdx +++ b/website/docs/contribution/code-style-guide.mdx @@ -32,6 +32,13 @@ Follow the [Solidity feature ban](/docs/design/banned-solidity-features). delete balances[_owner]; ``` +### Storage Position Conventions + +Diamond storage slots (and the matching `@custom:storage-location erc8042:...` annotations on structs) follow: + +- **ERC standards:** Use the `erc` prefix and the standard number or name (e.g. `erc20`, `erc721`, `erc1155`, `erc165`, `erc2981`, `erc6909`, `erc173.owner`, `erc8153.diamond`). Sub-features use a dot (e.g. `erc20.metadata`, `erc721.enumerable`). +- **Custom / Compose features:** Use the `compose.` prefix (e.g. `compose.accesscontrol`, `compose.accesscontrol.pausable`, `compose.accesscontrol.temporal`). + ### Avoid Assembly - Avoid using assembly if you can. If you can't and you access memory, do it [safely](https://docs.soliditylang.org/en/latest/assembly.html#memory-safety), and use `assembly ("memory-safe")`. `"memory safe"` tells the Solidity compiler that memory is being used safely so it should not disable optimizations.