Skip to content

Commit

Permalink
Merge pull request #110 from PolymathNetwork/Allow-non-registered-mod…
Browse files Browse the repository at this point in the history
…ules-to-be-used

Fix MR
  • Loading branch information
pabloruiz55 authored May 18, 2018
2 parents da7d7dd + 33088ee commit bdb2899
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions contracts/ModuleRegistry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,15 @@ contract ModuleRegistry is IModuleRegistry, Ownable {
* @param _moduleFactory is the address of the relevant module factory
*/
function useModule(address _moduleFactory) external {
//msg.sender must be a security token - below will throw if not
ISecurityTokenRegistry(securityTokenRegistry).getSecurityTokenData(msg.sender);
require(registry[_moduleFactory] != 0, "ModuleFactory type should not be 0");
//To use a module, either it must be verified, or owned by the ST owner
require(verified[_moduleFactory]||(IModuleFactory(_moduleFactory).owner() == ISecurityToken(msg.sender).owner()),
"Module factory is not verified as well as not called by the owner");
reputation[_moduleFactory].push(msg.sender);
emit LogModuleUsed (_moduleFactory, msg.sender);
//If caller is a registered security token, then register module usage
if (ISecurityTokenRegistry(securityTokenRegistry).isSecurityToken(msg.sender)) {
require(registry[_moduleFactory] != 0, "ModuleFactory type should not be 0");
//To use a module, either it must be verified, or owned by the ST owner
require(verified[_moduleFactory]||(IModuleFactory(_moduleFactory).owner() == ISecurityToken(msg.sender).owner()),
"Module factory is not verified as well as not called by the owner");
reputation[_moduleFactory].push(msg.sender);
emit LogModuleUsed (_moduleFactory, msg.sender);
}
}

/**
Expand Down

0 comments on commit bdb2899

Please sign in to comment.