Skip to content

Commit 91b415f

Browse files
authored
Merge pull request #594 from PolymathNetwork/fix-types-tags
Clean up types & tags
2 parents dede0da + f7f45b0 commit 91b415f

28 files changed

+86
-366
lines changed

contracts/modules/Checkpoint/ERC20/ERC20DividendCheckpoint.sol

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ contract ERC20DividendCheckpoint is ERC20DividendCheckpointStorage, DividendChec
165165
require(_name[0] != 0);
166166
uint256 dividendIndex = dividends.length;
167167
uint256 currentSupply = securityTokenInstance.totalSupplyAt(_checkpointId);
168+
require(currentSupply > 0, "Invalid supply");
168169
uint256 excludedSupply = 0;
169170
dividends.push(
170171
Dividend(

contracts/modules/Checkpoint/ERC20/ERC20DividendCheckpointFactory.sol

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ contract ERC20DividendCheckpointFactory is UpgradableModuleFactory {
2929
name = "ERC20DividendCheckpoint";
3030
title = "ERC20 Dividend Checkpoint";
3131
description = "Create ERC20 dividends for token holders at a specific checkpoint";
32+
typesData.push(4);
33+
tagsData.push("ERC20");
34+
tagsData.push("Dividend");
35+
tagsData.push("Checkpoint");
3236
compatibleSTVersionRange["lowerBound"] = VersionUtils.pack(uint8(0), uint8(0), uint8(0));
3337
compatibleSTVersionRange["upperBound"] = VersionUtils.pack(uint8(0), uint8(0), uint8(0));
3438
}
@@ -43,23 +47,4 @@ contract ERC20DividendCheckpointFactory is UpgradableModuleFactory {
4347
return erc20DividendCheckpoint;
4448
}
4549

46-
/**
47-
* @notice Type of the Module factory
48-
*/
49-
function types() external view returns(uint8[] memory) {
50-
uint8[] memory res = new uint8[](1);
51-
res[0] = 4;
52-
return res;
53-
}
54-
55-
/**
56-
* @notice Get the tags related to the module factory
57-
*/
58-
function tags() external view returns(bytes32[] memory) {
59-
bytes32[] memory availableTags = new bytes32[](3);
60-
availableTags[0] = "ERC20";
61-
availableTags[1] = "Dividend";
62-
availableTags[2] = "Checkpoint";
63-
return availableTags;
64-
}
6550
}

contracts/modules/Checkpoint/Ether/EtherDividendCheckpoint.sol

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ contract EtherDividendCheckpoint is DividendCheckpoint {
131131
require(_name[0] != 0);
132132
uint256 dividendIndex = dividends.length;
133133
uint256 currentSupply = ISecurityToken(securityToken).totalSupplyAt(_checkpointId);
134+
require(currentSupply > 0, "Invalid supply");
134135
uint256 excludedSupply = 0;
135136
dividends.push(
136137
Dividend(

contracts/modules/Checkpoint/Ether/EtherDividendCheckpointFactory.sol

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ contract EtherDividendCheckpointFactory is UpgradableModuleFactory {
2929
name = "EtherDividendCheckpoint";
3030
title = "Ether Dividend Checkpoint";
3131
description = "Create ETH dividends for token holders at a specific checkpoint";
32+
typesData.push(4);
33+
tagsData.push("Ether");
34+
tagsData.push("Dividend");
35+
tagsData.push("Checkpoint");
3236
compatibleSTVersionRange["lowerBound"] = VersionUtils.pack(uint8(0), uint8(0), uint8(0));
3337
compatibleSTVersionRange["upperBound"] = VersionUtils.pack(uint8(0), uint8(0), uint8(0));
3438
}
@@ -43,23 +47,4 @@ contract EtherDividendCheckpointFactory is UpgradableModuleFactory {
4347
return ethDividendCheckpoint;
4448
}
4549

46-
/**
47-
* @notice Type of the Module factory
48-
*/
49-
function types() external view returns(uint8[] memory) {
50-
uint8[] memory res = new uint8[](1);
51-
res[0] = 4;
52-
return res;
53-
}
54-
55-
/**
56-
* @notice Get the tags related to the module factory
57-
*/
58-
function tags() external view returns(bytes32[] memory) {
59-
bytes32[] memory availableTags = new bytes32[](3);
60-
availableTags[0] = "ETH";
61-
availableTags[1] = "Checkpoint";
62-
availableTags[2] = "Dividend";
63-
return availableTags;
64-
}
6550
}

contracts/modules/Experimental/Burn/TrackedRedemptionFactory.sol

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ contract TrackedRedemptionFactory is ModuleFactory {
2525
name = "TrackedRedemption";
2626
title = "Tracked Redemption";
2727
description = "Track token redemptions";
28+
typesData.push(5);
29+
tagsData.push("Tracked");
30+
tagsData.push("Redemption");
2831
compatibleSTVersionRange["lowerBound"] = VersionUtils.pack(uint8(0), uint8(0), uint8(0));
2932
compatibleSTVersionRange["upperBound"] = VersionUtils.pack(uint8(0), uint8(0), uint8(0));
3033
}
@@ -44,23 +47,4 @@ contract TrackedRedemptionFactory is ModuleFactory {
4447
return trackedRedemption;
4548
}
4649

47-
/**
48-
* @notice Type of the Module factory
49-
*/
50-
function types() external view returns(uint8[] memory) {
51-
uint8[] memory res = new uint8[](1);
52-
res[0] = 5;
53-
return res;
54-
}
55-
56-
/**
57-
* @notice Get the tags related to the module factory
58-
*/
59-
function tags() external view returns(bytes32[] memory) {
60-
bytes32[] memory availableTags = new bytes32[](2);
61-
availableTags[0] = "Redemption";
62-
availableTags[1] = "Tracked";
63-
return availableTags;
64-
}
65-
6650
}

contracts/modules/Experimental/Mixed/ScheduledCheckpointFactory.sol

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ contract ScheduledCheckpointFactory is ModuleFactory {
2525
name = "ScheduledCheckpoint";
2626
title = "Schedule Checkpoints";
2727
description = "Allows you to schedule checkpoints in the future";
28+
typesData.push(4);
29+
typesData.push(2);
30+
tagsData.push("Scheduled");
31+
tagsData.push("Checkpoint");
2832
compatibleSTVersionRange["lowerBound"] = VersionUtils.pack(uint8(0), uint8(0), uint8(0));
2933
compatibleSTVersionRange["upperBound"] = VersionUtils.pack(uint8(0), uint8(0), uint8(0));
3034
}
@@ -44,23 +48,4 @@ contract ScheduledCheckpointFactory is ModuleFactory {
4448
return scheduledCheckpoint;
4549
}
4650

47-
/**
48-
* @notice Type of the Module factory
49-
*/
50-
function types() external view returns(uint8[] memory) {
51-
uint8[] memory res = new uint8[](2);
52-
res[0] = 4;
53-
res[1] = 2;
54-
return res;
55-
}
56-
57-
/**
58-
* @notice Get the tags related to the module factory
59-
*/
60-
function tags() external view returns(bytes32[] memory) {
61-
bytes32[] memory availableTags = new bytes32[](2);
62-
availableTags[0] = "Scheduled";
63-
availableTags[1] = "Checkpoint";
64-
return availableTags;
65-
}
6651
}

contracts/modules/Experimental/TransferManager/BlacklistTransferManagerFactory.sol

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ contract BlacklistTransferManagerFactory is ModuleFactory {
2222
name = "BlacklistTransferManager";
2323
title = "Blacklist Transfer Manager";
2424
description = "Automate blacklist to restrict selling";
25+
typesData.push(2);
26+
tagsData.push("Blacklist");
27+
tagsData.push("Transfer Restriction");
2528
compatibleSTVersionRange["lowerBound"] = VersionUtils.pack(uint8(0), uint8(0), uint8(0));
2629
compatibleSTVersionRange["upperBound"] = VersionUtils.pack(uint8(0), uint8(0), uint8(0));
2730
}
@@ -36,23 +39,4 @@ contract BlacklistTransferManagerFactory is ModuleFactory {
3639
return blacklistTransferManager;
3740
}
3841

39-
/**
40-
* @notice Type of the Module factory
41-
*/
42-
function types() external view returns(uint8[] memory) {
43-
uint8[] memory res = new uint8[](1);
44-
res[0] = 2;
45-
return res;
46-
}
47-
48-
/**
49-
* @notice Get the tags related to the module factory
50-
*/
51-
function tags() public view returns(bytes32[] memory) {
52-
bytes32[] memory availableTags = new bytes32[](2);
53-
availableTags[0] = "Blacklist";
54-
availableTags[1] = "Restricted transfer";
55-
return availableTags;
56-
}
57-
5842
}

