Skip to content

Commit

Permalink
Merge branch 'feature/simple-structs' into feature/v0.3-fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
zeroknots authored Feb 12, 2024
2 parents 4136132 + 0b60962 commit c9a2d8a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 1 addition & 2 deletions src/core/ModuleManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ import { IRegistry } from "../IRegistry.sol";
/**
* @title Module
*
* @dev The Module contract serves as a component in a larger system for handling smart contracts or "modules"
* within a blockchain ecosystem. This contract inherits from the IModule interface
* @dev The Module contract is responsible for handling the registration, storage and retrieval of modules on the Registry. This contract inherits from the IModule interface
*
* @dev The primary responsibility of the Module is to deploy and manage modules. A module is a smart contract
* that has been deployed through the Module. The details of each module, such as its address, code hash, schema ID,
Expand Down
2 changes: 2 additions & 0 deletions src/lib/ModuleTypeLib.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ library ModuleTypeLib {
return (PackedModuleTypes.unwrap(self) & 2 ** ModuleType.unwrap(moduleType)) != 0;
}


function isType(uint32 packed, uint32 check) internal pure returns (bool) {
return (packed & 2 ** check) != 0;
}
Expand All @@ -22,6 +23,7 @@ library ModuleTypeLib {
_type = ModuleType.unwrap(moduleTypes[i]);
if (_type > 31 && isType(packed, _type)) revert IRegistry.InvalidModuleType();
packed = packed + uint32(2 ** _type);

}
return PackedModuleTypes.wrap(packed);
}
Expand Down

0 comments on commit c9a2d8a

Please sign in to comment.