Registry contract to store registered modules (ModuleRegistry.sol)

View Source: contracts/ModuleRegistry.sol

↗ Extends: IModuleRegistry, EternalStorage ↘ Derived Contracts: MockModuleRegistry

ModuleRegistry

Only Polymath can register and verify module factories to make them available for issuers to attach.

Contract Members

Constants & Variables

bytes32 internal constant INITIALIZE;
bytes32 internal constant LOCKED;
bytes32 internal constant POLYTOKEN;
bytes32 internal constant PAUSED;
bytes32 internal constant OWNER;
bytes32 internal constant POLYMATHREGISTRY;
bytes32 internal constant FEATURE_REGISTRY;
bytes32 internal constant SECURITY_TOKEN_REGISTRY;

Modifiers

onlyOwner

Throws if called by any account other than the owner.

modifier onlyOwner() internal

Arguments

Name

Type

Description

whenNotPausedOrOwner

Modifier to make a function callable only when the contract is not paused.

modifier whenNotPausedOrOwner() internal

Arguments

Name

Type

Description

nonReentrant

Modifier to prevent reentrancy

modifier nonReentrant() internal

Arguments

Name

Type

Description

whenNotPaused

Modifier to make a function callable only when the contract is not paused and ignore is msg.sender is owner.

modifier whenNotPaused() internal

Arguments

Name

Type

Description

whenPaused

Modifier to make a function callable only when the contract is paused.

modifier whenPaused() internal

Arguments

Name

Type

Description

Functions

_whenNotPausedOrOwner

function _whenNotPausedOrOwner() internal view

Arguments

Name

Type

Description

function () public nonpayable

Arguments

Name

Type

Description

initialize

function initialize(address _polymathRegistry, address _owner) external payable

Arguments

Name

Type

Description

_polymathRegistry

address

_owner

address

_customModules

function _customModules() internal view
returns(bool)

Arguments

Name

Type

Description

useModule

⤾ overrides IModuleRegistry.useModule

Called by a SecurityToken (2.x) to check if the ModuleFactory is verified or appropriate custom module

function useModule(address _moduleFactory) external nonpayable

Arguments

Name

Type

Description

_moduleFactory

address

is the address of the relevant module factory

useModule

⤾ overrides IModuleRegistry.useModule

Called by a SecurityToken to check if the ModuleFactory is verified or appropriate custom module

function useModule(address _moduleFactory, bool _isUpgrade) public nonpayable nonReentrant

Arguments

Name

Type

Description

_moduleFactory

address

is the address of the relevant module factory

_isUpgrade

bool

whether or not the function is being called as a result of an upgrade

isCompatibleModule

⤾ overrides IModuleRegistry.isCompatibleModule

Check that a module and its factory are compatible

function isCompatibleModule(address _moduleFactory, address _securityToken) public view
returns(bool)

Returns

bool whether module and token are compatible

Arguments

Name

Type

Description

_moduleFactory

address

is the address of the relevant module factory

_securityToken

address

is the address of the relevant security token

registerModule

⤾ overrides IModuleRegistry.registerModule

Called by the ModuleFactory owner to register new modules for SecurityTokens to use

function registerModule(address _moduleFactory) external nonpayable whenNotPausedOrOwner nonReentrant

Arguments

Name

Type

Description

_moduleFactory

address

is the address of the module factory to be registered

removeModule

⤾ overrides IModuleRegistry.removeModule

Called by the ModuleFactory owner or registry curator to delete a ModuleFactory from the registry

function removeModule(address _moduleFactory) external nonpayable whenNotPausedOrOwner

Arguments

Name

Type

Description

_moduleFactory

address

is the address of the module factory to be deleted from the registry

verifyModule

⤾ overrides IModuleRegistry.verifyModule

Called by Polymath to verify Module Factories for SecurityTokens to use.

function verifyModule(address _moduleFactory) external nonpayable onlyOwner

Arguments

Name

Type

Description

_moduleFactory

address

is the address of the module factory to be verified

unverifyModule

⤾ overrides IModuleRegistry.unverifyModule

Called by Polymath to verify Module Factories for SecurityTokens to use.

function unverifyModule(address _moduleFactory) external nonpayable nonReentrant

