From 911d9579669bacc8e55f5583233a6b793af8ad4d Mon Sep 17 00:00:00 2001 From: adam-alchemy <127769144+adam-alchemy@users.noreply.github.com> Date: Fri, 19 Jan 2024 15:02:05 -0800 Subject: [PATCH] fix: [quanstamp-req] Contract data key (#81) --- src/plugins/session/permissions/SessionKeyPermissionsBase.sol | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/session/permissions/SessionKeyPermissionsBase.sol b/src/plugins/session/permissions/SessionKeyPermissionsBase.sol index e45942217..01a9dca79 100644 --- a/src/plugins/session/permissions/SessionKeyPermissionsBase.sol +++ b/src/plugins/session/permissions/SessionKeyPermissionsBase.sol @@ -80,7 +80,7 @@ abstract contract SessionKeyPermissionsBase is ISessionKeyPlugin { // ContractData (128 bytes) // 12 padding zeros || associated address || CONTRACT_DATA_PREFIX || batch index || sessionKeyId - // || contractAddress || 12 padding zero bytes + // || 12 padding zero bytes || contractAddress // FunctionData (128 bytes) // 12 padding zeros || associated address || FUNCTION_DATA_PREFIX || batch index || sessionKeyId || selector @@ -154,7 +154,7 @@ abstract contract SessionKeyPermissionsBase is ISessionKeyPlugin { PluginStorageLib.allocateAssociatedStorageKey(associated, prefixAndBatchIndex, 2); bytes32 contractDataKey1 = SessionKeyId.unwrap(id); - bytes32 contractDataKey2 = bytes32(bytes20(contractAddress)); + bytes32 contractDataKey2 = bytes32(uint256(uint160(contractAddress))); return _toContractData( PluginStorageLib.associatedStorageLookup(associatedStorageKey, contractDataKey1, contractDataKey2) );