Skip to content

Commit abecb45

Browse files
committed
refactor: use new data location for LSP8 tokenId data
1 parent de15120 commit abecb45

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

packages/lsp8-contracts/contracts/LSP8IdentifiableDigitalAssetCore.sol

+5-2
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ abstract contract LSP8IdentifiableDigitalAssetCore is
8080
// Mapping a `tokenId` to its authorized operator addresses.
8181
mapping(bytes32 => EnumerableSet.AddressSet) internal _operators;
8282

83+
// Mapping from `tokenId` to `dataKey` to `dataValue`
84+
mapping(bytes32 => mapping(bytes32 => bytes)) internal _tokenIdData;
85+
8386
// --- Token queries
8487

8588
/**
@@ -683,7 +686,7 @@ abstract contract LSP8IdentifiableDigitalAssetCore is
683686
bytes32 dataKey,
684687
bytes memory dataValue
685688
) internal virtual {
686-
_store[keccak256(bytes.concat(tokenId, dataKey))] = dataValue;
689+
_tokenIdData[tokenId][dataKey] = dataValue;
687690
emit TokenIdDataChanged(tokenId, dataKey, dataValue);
688691
}
689692

@@ -698,7 +701,7 @@ abstract contract LSP8IdentifiableDigitalAssetCore is
698701
bytes32 tokenId,
699702
bytes32 dataKey
700703
) internal view virtual returns (bytes memory dataValues) {
701-
return _store[keccak256(bytes.concat(tokenId, dataKey))];
704+
return _tokenIdData[tokenId][dataKey];
702705
}
703706

704707
/**

0 commit comments

Comments
 (0)