-
Notifications
You must be signed in to change notification settings - Fork 151
Expand file tree
/
Copy pathEtherDividendCheckpointFactory.sol
More file actions
69 lines (62 loc) · 2.5 KB
/
EtherDividendCheckpointFactory.sol
File metadata and controls
69 lines (62 loc) · 2.5 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 "./EtherDividendCheckpoint.sol";
import "../ModuleFactory.sol";
/**
* @title Factory for deploying EtherDividendCheckpoint module
*/
contract EtherDividendCheckpointFactory is ModuleFactory {
/**
* @notice Constructor
* @param _setupCost Setup cost of the module
* @param _usageCost Usage cost of the module
* @param _subscriptionCost Subscription cost of the module
*/
constructor (uint256 _setupCost, uint256 _usageCost, uint256 _subscriptionCost) public
ModuleFactory(_setupCost, _usageCost, _subscriptionCost)
{
version = "1.0.0";
name = "EtherDividendCheckpoint";
title = "Ether Dividend Checkpoint";
description = "Create ETH dividends for token holders at a specific checkpoint";
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 ethDividendCheckpoint = new EtherDividendCheckpoint(msg.sender);
/*solium-disable-next-line security/no-block-members*/
emit GenerateModuleFromFactory(ethDividendCheckpoint, getName(), address(this), msg.sender, setupCost, now);
return ethDividendCheckpoint;
}
/**
* @notice Type of the Module factory
*/
function getTypes() external view returns(uint8[]) {
uint8[] memory res = new uint8[](1);
res[0] = 4;
return res;
}
/**
* @notice Returns the instructions associated with the module
*/
function getInstructions() external view returns(string) {
return "Create a dividend which will be paid out to token holders proportionally according to their balances at the point the dividend is created";
}
/**
* @notice Get the tags related to the module factory
*/
function getTags() external view returns(bytes32[]) {
bytes32[] memory availableTags = new bytes32[](3);
availableTags[0] = "ETH";
availableTags[1] = "Checkpoint";
availableTags[2] = "Dividend";
return availableTags;
}
}