Skip to content

Commit

Permalink
fix: [ALCHEMY-010] easy fixes (002, 015, 016)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaypaik committed Nov 22, 2024
1 parent ed5c3e8 commit f0f63f8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion gas-snapshots/ModularAccount.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"Runtime_AccountCreation": "176147",
"Runtime_AccountCreation": "176129",
"Runtime_BatchTransfers": "93045",
"Runtime_Erc20Transfer": "78454",
"Runtime_InstallSessionKey_Case1": "423148",
Expand Down
2 changes: 1 addition & 1 deletion src/account/AccountStorage.sol
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ struct ValidationStorage {
/// @custom:storage-location erc7201:Alchemy.ModularAccount.Storage_V2
struct AccountStorage {
// AccountStorageInitializable variables.
uint8 initialized;
uint64 initialized;
bool initializing;
// Execution functions and their associated functions.
mapping(bytes4 selector => ExecutionStorage) executionStorage;
Expand Down
6 changes: 5 additions & 1 deletion src/helpers/ExecutionInstallDelegate.sol
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ contract ExecutionInstallDelegate {
{
AccountStorage storage _storage = getAccountStorage();

if (module == address(0)) {
revert NullModule();
}

uint256 length = manifest.executionHooks.length;
for (uint256 i = 0; i < length; ++i) {
ManifestExecutionHook memory mh = manifest.executionHooks[i];
Expand Down Expand Up @@ -132,7 +136,7 @@ contract ExecutionInstallDelegate {
bool allowGlobalValidation,
address module
) internal {
ExecutionStorage storage _executionStorage = getAccountStorage().executionStorage[bytes4(selector)];
ExecutionStorage storage _executionStorage = getAccountStorage().executionStorage[selector];

if (_executionStorage.module != address(0)) {
revert ExecutionFunctionAlreadySet();
Expand Down

0 comments on commit f0f63f8

Please sign in to comment.