-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathFeed_Factory.sol
33 lines (27 loc) · 1.54 KB
/
Feed_Factory.sol
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
pragma solidity ^0.5.13;
import "../modules/Factory.sol";
import "./Feed.sol";
/// @title Feed_Factory
/// @author Stephane Gosselin (@thegostep) for Numerai Inc
/// @dev Security contact: security@numer.ai
/// @dev Version: 1.2.0
/// @notice This factory is used to deploy instances of the template contract.
/// New instances can be created with the following functions:
/// `function create(bytes calldata initData) external returns (address instance);`
/// `function createSalty(bytes calldata initData, bytes32 salt) external returns (address instance);`
/// The `initData` parameter is ABI encoded calldata to use on the initialize function of the instance after creation.
/// The optional `salt` parameter can be used to deterministically generate the instance address instead of using a nonce.
/// See documentation of the template for additional details on initialization parameters.
/// The template contract address can be optained with the following function:
/// `function getTemplate() external view returns (address template);`
contract Feed_Factory is Factory {
constructor(address instanceRegistry, address templateContract) public {
Feed template;
// set instance type
bytes4 instanceType = bytes4(keccak256(bytes('Post')));
// set initSelector
bytes4 initSelector = template.initialize.selector;
// initialize factory params
Factory._initialize(instanceRegistry, templateContract, instanceType, initSelector);
}
}