diff --git a/contracts/Nexus.sol b/contracts/Nexus.sol index 5ee496f0..5bd9ae26 100644 --- a/contracts/Nexus.sol +++ b/contracts/Nexus.sol @@ -123,7 +123,6 @@ contract Nexus is INexus, BaseAccount, ExecutionHelper, ModuleManager, UUPSUpgra if (!_isAlreadyInitialized()) { if (ECDSA.recover(userOpHash.toEthSignedMessageHash(), op.signature) == address(this)) { // add 7739 storage base - _addStorageBase(_STORAGE_LOCATION); validationData = VALIDATION_SUCCESS; } else { validationData = VALIDATION_FAILED; @@ -270,7 +269,8 @@ contract Nexus is INexus, BaseAccount, ExecutionHelper, ModuleManager, UUPSUpgra _initModuleManager(); (address bootstrap, bytes memory bootstrapCall) = abi.decode(initData, (address, bytes)); (bool success, ) = bootstrap.delegatecall(bootstrapCall); - _addStorageBase(_STORAGE_LOCATION); + // TODO: DO IT FOR 7702 ONLY + _addStorageBase(_NEXUS_STORAGE_LOCATION); require(success, NexusInitializationFailed()); require(_hasValidators(), NoValidatorInstalled()); diff --git a/contracts/base/Storage.sol b/contracts/base/Storage.sol index 59f6ebc0..c1ea7039 100644 --- a/contracts/base/Storage.sol +++ b/contracts/base/Storage.sol @@ -25,7 +25,7 @@ import { IStorage } from "../interfaces/base/IStorage.sol"; contract Storage is IStorage { /// @custom:storage-location erc7201:biconomy.storage.Nexus /// ERC-7201 namespaced via `keccak256(abi.encode(uint256(keccak256(bytes("biconomy.storage.Nexus"))) - 1)) & ~bytes32(uint256(0xff));` - bytes32 internal constant _STORAGE_LOCATION = 0x0bb70095b32b9671358306b0339b4c06e7cbd8cb82505941fba30d1eb5b82f00; + bytes32 internal constant _NEXUS_STORAGE_LOCATION = 0x0bb70095b32b9671358306b0339b4c06e7cbd8cb82505941fba30d1eb5b82f00; /// @dev Utilizes ERC-7201's namespaced storage pattern for isolated storage access. This method computes /// the storage slot based on a predetermined location, ensuring collision-resistant storage for contract states. @@ -34,7 +34,7 @@ contract Storage is IStorage { /// @return $ The proxy to the `AccountStorage` struct, providing a reference to the namespaced storage slot. function _getAccountStorage() internal pure returns (AccountStorage storage $) { assembly { - $.slot := _STORAGE_LOCATION + $.slot := _NEXUS_STORAGE_LOCATION } } }