contracts/modules/Experimental/TransferManager/KYCTransferManagerFactory.sol

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ contract KYCTransferManagerFactory is ModuleFactory {
1616
name = "KYCTransferManager";
1717
title = "KYC Transfer Manager";
1818
description = "Manages KYC";
19+
typesData.push(2);
20+
typesData.push(6);
21+
tagsData.push("KYC");
22+
tagsData.push("Transfer Restriction");
1923
compatibleSTVersionRange["lowerBound"] = VersionUtils.pack(uint8(0), uint8(0), uint8(0));
2024
compatibleSTVersionRange["upperBound"] = VersionUtils.pack(uint8(0), uint8(0), uint8(0));
2125
}
@@ -31,24 +35,4 @@ contract KYCTransferManagerFactory is ModuleFactory {
3135
return kycTransferManager;
3236
}
3337

34-
35-
/**
36-
* @notice Type of the Module factory
37-
*/
38-
function types() external view returns(uint8[] memory) {
39-
uint8[] memory res = new uint8[](2);
40-
res[0] = 2;
41-
res[1] = 6;
42-
return res;
43-
}
44-
45-
/**
46-
* @notice Get the tags related to the module factory
47-
*/
48-
function tags() public view returns(bytes32[] memory) {
49-
bytes32[] memory availableTags = new bytes32[](1);
50-
availableTags[0] = "KYC";
51-
return availableTags;
52-
}
53-
5438
}

