Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion foundry.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[profile.default]
evm_version = "cancun"
evm_version = "prague"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

evm_version = "prague"

src = "src"
out = "out"
libs = ["node_modules"]
Expand Down
4 changes: 4 additions & 0 deletions src/MSAAdvanced.sol
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,7 @@ contract MSAAdvanced is
if (isERC7702) {
_addStorageBase(MODULEMANAGER_STORAGE_LOCATION);
_addStorageBase(HOOKMANAGER_STORAGE_LOCATION);
_addStorageBase(PREVALIDATION_HOOKMANAGER_STORAGE_LOCATION);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

        _addStorageBase(PREVALIDATION_HOOKMANAGER_STORAGE_LOCATION);

}

// bootstrap the account
Expand All @@ -442,6 +443,9 @@ contract MSAAdvanced is
_tryUninstallValidators();
_tryUninstallExecutors();
_tryUninstallHook(_getHook());
// Review
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we uninstall pre validation hooks as well?

why try... used instead of regular uninstall methods?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regular uninstall could revert right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed we're not posting any data for onUninstall
commented versions of some methods like _tryUninstallValidators had that

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm actually that's a good point. Let keep and use the versions that post data with tryUninstall

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would this need changes in the erc for onRedelegation method--can accept data?

interface IRedelegableDelegatedAccount {
	/*
	 * @dev    Function called before redelegation.
	 *         This function should prepare the account for a delegation to a different implementation.
	 *         This function could be triggered by the new wallet that wants to redelegate an already delegated EOA.
	 *         It should uninitialize storages if needed and execute wallet-specific logic to prepare for redelegation.
	 *         msg.sender should be the owner of the account.
	 */
	function onRedelegation() external returns (bool);
}

Copy link
Contributor Author

@livingrockrises livingrockrises Apr 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah that makes sense

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pushed please check.

_tryUninstallPreValidationHook(_getPreValidationHook(MODULE_TYPE_PREVALIDATION_HOOK_ERC1271), MODULE_TYPE_PREVALIDATION_HOOK_ERC1271);
_tryUninstallPreValidationHook(_getPreValidationHook(MODULE_TYPE_PREVALIDATION_HOOK_ERC4337), MODULE_TYPE_PREVALIDATION_HOOK_ERC4337);
_initModuleManager();
}
}
2 changes: 2 additions & 0 deletions src/core/ModuleManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ abstract contract ModuleManager is AccountBase, Receiver {
IValidator(validator).onUninstall(disableModuleData);
}

// Review: This can be removed.
/*
function _tryUninstallValidators(bytes[] calldata data) internal {
SentinelListLib.SentinelList storage $valdiators = $moduleManager().$valdiators;
Expand Down Expand Up @@ -168,6 +169,7 @@ abstract contract ModuleManager is AccountBase, Receiver {
IExecutor(executor).onUninstall(disableModuleData);
}

// Review: This can be removed.
/*
function _tryUninstallExecutors(bytes[] calldata data) internal {
SentinelListLib.SentinelList storage $executors = $moduleManager().$executors;
Expand Down
1 change: 1 addition & 0 deletions src/core/PreValidationHookManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ abstract contract PreValidationHookManager {
}

function _tryUninstallPreValidationHook(address hook, uint256 hookType) internal virtual {
if (hook == address(0)) return;
PreValidationHookManagerStorage storage $ = _getStorage();
if (hookType == MODULE_TYPE_PREVALIDATION_HOOK_ERC1271) {
try $.hook1271.onUninstall("") { }
Expand Down
Loading