-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* working on zk deploy * add zk specific file * experimental but working program factory * chore: add new factory contract * update script * update script * fix * fix sscript * update * fix * remove era * mainnet deploys --------- Co-authored-by: 0xKurt <[email protected]> Co-authored-by: Aditya Anand M C <[email protected]>
- Loading branch information
1 parent
005b7cf
commit 1e60af9
Showing
23 changed files
with
13,863 additions
and
520 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
40 changes: 40 additions & 0 deletions
40
contracts/payoutStrategy/DirectPayoutStrategy/DirectPayoutStrategyFactoryZk.sol
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,40 @@ | ||
// SPDX-License-Identifier: AGPL-3.0-only | ||
pragma solidity 0.8.17; | ||
|
||
import "./DirectPayoutStrategyImplementation.sol"; | ||
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; | ||
|
||
import "../../utils/MetaPtr.sol"; | ||
|
||
contract DirectPayoutStrategyFactoryZk is OwnableUpgradeable { | ||
|
||
// --- Event --- | ||
|
||
/// @notice Emitted when a new payout contract is created | ||
event PayoutContractCreated( | ||
address indexed payoutContractAddress, | ||
address indexed payoutImplementation | ||
); | ||
|
||
/// @notice constructor function which ensure deployer is set as owner | ||
function initialize() external initializer { | ||
__Context_init_unchained(); | ||
__Ownable_init_unchained(); | ||
} | ||
|
||
// --- Core methods --- | ||
|
||
/** | ||
* @notice Clones DirectPayoutStrategyImplementation and deploys a contract | ||
* and emits an event | ||
*/ | ||
function create() external returns (address) { | ||
|
||
address impl = address(new DirectPayoutStrategyImplementation()); | ||
DirectPayoutStrategyImplementation(payable(impl)).initialize(); | ||
emit PayoutContractCreated(impl, address(0)); | ||
|
||
return impl; | ||
} | ||
|
||
} |
40 changes: 40 additions & 0 deletions
40
contracts/payoutStrategy/MerklePayoutStrategy/MerklePayoutStrategyFactoryZk.sol
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,40 @@ | ||
// SPDX-License-Identifier: AGPL-3.0-only | ||
pragma solidity 0.8.17; | ||
|
||
import "./MerklePayoutStrategyImplementation.sol"; | ||
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; | ||
import "../../utils/MetaPtr.sol"; | ||
|
||
contract MerklePayoutStrategyFactoryZk is OwnableUpgradeable { | ||
|
||
// --- Event --- | ||
|
||
/// @notice Emitted when a new payout contract is created | ||
event PayoutContractCreated( | ||
address indexed payoutContractAddress, | ||
address indexed payoutImplementation | ||
); | ||
|
||
/// @notice constructor function which ensure deployer is set as owner | ||
function initialize() external initializer { | ||
__Context_init_unchained(); | ||
__Ownable_init_unchained(); | ||
} | ||
|
||
// --- Core methods --- | ||
|
||
/** | ||
* @notice Clones MerklePayoutStrategyImplementation and deploys a contract | ||
* and emits an event | ||
*/ | ||
function create( | ||
) external returns (address) { | ||
|
||
address impl = address(new MerklePayoutStrategyImplementation()); | ||
MerklePayoutStrategyImplementation(payable(impl)).initialize(); | ||
emit PayoutContractCreated(impl, address(0)); | ||
|
||
return impl; | ||
} | ||
|
||
} |
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,37 @@ | ||
// SPDX-License-Identifier: AGPL-3.0-only | ||
pragma solidity 0.8.17; | ||
|
||
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; | ||
import "./ProgramImplementation.sol"; | ||
|
||
contract ProgramFactoryZk is OwnableUpgradeable { | ||
|
||
// --- Event --- | ||
|
||
/// @notice Emitted when a new Program is created | ||
event ProgramCreated(address indexed programContractAddress, address indexed programImplementation); | ||
|
||
/// @notice constructor function which ensure deployer is set as owner | ||
function initialize() external initializer { | ||
__Context_init_unchained(); | ||
__Ownable_init_unchained(); | ||
} | ||
|
||
// --- Core methods --- | ||
|
||
/** | ||
* @notice Clones ProgramImplmentation and deployed a program and emits an event | ||
* | ||
* @param encodedParameters Encoded parameters for creating a program | ||
*/ | ||
function create( | ||
bytes calldata encodedParameters | ||
) external returns (address) { | ||
|
||
address impl = address(new ProgramImplementation()); | ||
emit ProgramCreated(impl, address(0)); | ||
ProgramImplementation(impl).initialize(encodedParameters); | ||
|
||
return impl; | ||
} | ||
} |
Oops, something went wrong.