contracts/modules/Experimental/TransferManager/LTM/LockUpTransferManagerFactory.sol

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ contract LockUpTransferManagerFactory is UpgradableModuleFactory {
2727
name = "LockUpTransferManager";
2828
title = "LockUp Transfer Manager";
2929
description = "Manage transfers using lock ups over time";
30+
typesData.push(2);
31+
tagsData.push("LockUp");
32+
tagsData.push("Transfer Restriction");
3033
compatibleSTVersionRange["lowerBound"] = VersionUtils.pack(uint8(0), uint8(0), uint8(0));
3134
compatibleSTVersionRange["upperBound"] = VersionUtils.pack(uint8(0), uint8(0), uint8(0));
3235
}
@@ -46,24 +49,4 @@ contract LockUpTransferManagerFactory is UpgradableModuleFactory {
4649
return lockUpTransferManager;
4750
}
4851

49-
/**
50-
* @notice Type of the Module factory
51-
* @return uint8
52-
*/
53-
function types() external view returns(uint8[] memory) {
54-
uint8[] memory res = new uint8[](1);
55-
res[0] = 2;
56-
return res;
57-
}
58-
59-
/**
60-
* @notice Get the tags related to the module factory
61-
*/
62-
function tags() external view returns(bytes32[] memory) {
63-
bytes32[] memory availableTags = new bytes32[](2);
64-
availableTags[0] = "LockUp";
65-
availableTags[1] = "Transfer Restriction";
66-
return availableTags;
67-
}
68-
6952
}

contracts/modules/Experimental/TransferManager/SignedTransferManagerFactory.sol

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ contract SignedTransferManagerFactory is ModuleFactory {
1818
name = "SignedTransferManager";
1919
title = "Signed Transfer Manager";
2020
description = "Manage transfers using a signature";
21+
typesData.push(2);
22+
typesData.push(6);
23+
tagsData.push("Signed");
24+
tagsData.push("Transfer Restriction");
2125
compatibleSTVersionRange["lowerBound"] = VersionUtils.pack(uint8(0), uint8(0), uint8(0));
2226
compatibleSTVersionRange["upperBound"] = VersionUtils.pack(uint8(0), uint8(0), uint8(0));
2327
}
@@ -33,26 +37,4 @@ contract SignedTransferManagerFactory is ModuleFactory {
3337
return signedTransferManager;
3438
}
3539

36-
37-
/**
38-
* @notice Type of the Module factory
39-
*/
40-
function types() external view returns(uint8[] memory) {
41-
uint8[] memory res = new uint8[](2);
42-
res[0] = 2;
43-
res[1] = 6;
44-
return res;
45-
}
46-
47-
/**
48-
* @notice Get the tags related to the module factory
49-
*/
50-
function tags() public view returns(bytes32[] memory) {
51-
bytes32[] memory availableTags = new bytes32[](2);
52-
availableTags[0] = "Signed";
53-
availableTags[1] = "Transfer Restriction";
54-
return availableTags;
55-
}
56-
57-
5840
}

0 commit comments

Comments
 (0)