forked from moneypipe-org/stream
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFactory.sol
More file actions
28 lines (25 loc) · 789 Bytes
/
Copy pathFactory.sol
File metadata and controls
28 lines (25 loc) · 789 Bytes
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
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/proxy/Clones.sol";
import "./SafeStream.sol";
contract Factory {
event ContractDeployed(
address indexed owner,
address indexed group,
string title
);
address public immutable implementation;
constructor() {
implementation = address(new SafeStream());
}
function genesis(string calldata title, address _fallback, SafeStream.Member[] calldata members)
external
returns (address)
{
address payable clone = payable(Clones.clone(implementation));
SafeStream s = SafeStream(clone);
s.initialize(members, _fallback);
emit ContractDeployed(msg.sender, clone, title);
return clone;
}
}