Arguments

Name

Type

Description

_moduleFactory

address

is the address of the module factory to be verified

getTagsByTypeAndToken

⤾ overrides IModuleRegistry.getTagsByTypeAndToken

Returns all the tags related to the a module type which are valid for the given token

function getTagsByTypeAndToken(uint8 _moduleType, address _securityToken) external view
returns(bytes32[], address[])

Returns

list of tags

Arguments

Name

Type

Description

_moduleType

uint8

is the module type

_securityToken

address

is the token

getTagsByType

⤾ overrides IModuleRegistry.getTagsByType

Returns all the tags related to the a module type which are valid for the given token

function getTagsByType(uint8 _moduleType) external view
returns(bytes32[], address[])

Returns

list of tags

Arguments

Name

Type

Description

_moduleType

uint8

is the module type

_tagsByModules

Returns all the tags related to the modules provided

function _tagsByModules(address[] _modules) internal view
returns(bytes32[], address[])

Returns

list of tags

Arguments

Name

Type

Description

_modules

address[]

modules to return tags for

getFactoryDetails

⤾ overrides IModuleRegistry.getFactoryDetails

Returns the verified status, and reputation of the entered Module Factory

function getFactoryDetails(address _factoryAddress) external view
returns(bool, address, address[])

Returns

bool indicating whether module factory is verified

Arguments

Name

Type

Description

_factoryAddress

address

is the address of the module factory

getModulesByType

⤾ overrides IModuleRegistry.getModulesByType

Returns the list of addresses of verified Module Factory of a particular type

function getModulesByType(uint8 _moduleType) public view
returns(address[])

Returns

address array that contains the list of addresses of module factory contracts.

Arguments

Name

Type

Description

_moduleType

uint8

Type of Module

getAllModulesByType

⤾ overrides IModuleRegistry.getAllModulesByType

Returns the list of addresses of all Module Factory of a particular type

function getAllModulesByType(uint8 _moduleType) external view
returns(address[])

Returns

address array that contains the list of addresses of module factory contracts.

Arguments

Name

Type

Description

_moduleType

uint8

Type of Module

getModulesByTypeAndToken

⤾ overrides IModuleRegistry.getModulesByTypeAndToken

Returns the list of available Module factory addresses of a particular type for a given token.

function getModulesByTypeAndToken(uint8 _moduleType, address _securityToken) public view
returns(address[])

Returns

address array that contains the list of available addresses of module factory contracts.

Arguments

Name

Type

Description

_moduleType

uint8

is the module type to look for

_securityToken

address

is the address of SecurityToken

reclaimERC20

⤾ overrides IModuleRegistry.reclaimERC20

Reclaims all ERC20Basic compatible tokens

function reclaimERC20(address _tokenContract) external nonpayable onlyOwner

Arguments

Name

Type

Description

_tokenContract

address

The address of the token contract

pause

⤾ overrides IModuleRegistry.pause

Called by the owner to pause, triggers stopped state

function pause() external nonpayable whenNotPaused onlyOwner

Arguments

Name

Type

Description

unpause

⤾ overrides IModuleRegistry.unpause

Called by the owner to unpause, returns to normal state

function unpause() external nonpayable whenPaused onlyOwner

Arguments

Name

Type

Description

updateFromRegistry

⤾ overrides IModuleRegistry.updateFromRegistry

Stores the contract addresses of other key contracts from the PolymathRegistry

function updateFromRegistry() external nonpayable onlyOwner

Arguments

Name

Type

Description

transferOwnership

⤾ overrides IModuleRegistry.transferOwnership

Allows the current owner to transfer control of the contract to a newOwner.

function transferOwnership(address _newOwner) external nonpayable onlyOwner

Arguments

Name

Type

Description

_newOwner

address

The address to transfer ownership to.

owner

⤾ overrides IModuleRegistry.owner

Gets the owner of the contract

function owner() public view
returns(address)

Returns

address owner

Arguments

Name

Type

Description

isPaused

⤾ overrides IModuleRegistry.isPaused

Checks whether the contract operations is paused or not

function isPaused() public view
returns(bool)

Returns

bool

Arguments

Name

Type

Description