Skip to content

Commit

Permalink
Fix MR
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdossa committed May 18, 2018
1 parent da7d7dd commit 33088ee
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 33088ee

Please sign in to comment.