Skip to content

Commit 1e60af9

Browse files
codenamejason0xKurtthelostone-mc
authored
Zk era triage (#105)
* 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]>
1 parent 005b7cf commit 1e60af9

23 files changed

+13863
-520
lines changed

.upgradable/zkSync-era.json

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
{
22
"manifestVersion": "3.2",
33
"admin": {
4-
"address": "0x8eDFBfcf436b098C7B25a7D11a0F60e1A811f70c",
5-
"txHash": "0x1e8355ff9eb85d9153b0e49212e06f5e41ba60f8d85c7d86f540e3256bb7fbd7"
4+
"address": "0xA32A2e8c77b3ad879a837B4766ceE247FBf6E8df",
5+
"txHash": "0xf225962c1a46413a859e998ab7cf39e4341c687e68873a931b90ca93d1739b0b"
66
},
77
"proxies": [
88
{
9-
"address": "0xe1b01395986bd93Cc9Fa62290987793c150a1AB2",
10-
"txHash": "0xc341422ed8f683e51968fc9086293b7611bdc3ad944eedc167bc16110754ee6b",
9+
"address": "0x68a14AF71BFa0FE09fC937033f6Ea5153c0e75e4",
10+
"txHash": "0x18721cdf4951898fe6c09f887df1aad2dbebba64b37db4bfce86a357fdf130a9",
1111
"kind": "transparent"
1212
}
1313
],
1414
"impls": {
15-
"aae8603567b3768ea2e8f5334c65ad0ba5e1fbeee71f3d4bcd0469994e306fac": {
16-
"address": "0xF4f71847Dbc541841D1Bf4B07AF7B47584a3dca8",
17-
"txHash": "0x0b912b539f4fa4266b4b5a36f2accdc2eab11d5a41a82d28dec0dd4e42ba321e",
15+
"b33f2f469bdc249af48debe29884079de44f3404c42fc09a338852a54364caf8": {
16+
"address": "0x993abb247BAA8b450BD88Ab212F3F3f9D05BdAE8",
17+
"txHash": "0x917f8a956607495331595d468cff6e344fda07b70da3a3aa6fe42a75275eced1",
1818
"layout": {
1919
"solcVersion": "0.8.17",
2020
"storage": [
@@ -58,14 +58,6 @@
5858
"type": "t_array(t_uint256)49_storage",
5959
"contract": "OwnableUpgradeable",
6060
"src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:94"
61-
},
62-
{
63-
"label": "programContract",
64-
"offset": 0,
65-
"slot": "101",
66-
"type": "t_address",
67-
"contract": "ProgramFactory",
68-
"src": "contracts/program/ProgramFactory.sol:12"
6961
}
7062
],
7163
"types": {

.upgradable/zkSync-testnet.json

Lines changed: 11 additions & 153 deletions
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,30 @@
11
{
22
"manifestVersion": "3.2",
33
"admin": {
4-
"address": "0x08Bfe6ec7831d4bbd48873fCDc89Ef3d2d8c2C4E",
5-
"txHash": "0xc8fd90d2056a2a0eda2d5a42b8d9e267de1f0d199b77cb54899511a8eb1ece1e"
4+
"address": "0x03f2d2fFd7D6192Bf3248aF454c233303D6791a4",
5+
"txHash": "0xbaa8b461558d2e3fa7c6dd9ab6cbc65a7643590953a9ca63d787710cd848884f"
66
},
77
"proxies": [
88
{
9-
"address": "0xa1F116d1Cb73b6f8dDFD6DDD6E06386553B3af7b",
10-
"txHash": "0xc572446d3cd6f1572a0b5c9dceb9daa20a3e063ee28bdeda0ade70140d92ddde",
9+
"address": "0xA1d9DFbBD7CF30dE70E22e23245fc5849d661DfB",
10+
"txHash": "0x5883b72662b2410f79e8c364040226f2a320a2e2190486ebf12ecfe3df4d45fe",
1111
"kind": "transparent"
1212
},
1313
{
14-
"address": "0xE3710C11A5E06E987657A8ce665961362C079De3",
15-
"txHash": "0xb6739e415c7fd98cfc5c3f6b41e893e54f23f84534e7651892b9863dcabac53f",
14+
"address": "0xeC48DFcC3e5A9594229B5e2900b5b1De29f15F8D",
15+
"txHash": "0xe8e374458c8afc4a768f9bd552970446c1811cbf88ff77a8793abeecee5e9748",
1616
"kind": "transparent"
1717
},
1818
{
19-
"address": "0x5A7ea8C03C40e02A97B1901101e415Fdfc1aE64d",
20-
"txHash": "0x0fd3091cc55805c3ebcc53b8473c4fcf5ec819a33c32519c32f2eb8b46075d92",
21-
"kind": "transparent"
22-
},
23-
{
24-
"address": "0xA86824AB3038daCfeB61e03f45CA1a02b77f1081",
25-
"txHash": "0x15af4956d88aadd4b55122e106b57a027678a02a1c5c1ad8004232d3ddc50103",
26-
"kind": "transparent"
27-
},
28-
{
29-
"address": "0x590638033E8DeE4028244326c1ecA251c8022346",
30-
"txHash": "0xbeb232d9192ed76cd374e6456340e18127c8974864f6a19794ea8fbdc025241d",
31-
"kind": "transparent"
32-
},
33-
{
34-
"address": "0x7f5D2e3aC29265a7E09A642b7e22421dc0Cd4075",
35-
"txHash": "0x3bebfdfd92233167573dc15a414d5e501cf184bb3e93983ea9854435dcf39a52",
36-
"kind": "transparent"
37-
},
38-
{
39-
"address": "0x1a7f5eB2632A0DACA98a1CC5091887C1f4F5Fc0c",
40-
"txHash": "0xf4d04a7d773c3b4c49867616e2984a71d479c5ff89a6a8412e48d95bee1ba124",
41-
"kind": "transparent"
42-
},
43-
{
44-
"address": "0x9c0f0600BF83d08EFfb1B8ff90c71B57c68c3B15",
45-
"txHash": "0xfe8e573712e5dc4dcf191fdf94987fdede1c92a66e0a731fb4450e25c7524f9d",
46-
"kind": "transparent"
47-
},
48-
{
49-
"address": "0x8A777C2f88BCEF9ECC2F4B1f70E0262718D130e5",
50-
"txHash": "0x0bf3a3bac8c59d735d9170bfec4945d392b6664b2982aa82bcf9f10611be3c1d",
51-
"kind": "transparent"
52-
},
53-
{
54-
"address": "0x993abb247BAA8b450BD88Ab212F3F3f9D05BdAE8",
55-
"txHash": "0x3eac4aac5a303bdb8c015a86b0cbaacccb838148d44e6a97eca53b174b424b01",
56-
"kind": "transparent"
57-
},
58-
{
59-
"address": "0x1c58945a9A61a3390c56a24d42fEab7106E48d03",
60-
"txHash": "0x339de88c0a2f73cdbf38d88978a92c8a02d987579ff43c0d86f43e412f0e51b7",
61-
"kind": "transparent"
62-
},
63-
{
64-
"address": "0x24076909f4ecDCAe328392E6ae077090101c48Cd",
65-
"txHash": "0xc664f6b27aa229fb3c728a45bf60304c7be8dea501e90a211eb7f324595d26e0",
66-
"kind": "transparent"
67-
},
68-
{
69-
"address": "0x733847d96870f2Fa4789C4C8b6e78345F53919e2",
70-
"txHash": "0xd9efd848d7c6846621647ed21373c6787f1a337a29c18c6e2f741ab9a2a77b17",
19+
"address": "0x6D341814Be4E2316142D9190E390b494F1dECFAf",
20+
"txHash": "0x2441ec92e3f78064ebb95a71231f9a2159a847515b503075a453d051036d1d63",
7121
"kind": "transparent"
7222
}
7323
],
7424
"impls": {
75-
"aae8603567b3768ea2e8f5334c65ad0ba5e1fbeee71f3d4bcd0469994e306fac": {
76-
"address": "0xe1b01395986bd93Cc9Fa62290987793c150a1AB2",
77-
"txHash": "0x6dc73c9b6376fd03bbed6936807c015cd5c92162bf241c316ce495575f7a190f",
25+
"b33f2f469bdc249af48debe29884079de44f3404c42fc09a338852a54364caf8": {
26+
"address": "0x6A75d630f88647AB36869aba70947a9fE832706C",
27+
"txHash": "0xf73afb16e8a6874a43638001d2ad58e70abd37312dba741a3071c3f39a246de4",
7828
"layout": {
7929
"solcVersion": "0.8.17",
8030
"storage": [
@@ -118,98 +68,6 @@
11868
"type": "t_array(t_uint256)49_storage",
11969
"contract": "OwnableUpgradeable",
12070
"src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:94"
121-
},
122-
{
123-
"label": "programContract",
124-
"offset": 0,
125-
"slot": "101",
126-
"type": "t_address",
127-
"contract": "ProgramFactory",
128-
"src": "contracts/program/ProgramFactory.sol:12"
129-
}
130-
],
131-
"types": {
132-
"t_address": {
133-
"label": "address",
134-
"numberOfBytes": "20"
135-
},
136-
"t_array(t_uint256)49_storage": {
137-
"label": "uint256[49]",
138-
"numberOfBytes": "1568"
139-
},
140-
"t_array(t_uint256)50_storage": {
141-
"label": "uint256[50]",
142-
"numberOfBytes": "1600"
143-
},
144-
"t_bool": {
145-
"label": "bool",
146-
"numberOfBytes": "1"
147-
},
148-
"t_uint256": {
149-
"label": "uint256",
150-
"numberOfBytes": "32"
151-
},
152-
"t_uint8": {
153-
"label": "uint8",
154-
"numberOfBytes": "1"
155-
}
156-
}
157-
}
158-
},
159-
"3b918698381d5ee133f52f5b18e939c12b5fb00a8ad271c2406bffbb4f7deac5": {
160-
"address": "0xF631C72e0C5837b794911DDaf167861d1A3eDBf5",
161-
"txHash": "0x536fe1114745a4eaf02b3b8414aa130d3968202b4b179b30c040f57fb6a3f7f5",
162-
"layout": {
163-
"solcVersion": "0.8.17",
164-
"storage": [
165-
{
166-
"label": "_initialized",
167-
"offset": 0,
168-
"slot": "0",
169-
"type": "t_uint8",
170-
"contract": "Initializable",
171-
"src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:62",
172-
"retypedFrom": "bool"
173-
},
174-
{
175-
"label": "_initializing",
176-
"offset": 1,
177-
"slot": "0",
178-
"type": "t_bool",
179-
"contract": "Initializable",
180-
"src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:67"
181-
},
182-
{
183-
"label": "__gap",
184-
"offset": 0,
185-
"slot": "1",
186-
"type": "t_array(t_uint256)50_storage",
187-
"contract": "ContextUpgradeable",
188-
"src": "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol:36"
189-
},
190-
{
191-
"label": "_owner",
192-
"offset": 0,
193-
"slot": "51",
194-
"type": "t_address",
195-
"contract": "OwnableUpgradeable",
196-
"src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:22"
197-
},
198-
{
199-
"label": "__gap",
200-
"offset": 0,
201-
"slot": "52",
202-
"type": "t_array(t_uint256)49_storage",
203-
"contract": "OwnableUpgradeable",
204-
"src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:87"
205-
},
206-
{
207-
"label": "programContract",
208-
"offset": 0,
209-
"slot": "101",
210-
"type": "t_address",
211-
"contract": "ProgramFactory",
212-
"src": "contracts/program/ProgramFactory.sol:12"
21371
}
21472
],
21573
"types": {
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
// SPDX-License-Identifier: AGPL-3.0-only
2+
pragma solidity 0.8.17;
3+
4+
import "./DirectPayoutStrategyImplementation.sol";
5+
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
6+
7+
import "../../utils/MetaPtr.sol";
8+
9+
contract DirectPayoutStrategyFactoryZk is OwnableUpgradeable {
10+
11+
// --- Event ---
12+
13+
/// @notice Emitted when a new payout contract is created
14+
event PayoutContractCreated(
15+
address indexed payoutContractAddress,
16+
address indexed payoutImplementation
17+
);
18+
19+
/// @notice constructor function which ensure deployer is set as owner
20+
function initialize() external initializer {
21+
__Context_init_unchained();
22+
__Ownable_init_unchained();
23+
}
24+
25+
// --- Core methods ---
26+
27+
/**
28+
* @notice Clones DirectPayoutStrategyImplementation and deploys a contract
29+
* and emits an event
30+
*/
31+
function create() external returns (address) {
32+
33+
address impl = address(new DirectPayoutStrategyImplementation());
34+
DirectPayoutStrategyImplementation(payable(impl)).initialize();
35+
emit PayoutContractCreated(impl, address(0));
36+
37+
return impl;
38+
}
39+
40+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
// SPDX-License-Identifier: AGPL-3.0-only
2+
pragma solidity 0.8.17;
3+
4+
import "./MerklePayoutStrategyImplementation.sol";
5+
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
6+
import "../../utils/MetaPtr.sol";
7+
8+
contract MerklePayoutStrategyFactoryZk is OwnableUpgradeable {
9+
10+
// --- Event ---
11+
12+
/// @notice Emitted when a new payout contract is created
13+
event PayoutContractCreated(
14+
address indexed payoutContractAddress,
15+
address indexed payoutImplementation
16+
);
17+
18+
/// @notice constructor function which ensure deployer is set as owner
19+
function initialize() external initializer {
20+
__Context_init_unchained();
21+
__Ownable_init_unchained();
22+
}
23+
24+
// --- Core methods ---
25+
26+
/**
27+
* @notice Clones MerklePayoutStrategyImplementation and deploys a contract
28+
* and emits an event
29+
*/
30+
function create(
31+
) external returns (address) {
32+
33+
address impl = address(new MerklePayoutStrategyImplementation());
34+
MerklePayoutStrategyImplementation(payable(impl)).initialize();
35+
emit PayoutContractCreated(impl, address(0));
36+
37+
return impl;
38+
}
39+
40+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// SPDX-License-Identifier: AGPL-3.0-only
2+
pragma solidity 0.8.17;
3+
4+
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
5+
import "./ProgramImplementation.sol";
6+
7+
contract ProgramFactoryZk is OwnableUpgradeable {
8+
9+
// --- Event ---
10+
11+
/// @notice Emitted when a new Program is created
12+
event ProgramCreated(address indexed programContractAddress, address indexed programImplementation);
13+
14+
/// @notice constructor function which ensure deployer is set as owner
15+
function initialize() external initializer {
16+
__Context_init_unchained();
17+
__Ownable_init_unchained();
18+
}
19+
20+
// --- Core methods ---
21+
22+
/**
23+
* @notice Clones ProgramImplmentation and deployed a program and emits an event
24+
*
25+
* @param encodedParameters Encoded parameters for creating a program
26+
*/
27+
function create(
28+
bytes calldata encodedParameters
29+
) external returns (address) {
30+
31+
address impl = address(new ProgramImplementation());
32+
emit ProgramCreated(impl, address(0));
33+
ProgramImplementation(impl).initialize(encodedParameters);
34+
35+
return impl;
36+
}
37+
}

0 commit comments

Comments
 (0)