Skip to content

Commit 65c6e53

Browse files
committed
Make useModule backwards compatible
1 parent 95f903f commit 65c6e53

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

contracts/ModuleRegistry.sol

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,18 @@ contract ModuleRegistry is IModuleRegistry, EternalStorage {
118118
return IFeatureRegistry(getAddressValue(FEATURE_REGISTRY)).getFeatureStatus("customModulesAllowed");
119119
}
120120

121+
122+
/**
123+
* @notice Called by a SecurityToken (2.x) to check if the ModuleFactory is verified or appropriate custom module
124+
* @dev ModuleFactory reputation increases by one every time it is deployed(used) by a ST.
125+
* @dev Any module can be added during token creation without being registered if it is defined in the token proxy deployment contract
126+
* @dev The feature switch for custom modules is labelled "customModulesAllowed"
127+
* @param _moduleFactory is the address of the relevant module factory
128+
*/
129+
function useModule(address _moduleFactory) external {
130+
useModule(_moduleFactory, false);
131+
}
132+
121133
/**
122134
* @notice Called by a SecurityToken to check if the ModuleFactory is verified or appropriate custom module
123135
* @dev ModuleFactory reputation increases by one every time it is deployed(used) by a ST.
@@ -126,7 +138,7 @@ contract ModuleRegistry is IModuleRegistry, EternalStorage {
126138
* @param _moduleFactory is the address of the relevant module factory
127139
* @param _isUpgrade whether or not the function is being called as a result of an upgrade
128140
*/
129-
function useModule(address _moduleFactory, bool _isUpgrade) external nonReentrant {
141+
function useModule(address _moduleFactory, bool _isUpgrade) public nonReentrant {
130142
if (_customModules()) {
131143
require(
132144
getBoolValue(Encoder.getKey("verified", _moduleFactory)) || getAddressValue(Encoder.getKey("factoryOwner", _moduleFactory))

contracts/interfaces/IModuleRegistry.sol

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ interface IModuleRegistry {
2727
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
2828

2929

30+
/**
31+
* @notice Called by a security token (2.x) to notify the registry it is using a module
32+
* @param _moduleFactory is the address of the relevant module factory
33+
*/
34+
function useModule(address _moduleFactory) external;
35+
3036
/**
3137
* @notice Called by a security token to notify the registry it is using a module
3238
* @param _moduleFactory is the address of the relevant module factory

0 commit comments

Comments
 (0)