OOFFactory.sol
This contract is used to generate new Open Oracle Framework Contracts.

oofMint

1
function oofMint(
2
address[] memory signers_,
3
uint256 signerThreshold_,
4
address payable payoutAddress_,
5
uint256 subscriptionPassPrice_
6
)
7
external
8
returns(address oof)
Copied!
This function generates a new OOF contract with the values provided by cloning an existing Implementation of OOF to save gas and then calling the initialize function with the values provided as the arguments.
The contract also has the functions to change the ownership, update the Implementation address and the router address.
1
/**
2
* @dev gets the address of the current factory owner
3
*
4
* @return the address of the conjure router
5
*/
6
function getConjureRouter() external view returns (address payable) {
7
return conjureRouter;
8
}
9
10
/**
11
* @dev lets the owner change the current conjure implementation
12
*
13
* @param oofImplementation_ the address of the new implementation
14
*/
15
function newOOFImplementation(address oofImplementation_) external {
16
require(msg.sender == factoryOwner, "Only factory owner");
17
require(oofImplementation_ != address(0), "No zero address for oofImplementation_");
18
19
oofImplementation = oofImplementation_;
20
emit NewOOFImplementation(oofImplementation);
21
}
22
23
/**
24
* @dev lets the owner change the current conjure router
25
*
26
* @param conjureRouter_ the address of the new router
27
*/
28
function newConjureRouter(address payable conjureRouter_) external {
29
require(msg.sender == factoryOwner, "Only factory owner");
30
require(conjureRouter_ != address(0), "No zero address for conjureRouter_");
31
32
conjureRouter = conjureRouter_;
33
emit NewConjureRouter(conjureRouter);
34
}
35
36
/**
37
* @dev lets the owner change the ownership to another address
38
*
39
* @param newOwner the address of the new owner
40
*/
41
function newFactoryOwner(address payable newOwner) external {
42
require(msg.sender == factoryOwner, "Only factory owner");
43
require(newOwner != address(0), "No zero address for newOwner");
44
45
factoryOwner = newOwner;
46
emit FactoryOwnerChanged(factoryOwner);
47
}
48
49
/**
50
* receive function to receive funds
51
*/
52
receive() external payable {}
53
}
54
55
interface IOOF {
56
function initialize(
57
address[] memory signers_,
58
uint256 signerThreshold_,
59
address payable payoutAddress_,
60
uint256 subscriptionPassPrice_,
61
address factoryContract_
62
) external;
63
}
Copied!
Last modified 3mo ago
Copy link
Contents
oofMint