-
Notifications
You must be signed in to change notification settings - Fork 151
Expand file tree
/
Copy pathMockBurnFactory.sol
More file actions
39 lines (33 loc) · 1.39 KB
/
MockBurnFactory.sol
File metadata and controls
39 lines (33 loc) · 1.39 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
pragma solidity ^0.4.24;
import "./MockRedemptionManager.sol";
import "../modules/Experimental/Burn/TrackedRedemptionFactory.sol";
/**
* @title Mock Contract Not fit for production environment
*/
contract MockBurnFactory is TrackedRedemptionFactory {
/**
* @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
TrackedRedemptionFactory(_setupCost, _usageCost, _subscriptionCost)
{
}
/**
* @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), "Unable to pay setup cost");
}
//Check valid bytes - can only call module init function
MockRedemptionManager mockRedemptionManager = new MockRedemptionManager(msg.sender);
/*solium-disable-next-line security/no-block-members*/
emit GenerateModuleFromFactory(address(mockRedemptionManager), getName(), address(this), msg.sender, setupCost, now);
return address(mockRedemptionManager);
}
}