@@ -6,6 +6,7 @@ import {IAccount, ValidationData, ValidAfter, ValidUntil, parseValidationData} f
66import {IEntryPoint} from "./interfaces/IEntryPoint.sol " ;
77import {IAccountExecute} from "./interfaces/IAccountExecute.sol " ;
88import {IERC7579Account } from "./interfaces/IERC7579Account.sol " ;
9+ import {ModuleLib} from "./utils/ModuleLib.sol " ;
910import {
1011 ValidationManager,
1112 ValidationMode,
@@ -23,7 +24,7 @@ import {HookManager} from "./core/HookManager.sol";
2324import {ExecutorManager} from "./core/ExecutorManager.sol " ;
2425import {SelectorManager} from "./core/SelectorManager.sol " ;
2526import {IModule, IValidator, IHook, IExecutor, IFallback, IPolicy, ISigner} from "./interfaces/IERC7579Modules.sol " ;
26- import {EIP712} from "solady/src/ utils/EIP712.sol " ;
27+ import {EIP712} from "solady/utils/EIP712.sol " ;
2728import {ExecLib, ExecMode, CallType, CALLTYPE_SINGLE, CALLTYPE_DELEGATECALL} from "./utils/ExecLib.sol " ;
2829
2930bytes32 constant ERC1967_IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc ;
@@ -119,7 +120,7 @@ contract Kernel is IAccount, IAccountExecute, IERC7579Account, ValidationManager
119120 mstore (senderPtr, shl (96 , caller ()))
120121
121122 // Add 20 bytes for the address appended add the end
122- // NOTE: we are only allowing static call for fallback
123+ // NOTE: we are only allowing call for fallback
123124 success := staticcall (gas (), fallbackHandler, calldataPtr, add (calldatasize (), 20 ), 0 , 0 )
124125
125126 result := mload (0x40 )
@@ -330,6 +331,7 @@ contract Kernel is IAccount, IAccountExecute, IERC7579Account, ValidationManager
330331 _installExecutor (IExecutor (module), executorData, hook);
331332 _installHook (hook, hookData);
332333 } else if (moduleType == 3 ) {
334+ //TODO : update this to use _installSelector
333335 bytes calldata fallbackData;
334336 bytes calldata hookData;
335337 assembly {
@@ -396,7 +398,7 @@ contract Kernel is IAccount, IAccountExecute, IERC7579Account, ValidationManager
396398 {
397399 if (moduleType == type (uint256 ).max) {
398400 // force uninstall option
399- IModule (module). onUninstall ( deInitData);
401+ ModuleLib. uninstallModule (module, deInitData);
400402 }
401403 if (moduleType == 1 ) {
402404 ValidationStorage storage vs = _validationStorage ();
@@ -439,19 +441,19 @@ contract Kernel is IAccount, IAccountExecute, IERC7579Account, ValidationManager
439441 // force call onInstall for hook
440442 // NOTE: for hook, kernel does not support independant hook install,
441443 // hook is expected to be paired with proper validator/executor/selector
442- IHook (module). onUninstall ( deInitData);
444+ ModuleLib. uninstallModule (module, deInitData);
443445 } else if (moduleType == 5 ) {
444446 // force call onInstall for policy
445447 // NOTE: for policy, kernel does not support independant policy install,
446448 // policy is expected to be paired with proper permissionId
447- // to "ADD " permission, use "installValidations ()" function
448- IPolicy (module). onUninstall ( deInitData);
449+ // to "REMOVE " permission, use "uninstallValidation ()" function
450+ ModuleLib. uninstallModule (module, deInitData);
449451 } else if (moduleType == 6 ) {
450452 // force call onInstall for signer
451453 // NOTE: for signer, kernel does not support independant signer install,
452454 // signer is expected to be paired with proper permissionId
453- // to "ADD " permission, use "installValidations ()" function
454- ISigner (module). onUninstall ( deInitData);
455+ // to "REMOVE " permission, use "installValidation ()" function
456+ ModuleLib. uninstallModule (module, deInitData);
455457 } else if (moduleType == 7 ) {
456458 IHook hook = _uninstallSelector (bytes4 (deInitData[0 :4 ]));
457459 bytes calldata hookData = deInitData[4 :];
@@ -483,7 +485,7 @@ contract Kernel is IAccount, IAccountExecute, IERC7579Account, ValidationManager
483485 } else if (moduleType == 3 ) {
484486 (IFallback fallbackHandler ,) = _fallbackConfig ();
485487 return fallbackHandler == IFallback (module);
486- } else if (moduleType == 6 ) {
488+ } else if (moduleType == 7 ) {
487489 return _selectorConfig (bytes4 (additionalContext[0 :4 ])).target == module;
488490 } else {
489491 return false ;
0 commit comments