Skip to content

Commit

Permalink
rm excess sage of addBase
Browse files Browse the repository at this point in the history
  • Loading branch information
Filipp Makarov authored and Filipp Makarov committed Dec 19, 2024
1 parent 60745a0 commit a968100
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions contracts/Nexus.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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());
Expand Down
4 changes: 2 additions & 2 deletions contracts/base/Storage.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
}
}
}

0 comments on commit a968100

Please sign in to comment.