Skip to content

Latest commit

 

History

History
7 lines (6 loc) · 19.9 KB

api_ModuleRegistry.md

File metadata and controls

7 lines (6 loc) · 19.9 KB
id title original_id
version-2.1.0-ModuleRegistry
ModuleRegistry
ModuleRegistry

contract ModuleRegistry

is IModuleRegistryEternalStorage

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

Reference

Events

  • ModuleRegistered

    event ModuleRegistered(address _moduleFactory, address _owner) 
    Parameters:
    _moduleFactory - address
    _owner - address
  • ModuleRemoved

    event ModuleRemoved(address _moduleFactory, address _decisionMaker) 
    Parameters:
    _moduleFactory - address
    _decisionMaker - address
  • ModuleUsed

    event ModuleUsed(address _moduleFactory, address _securityToken) 
    Parameters:
    _moduleFactory - address
    _securityToken - address
  • ModuleVerified

    event ModuleVerified(address _moduleFactory, bool _verified) 
    Parameters:
    _moduleFactory - address
    _verified - bool
  • OwnershipTransferred

    event OwnershipTransferred(address previousOwner, address newOwner) 
    Parameters:
    previousOwner - address
    newOwner - address
  • Pause

    event Pause(uint256 _timestammp) 

    ///////.

    Parameters:
    _timestammp - uint256
  • Unpause

    event Unpause(uint256 _timestamp) 
    Parameters:
    _timestamp - uint256

Modifiers

  • onlyOwner

    modifier onlyOwner() 

    Throws if called by any account other than the owner.

  • whenNotPaused

    modifier whenNotPaused() 

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

  • whenNotPausedOrOwner

    modifier whenNotPausedOrOwner() 

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

  • whenPaused

    modifier whenPaused() 

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

Functions

  • _isCompatibleModule

    function _isCompatibleModule(address _moduleFactory, address _securityToken) internal view returns  (bool) 
    Parameters:
    _moduleFactory - address
    _securityToken - address
    Returns:
    bool
  • _tagsByModules

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

    Returns all the tags related to the modules provided.

    Parameters:
    _modules - modules to return tags for
    Returns:
    corresponding list of module factories
  • fallback

    function () public 

    //////////////////////////.

  • getModulesByType

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

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

    Parameters:
    _moduleType - Type of Module
    Returns:
    address array that contains the list of addresses of module factory contracts.
  • getModulesByTypeAndToken

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

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

    Parameters:
    _moduleType - is the module type to look for
    _securityToken - is the address of SecurityToken
    Returns:
    address array that contains the list of available addresses of module factory contracts.
  • getReputationByFactory

    function getReputationByFactory(address _factoryAddress) external view returns  (address[]) 

    Returns the reputation of the entered Module Factory.

    Parameters:
    _factoryAddress - is the address of the module factory
    Returns:
    address array which contains the list of securityTokens that use that module factory
  • getTagsByType

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

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

    Parameters:
    _moduleType - is the module type
    Returns:
    corresponding list of module factories
  • getTagsByTypeAndToken

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

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

    Parameters:
    _moduleType - is the module type
    _securityToken - is the token
    Returns:
    corresponding list of module factories
  • initialize

    function initialize(address _polymathRegistry, address _owner) external payable 
    Parameters:
    _polymathRegistry - address
    _owner - address
  • isPaused

    function isPaused() public view returns  (bool) 

    Checks whether the contract operations is paused or not.

    Returns:
    bool
  • owner

    function owner() public view returns  (address) 

    Gets the owner of the contract.

    Returns:
    address owner
  • pause

    function pause() external 

    Called by the owner to pause, triggers stopped state.

    Modifiers:
    whenNotPaused onlyOwner 
  • reclaimERC20

    function reclaimERC20(address _tokenContract) external 

    Reclaims all ERC20Basic compatible tokens.

    Modifiers:
    onlyOwner 
    Parameters:
    _tokenContract - The address of the token contract
  • registerModule

    function registerModule(address _moduleFactory) external 

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

    Modifiers:
    whenNotPausedOrOwner 
    Parameters:
    _moduleFactory - is the address of the module factory to be registered
  • removeModule

    function removeModule(address _moduleFactory) external 

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

    Modifiers:
    whenNotPausedOrOwner 
    Parameters:
    _moduleFactory - is the address of the module factory to be deleted from the registry
  • transferOwnership

    function transferOwnership(address _newOwner) external 

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

    Modifiers:
    onlyOwner 
    Parameters:
    _newOwner - The address to transfer ownership to.
  • unpause

    function unpause() external 

    Called by the owner to unpause, returns to normal state.

    Modifiers:
    whenPaused onlyOwner 
  • updateFromRegistry

    function updateFromRegistry() external 

    Stores the contract addresses of other key contracts from the PolymathRegistry.

    Modifiers:
    onlyOwner 
  • useModule

    function useModule(address _moduleFactory) external 

    The feature switch for custom modules is labelled "customModulesAllowed", Called by a SecurityToken to check if the ModuleFactory is verified or appropriate custom module.

    Parameters:
    _moduleFactory - is the address of the relevant module factory
  • verifyModule

    function verifyModule(address _moduleFactory, bool _verified) external 

    -> Only if Polymath enabled the feature.

    Modifiers:
    onlyOwner 
    Parameters:
    _moduleFactory - is the address of the module factory to be verified
    _verified - bool
    Returns:
    bool