-
Notifications
You must be signed in to change notification settings - Fork 151
Expand file tree
/
Copy pathTrackedRedemptionFactory.sol
More file actions
69 lines (61 loc) · 2.33 KB
/
TrackedRedemptionFactory.sol
File metadata and controls
69 lines (61 loc) · 2.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
pragma solidity ^0.4.24;
import "./TrackedRedemption.sol";
import "../../ModuleFactory.sol";
/**
* @title Factory for deploying GeneralTransferManager module
*/
contract TrackedRedemptionFactory is ModuleFactory {
/**
* @notice Constructor
* @param _setupCost Setup cost of module
* @param _usageCost Usage cost of module
* @param _subscriptionCost Monthly cost of module
*/
constructor (uint256 _setupCost, uint256 _usageCost, uint256 _subscriptionCost) public
ModuleFactory(_setupCost, _usageCost, _subscriptionCost)
{
version = "1.0.0";
name = "TrackedRedemption";
title = "Tracked Redemption";
description = "Track token redemptions";
compatibleSTVersionRange["lowerBound"] = VersionUtils.pack(uint8(0), uint8(0), uint8(0));
compatibleSTVersionRange["upperBound"] = VersionUtils.pack(uint8(0), uint8(0), uint8(0));
}
/**
* @notice Used to launch the Module with the help of factory
* @return Address Contract address of the Module
*/
function deploy(bytes /* _data */) external returns(address) {
updateFromRegistry(msg.sender);
if (setupCost > 0) {
require(polyToken.transferFrom(msg.sender, owner(), setupCost), "Insufficent allowance or balance");
}
address trackedRedemption = new TrackedRedemption(msg.sender);
/*solium-disable-next-line security/no-block-members*/
emit GenerateModuleFromFactory(address(trackedRedemption), getName(), address(this), msg.sender, setupCost, now);
return address(trackedRedemption);
}
/**
* @notice Type of the Module factory
*/
function getTypes() external view returns(uint8[]) {
uint8[] memory res = new uint8[](1);
res[0] = 5;
return res;
}
/**
* @notice Returns the instructions associated with the module
*/
function getInstructions() external view returns(string) {
return "Allows an investor to redeem security tokens which are tracked by this module";
}
/**
* @notice Get the tags related to the module factory
*/
function getTags() external view returns(bytes32[]) {
bytes32[] memory availableTags = new bytes32[](2);
availableTags[0] = "Redemption";
availableTags[1] = "Tracked";
return availableTags;
}
}