-
Notifications
You must be signed in to change notification settings - Fork 160
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
8,300 additions
and
348 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
pragma solidity ^0.4.23; | ||
|
||
import "../modules/STO/DummySTO.sol"; | ||
import "../interfaces/IModuleFactory.sol"; | ||
import "../interfaces/IModule.sol"; | ||
|
||
|
||
contract MockFactory is IModuleFactory { | ||
|
||
constructor (address _polyAddress) public | ||
IModuleFactory(_polyAddress) | ||
{ | ||
|
||
} | ||
|
||
function deploy(bytes _data) external returns(address) { | ||
if(getCost() > 0) | ||
require(polyToken.transferFrom(msg.sender, owner, getCost()), "Failed transferFrom because of sufficent Allowance is not provided"); | ||
//Check valid bytes - can only call module init function | ||
DummySTO dummySTO = new DummySTO(msg.sender, address(polyToken)); | ||
//Checks that _data is valid (not calling anything it shouldn't) | ||
require(getSig(_data) == dummySTO.getInitFunction(), "Provided data is not valid"); | ||
require(address(dummySTO).call(_data), "Un-successfull call"); | ||
return address(dummySTO); | ||
} | ||
|
||
function getCost() public view returns(uint256) { | ||
return uint256(1000 * 10 ** 18); | ||
} | ||
|
||
function getType() public view returns(uint8) { | ||
return 0; | ||
} | ||
|
||
function getName() public view returns(bytes32) { | ||
return "Mock"; | ||
} | ||
|
||
function getDescription() public view returns(string) { | ||
return "MockManager"; | ||
} | ||
|
||
function getTitle() public view returns(string) { | ||
return "Mock Manager"; | ||
} | ||
|
||
function getInstructions() public view returns(string) { | ||
return "Mock Manager - This is mock in nature"; | ||
} | ||
|
||
function getTags() public view returns(bytes32[]) { | ||
bytes32[] memory availableTags = new bytes32[](4); | ||
availableTags[0] = "Mock"; | ||
return availableTags; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.