TokenySolutions / T-REX

T-REX is a suite of smart contracts implementing the EIP 3643 and developed by Tokeny to manage and transfer financial assets on EVM blockchains

Home Page:https://tokeny.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

add compliance modules as compliance agent

IliasElbarnoussi opened this issue · comments

Hello, is it possible for agents to add compliance modules to the modular compliance contract, since currently only the owner can do that? I've also noticed that the role of compliance agents isn't being utilized anywhere.

  function addModule(address _module) external override onlyOwner {
      require(_module != address(0), "invalid argument - zero address");
      require(!_moduleBound[_module], "module already bound");
      require(_modules.length <= 24, "cannot add more than 25 modules");
      IModule module = IModule(_module);
      if (!module.isPlugAndPlay()) {
          require(module.canComplianceBind(address(this)), "compliance is not suitable for binding to the module");
      }

      module.bindCompliance(address(this));
      _modules.push(_module);
      _moduleBound[_module] = true;
      emit ModuleAdded(_module);
  }