@@ -90,6 +90,7 @@ contract SecurityToken is ERC20, ERC20Detailed, ReentrancyGuard, RegistryUpdater
9090 address _module ,
9191 uint256 _moduleCost ,
9292 uint256 _budget ,
93+ bytes32 _label ,
9394 uint256 _timestamp
9495 );
9596
@@ -213,21 +214,24 @@ contract SecurityToken is ERC20, ERC20Detailed, ReentrancyGuard, RegistryUpdater
213214 securityTokenVersion = SemanticVersion (2 ,0 ,0 );
214215 }
215216
216- /**
217- * @notice Attachs a module to the SecurityToken
218- * @dev E.G.: On deployment (through the STR) ST gets a TransferManager module attached to it
219- * @dev to control restrictions on transfers.
220- * @param _moduleFactory is the address of the module factory to be added
221- * @param _data is data packed into bytes used to further configure the module (See STO usage)
222- * @param _maxCost max amount of POLY willing to pay to the module.
223- * @param _budget max amount of ongoing POLY willing to assign to the module.
224- */
225- function addModule (
217+ // /**
218+ // * @notice Attachs a module to the SecurityToken
219+ // * @dev E.G.: On deployment (through the STR) ST gets a TransferManager module attached to it
220+ // * @dev to control restrictions on transfers.
221+ // * @param _moduleFactory is the address of the module factory to be added
222+ // * @param _data is data packed into bytes used to further configure the module (See STO usage)
223+ // * @param _maxCost max amount of POLY willing to pay to the module.
224+ // * @param _budget max amount of ongoing POLY willing to assign to the module.
225+ // * @param _label custom module label.
226+ // */
227+
228+ function addModuleWithLabel (
226229 address _moduleFactory ,
227230 bytes _data ,
228231 uint256 _maxCost ,
229- uint256 _budget
230- ) external onlyOwner nonReentrant {
232+ uint256 _budget ,
233+ bytes32 _label
234+ ) public onlyOwner nonReentrant {
231235 //Check that the module factory exists in the ModuleRegistry - will throw otherwise
232236 IModuleRegistry (moduleRegistry).useModule (_moduleFactory);
233237 IModuleFactory moduleFactory = IModuleFactory (_moduleFactory);
@@ -250,12 +254,24 @@ contract SecurityToken is ERC20, ERC20Detailed, ReentrancyGuard, RegistryUpdater
250254 modules[moduleTypes[i]].push (module);
251255 }
252256 modulesToData[module] = TokenLib.ModuleData (
253- moduleName, module, _moduleFactory, false , moduleTypes, moduleIndexes, names[moduleName].length
257+ moduleName, module, _moduleFactory, false , moduleTypes, moduleIndexes, names[moduleName].length , _label
254258 );
255259 names[moduleName].push (module);
256260 //Emit log event
257261 /*solium-disable-next-line security/no-block-members*/
258- emit ModuleAdded (moduleTypes, moduleName, _moduleFactory, module, moduleCost, _budget, now );
262+ emit ModuleAdded (moduleTypes, moduleName, _moduleFactory, module, moduleCost, _budget, _label, now );
263+ }
264+
265+ /**
266+ * @notice addModule function will call addModuleWithLabel() with an empty label for backward compatible
267+ */
268+ function addModule (
269+ address _moduleFactory ,
270+ bytes _data ,
271+ uint256 _maxCost ,
272+ uint256 _budget
273+ ) external {
274+ addModuleWithLabel (_moduleFactory, _data, _maxCost, _budget, "" );
259275 }
260276
261277 /**
@@ -330,12 +346,13 @@ contract SecurityToken is ERC20, ERC20Detailed, ReentrancyGuard, RegistryUpdater
330346 * @return bool module archived
331347 * @return uint8 module type
332348 */
333- function getModule (address _module ) external view returns (bytes32 , address , address , bool , uint8 []) {
349+ function getModule (address _module ) external view returns (bytes32 , address , address , bool , uint8 [], bytes32 ) {
334350 return (modulesToData[_module].name,
335351 modulesToData[_module].module,
336352 modulesToData[_module].moduleFactory,
337353 modulesToData[_module].isArchived,
338- modulesToData[_module].moduleTypes);
354+ modulesToData[_module].moduleTypes,
355+ modulesToData[_module].label);
339356 }
340357
341358 /**
0 commit comments