@zoralabs/coins 0.5.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/.env.example +7 -0
  2. package/.turbo/turbo-build.log +49 -37
  3. package/CHANGELOG.md +6 -0
  4. package/README.md +29 -0
  5. package/abis/CoinTest.json +28 -0
  6. package/abis/Create2.json +28 -0
  7. package/abis/DeployScript.json +9 -0
  8. package/abis/DeterministicDeployerAndCaller.json +315 -0
  9. package/abis/DeterministicUUPSProxyDeployer.json +167 -0
  10. package/abis/FactoryTest.json +20 -0
  11. package/abis/GenerateDeterministicParams.json +9 -0
  12. package/abis/IERC165.json +1 -1
  13. package/abis/IERC20.json +42 -39
  14. package/abis/IImmutableCreate2Factory.json +93 -0
  15. package/abis/ISafe.json +15 -0
  16. package/abis/ISymbol.json +15 -0
  17. package/abis/ImmutableCreate2FactoryUtils.json +15 -0
  18. package/abis/LibString.json +7 -0
  19. package/abis/ProxyShim.json +112 -0
  20. package/abis/UUPSUpgradeable.json +15 -14
  21. package/abis/ZoraFactory.json +0 -5
  22. package/addresses/8453.json +5 -8
  23. package/addresses/84532.json +5 -8
  24. package/deterministicConfig/deployerAndCaller.json +5 -0
  25. package/deterministicConfig/zoraFactory.json +8 -0
  26. package/foundry.toml +14 -0
  27. package/package.json +3 -2
  28. package/remappings.txt +2 -1
  29. package/script/CoinsDeployerBase.sol +98 -0
  30. package/script/Deploy.s.sol +14 -5
  31. package/script/GenerateDeterministicParams.s.sol +43 -0
  32. package/src/Coin.sol +1 -1
  33. package/src/proxy/ZoraFactory.sol +7 -1
  34. package/src/utils/CoinConstants.sol +2 -2
  35. package/src/version/ContractVersionBase.sol +1 -1
  36. package/test/Coin.t.sol +119 -6
  37. package/test/Factory.t.sol +34 -11
  38. package/test/utils/BaseTest.sol +4 -4
  39. package/abis/Deploy.json +0 -29
  40. package/addresses/1.json +0 -4
@@ -0,0 +1,167 @@
1
+ [
2
+ {
3
+ "type": "constructor",
4
+ "inputs": [],
5
+ "stateMutability": "nonpayable"
6
+ },
7
+ {
8
+ "type": "function",
9
+ "name": "expectedProxyAddress",
10
+ "inputs": [
11
+ {
12
+ "name": "proxySalt",
13
+ "type": "bytes32",
14
+ "internalType": "bytes32"
15
+ },
16
+ {
17
+ "name": "proxyCode",
18
+ "type": "bytes",
19
+ "internalType": "bytes"
20
+ }
21
+ ],
22
+ "outputs": [
23
+ {
24
+ "name": "",
25
+ "type": "address",
26
+ "internalType": "address"
27
+ }
28
+ ],
29
+ "stateMutability": "view"
30
+ },
31
+ {
32
+ "type": "function",
33
+ "name": "proxyConstructorArgs",
34
+ "inputs": [],
35
+ "outputs": [
36
+ {
37
+ "name": "",
38
+ "type": "bytes",
39
+ "internalType": "bytes"
40
+ }
41
+ ],
42
+ "stateMutability": "view"
43
+ },
44
+ {
45
+ "type": "function",
46
+ "name": "proxyCreationCode",
47
+ "inputs": [
48
+ {
49
+ "name": "transparentProxyCode",
50
+ "type": "bytes",
51
+ "internalType": "bytes"
52
+ }
53
+ ],
54
+ "outputs": [
55
+ {
56
+ "name": "",
57
+ "type": "bytes",
58
+ "internalType": "bytes"
59
+ }
60
+ ],
61
+ "stateMutability": "view"
62
+ },
63
+ {
64
+ "type": "function",
65
+ "name": "proxyShimAddress",
66
+ "inputs": [],
67
+ "outputs": [
68
+ {
69
+ "name": "",
70
+ "type": "address",
71
+ "internalType": "address"
72
+ }
73
+ ],
74
+ "stateMutability": "view"
75
+ },
76
+ {
77
+ "type": "function",
78
+ "name": "safeCreate2AndUpgradeToAndCall",
79
+ "inputs": [
80
+ {
81
+ "name": "proxySalt",
82
+ "type": "bytes32",
83
+ "internalType": "bytes32"
84
+ },
85
+ {
86
+ "name": "proxyCode",
87
+ "type": "bytes",
88
+ "internalType": "bytes"
89
+ },
90
+ {
91
+ "name": "initialImplementation",
92
+ "type": "address",
93
+ "internalType": "address"
94
+ },
95
+ {
96
+ "name": "postUpgradeCall",
97
+ "type": "bytes",
98
+ "internalType": "bytes"
99
+ },
100
+ {
101
+ "name": "_expectedAddress",
102
+ "type": "address",
103
+ "internalType": "address"
104
+ }
105
+ ],
106
+ "outputs": [],
107
+ "stateMutability": "payable"
108
+ },
109
+ {
110
+ "type": "error",
111
+ "name": "Create2EmptyBytecode",
112
+ "inputs": []
113
+ },
114
+ {
115
+ "type": "error",
116
+ "name": "Create2FailedDeployment",
117
+ "inputs": []
118
+ },
119
+ {
120
+ "type": "error",
121
+ "name": "Create2InsufficientBalance",
122
+ "inputs": [
123
+ {
124
+ "name": "balance",
125
+ "type": "uint256",
126
+ "internalType": "uint256"
127
+ },
128
+ {
129
+ "name": "needed",
130
+ "type": "uint256",
131
+ "internalType": "uint256"
132
+ }
133
+ ]
134
+ },
135
+ {
136
+ "type": "error",
137
+ "name": "FactoryProxyAddressMismatch",
138
+ "inputs": [
139
+ {
140
+ "name": "expected",
141
+ "type": "address",
142
+ "internalType": "address"
143
+ },
144
+ {
145
+ "name": "actual",
146
+ "type": "address",
147
+ "internalType": "address"
148
+ }
149
+ ]
150
+ },
151
+ {
152
+ "type": "error",
153
+ "name": "InvalidSalt",
154
+ "inputs": [
155
+ {
156
+ "name": "signer",
157
+ "type": "address",
158
+ "internalType": "address"
159
+ },
160
+ {
161
+ "name": "salt",
162
+ "type": "bytes32",
163
+ "internalType": "bytes32"
164
+ }
165
+ ]
166
+ }
167
+ ]
@@ -370,6 +370,19 @@
370
370
  "outputs": [],
371
371
  "stateMutability": "nonpayable"
372
372
  },
373
+ {
374
+ "type": "function",
375
+ "name": "test_deploy_with_weth",
376
+ "inputs": [
377
+ {
378
+ "name": "initialOrderSize",
379
+ "type": "uint256",
380
+ "internalType": "uint256"
381
+ }
382
+ ],
383
+ "outputs": [],
384
+ "stateMutability": "nonpayable"
385
+ },
373
386
  {
374
387
  "type": "function",
375
388
  "name": "test_deploy_without_initial_order",
@@ -377,6 +390,13 @@
377
390
  "outputs": [],
378
391
  "stateMutability": "nonpayable"
379
392
  },
393
+ {
394
+ "type": "function",
395
+ "name": "test_implementation_address",
396
+ "inputs": [],
397
+ "outputs": [],
398
+ "stateMutability": "view"
399
+ },
380
400
  {
381
401
  "type": "function",
382
402
  "name": "test_revert_deploy_with_invalid_currency_tick",
@@ -0,0 +1,9 @@
1
+ [
2
+ {
3
+ "type": "function",
4
+ "name": "run",
5
+ "inputs": [],
6
+ "outputs": [],
7
+ "stateMutability": "nonpayable"
8
+ }
9
+ ]
package/abis/IERC165.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "name": "supportsInterface",
5
5
  "inputs": [
6
6
  {
7
- "name": "interfaceId",
7
+ "name": "interfaceID",
8
8
  "type": "bytes4",
9
9
  "internalType": "bytes4"
10
10
  }
package/abis/IERC20.json CHANGED
@@ -33,7 +33,7 @@
33
33
  "internalType": "address"
34
34
  },
35
35
  {
36
- "name": "value",
36
+ "name": "amount",
37
37
  "type": "uint256",
38
38
  "internalType": "uint256"
39
39
  }
@@ -66,6 +66,45 @@
66
66
  ],
67
67
  "stateMutability": "view"
68
68
  },
69
+ {
70
+ "type": "function",
71
+ "name": "decimals",
72
+ "inputs": [],
73
+ "outputs": [
74
+ {
75
+ "name": "",
76
+ "type": "uint8",
77
+ "internalType": "uint8"
78
+ }
79
+ ],
80
+ "stateMutability": "view"
81
+ },
82
+ {
83
+ "type": "function",
84
+ "name": "name",
85
+ "inputs": [],
86
+ "outputs": [
87
+ {
88
+ "name": "",
89
+ "type": "string",
90
+ "internalType": "string"
91
+ }
92
+ ],
93
+ "stateMutability": "view"
94
+ },
95
+ {
96
+ "type": "function",
97
+ "name": "symbol",
98
+ "inputs": [],
99
+ "outputs": [
100
+ {
101
+ "name": "",
102
+ "type": "string",
103
+ "internalType": "string"
104
+ }
105
+ ],
106
+ "stateMutability": "view"
107
+ },
69
108
  {
70
109
  "type": "function",
71
110
  "name": "totalSupply",
@@ -89,7 +128,7 @@
89
128
  "internalType": "address"
90
129
  },
91
130
  {
92
- "name": "value",
131
+ "name": "amount",
93
132
  "type": "uint256",
94
133
  "internalType": "uint256"
95
134
  }
@@ -118,7 +157,7 @@
118
157
  "internalType": "address"
119
158
  },
120
159
  {
121
- "name": "value",
160
+ "name": "amount",
122
161
  "type": "uint256",
123
162
  "internalType": "uint256"
124
163
  }
@@ -182,40 +221,4 @@
182
221
  ],
183
222
  "anonymous": false
184
223
  }
185
- ]pe": "address"
186
- },
187
- {
188
- "name": "value",
189
- "type": "uint256",
190
- "indexed": false,
191
- "internalType": "uint256"
192
- }
193
- ],
194
- "anonymous": false
195
- },
196
- {
197
- "type": "event",
198
- "name": "Transfer",
199
- "inputs": [
200
- {
201
- "name": "from",
202
- "type": "address",
203
- "indexed": true,
204
- "internalType": "address"
205
- },
206
- {
207
- "name": "to",
208
- "type": "address",
209
- "indexed": true,
210
- "internalType": "address"
211
- },
212
- {
213
- "name": "value",
214
- "type": "uint256",
215
- "indexed": false,
216
- "internalType": "uint256"
217
- }
218
- ],
219
- "anonymous": false
220
- }
221
224
  ]
@@ -0,0 +1,93 @@
1
+ [
2
+ {
3
+ "type": "function",
4
+ "name": "findCreate2Address",
5
+ "inputs": [
6
+ {
7
+ "name": "salt",
8
+ "type": "bytes32",
9
+ "internalType": "bytes32"
10
+ },
11
+ {
12
+ "name": "initCode",
13
+ "type": "bytes",
14
+ "internalType": "bytes"
15
+ }
16
+ ],
17
+ "outputs": [
18
+ {
19
+ "name": "deploymentAddress",
20
+ "type": "address",
21
+ "internalType": "address"
22
+ }
23
+ ],
24
+ "stateMutability": "view"
25
+ },
26
+ {
27
+ "type": "function",
28
+ "name": "findCreate2AddressViaHash",
29
+ "inputs": [
30
+ {
31
+ "name": "salt",
32
+ "type": "bytes32",
33
+ "internalType": "bytes32"
34
+ },
35
+ {
36
+ "name": "initCodeHash",
37
+ "type": "bytes32",
38
+ "internalType": "bytes32"
39
+ }
40
+ ],
41
+ "outputs": [
42
+ {
43
+ "name": "deploymentAddress",
44
+ "type": "address",
45
+ "internalType": "address"
46
+ }
47
+ ],
48
+ "stateMutability": "view"
49
+ },
50
+ {
51
+ "type": "function",
52
+ "name": "hasBeenDeployed",
53
+ "inputs": [
54
+ {
55
+ "name": "deploymentAddress",
56
+ "type": "address",
57
+ "internalType": "address"
58
+ }
59
+ ],
60
+ "outputs": [
61
+ {
62
+ "name": "",
63
+ "type": "bool",
64
+ "internalType": "bool"
65
+ }
66
+ ],
67
+ "stateMutability": "view"
68
+ },
69
+ {
70
+ "type": "function",
71
+ "name": "safeCreate2",
72
+ "inputs": [
73
+ {
74
+ "name": "salt",
75
+ "type": "bytes32",
76
+ "internalType": "bytes32"
77
+ },
78
+ {
79
+ "name": "initializationCode",
80
+ "type": "bytes",
81
+ "internalType": "bytes"
82
+ }
83
+ ],
84
+ "outputs": [
85
+ {
86
+ "name": "deploymentAddress",
87
+ "type": "address",
88
+ "internalType": "address"
89
+ }
90
+ ],
91
+ "stateMutability": "payable"
92
+ }
93
+ ]
@@ -0,0 +1,15 @@
1
+ [
2
+ {
3
+ "type": "function",
4
+ "name": "getOwners",
5
+ "inputs": [],
6
+ "outputs": [
7
+ {
8
+ "name": "",
9
+ "type": "address[]",
10
+ "internalType": "address[]"
11
+ }
12
+ ],
13
+ "stateMutability": "view"
14
+ }
15
+ ]
@@ -0,0 +1,15 @@
1
+ [
2
+ {
3
+ "type": "function",
4
+ "name": "symbol",
5
+ "inputs": [],
6
+ "outputs": [
7
+ {
8
+ "name": "",
9
+ "type": "string",
10
+ "internalType": "string"
11
+ }
12
+ ],
13
+ "stateMutability": "view"
14
+ }
15
+ ]
@@ -0,0 +1,15 @@
1
+ [
2
+ {
3
+ "type": "function",
4
+ "name": "IMMUTABLE_CREATE2_FACTORY",
5
+ "inputs": [],
6
+ "outputs": [
7
+ {
8
+ "name": "",
9
+ "type": "IImmutableCreate2Factory",
10
+ "internalType": "contract IImmutableCreate2Factory"
11
+ }
12
+ ],
13
+ "stateMutability": "view"
14
+ }
15
+ ]
@@ -0,0 +1,7 @@
1
+ [
2
+ {
3
+ "type": "error",
4
+ "name": "HexLengthInsufficient",
5
+ "inputs": []
6
+ }
7
+ ]
@@ -0,0 +1,112 @@
1
+ [
2
+ {
3
+ "type": "constructor",
4
+ "inputs": [],
5
+ "stateMutability": "nonpayable"
6
+ },
7
+ {
8
+ "type": "function",
9
+ "name": "UPGRADE_INTERFACE_VERSION",
10
+ "inputs": [],
11
+ "outputs": [
12
+ {
13
+ "name": "",
14
+ "type": "string",
15
+ "internalType": "string"
16
+ }
17
+ ],
18
+ "stateMutability": "view"
19
+ },
20
+ {
21
+ "type": "function",
22
+ "name": "proxiableUUID",
23
+ "inputs": [],
24
+ "outputs": [
25
+ {
26
+ "name": "",
27
+ "type": "bytes32",
28
+ "internalType": "bytes32"
29
+ }
30
+ ],
31
+ "stateMutability": "view"
32
+ },
33
+ {
34
+ "type": "function",
35
+ "name": "upgradeToAndCall",
36
+ "inputs": [
37
+ {
38
+ "name": "newImplementation",
39
+ "type": "address",
40
+ "internalType": "address"
41
+ },
42
+ {
43
+ "name": "data",
44
+ "type": "bytes",
45
+ "internalType": "bytes"
46
+ }
47
+ ],
48
+ "outputs": [],
49
+ "stateMutability": "payable"
50
+ },
51
+ {
52
+ "type": "event",
53
+ "name": "Upgraded",
54
+ "inputs": [
55
+ {
56
+ "name": "implementation",
57
+ "type": "address",
58
+ "indexed": true,
59
+ "internalType": "address"
60
+ }
61
+ ],
62
+ "anonymous": false
63
+ },
64
+ {
65
+ "type": "error",
66
+ "name": "AddressEmptyCode",
67
+ "inputs": [
68
+ {
69
+ "name": "target",
70
+ "type": "address",
71
+ "internalType": "address"
72
+ }
73
+ ]
74
+ },
75
+ {
76
+ "type": "error",
77
+ "name": "ERC1967InvalidImplementation",
78
+ "inputs": [
79
+ {
80
+ "name": "implementation",
81
+ "type": "address",
82
+ "internalType": "address"
83
+ }
84
+ ]
85
+ },
86
+ {
87
+ "type": "error",
88
+ "name": "ERC1967NonPayable",
89
+ "inputs": []
90
+ },
91
+ {
92
+ "type": "error",
93
+ "name": "FailedInnerCall",
94
+ "inputs": []
95
+ },
96
+ {
97
+ "type": "error",
98
+ "name": "UUPSUnauthorizedCallContext",
99
+ "inputs": []
100
+ },
101
+ {
102
+ "type": "error",
103
+ "name": "UUPSUnsupportedProxiableUUID",
104
+ "inputs": [
105
+ {
106
+ "name": "slot",
107
+ "type": "bytes32",
108
+ "internalType": "bytes32"
109
+ }
110
+ ]
111
+ }
112
+ ]
@@ -43,19 +43,6 @@
43
43
  "outputs": [],
44
44
  "stateMutability": "payable"
45
45
  },
46
- {
47
- "type": "event",
48
- "name": "Initialized",
49
- "inputs": [
50
- {
51
- "name": "version",
52
- "type": "uint64",
53
- "indexed": false,
54
- "internalType": "uint64"
55
- }
56
- ],
57
- "anonymous": false
58
- },
59
46
  {
60
47
  "type": "event",
61
48
  "name": "Upgraded",
@@ -103,7 +90,21 @@
103
90
  },
104
91
  {
105
92
  "type": "error",
106
- "name": "InvalidInitialization",
93
+ "name": "UUPSUnauthorizedCallContext",
94
+ "inputs": []
95
+ },
96
+ {
97
+ "type": "error",
98
+ "name": "UUPSUnsupportedProxiableUUID",
99
+ "inputs": [
100
+ {
101
+ "name": "slot",
102
+ "type": "bytes32",
103
+ "internalType": "bytes32"
104
+ }
105
+ ]
106
+ }
107
+ ]ion",
107
108
  "inputs": []
108
109
  },
109
110
  {
@@ -6,11 +6,6 @@
6
6
  "name": "_logic",
7
7
  "type": "address",
8
8
  "internalType": "address"
9
- },
10
- {
11
- "name": "_data",
12
- "type": "bytes",
13
- "internalType": "bytes"
14
9
  }
15
10
  ],
16
11
  "stateMutability": "nonpayable"
@@ -1,9 +1,6 @@
1
1
  {
2
- "ZORA_FACTORY": "0xC1d310288E76bE71E7A26d269Fd6cbd3A1D9febC",
3
- "ZORA_FACTORY_IMPL": "0x2734Fc968DD5739A78c28d0078785460b4887596",
4
- "COIN": "0x8147FB008c78aAC363f87BaAEF4dBf25CBff27a2",
5
- "NONFUNGIBLE_POSITION_MANAGER": "0x03a520b32C04BF3bEEf7BEb72E919cf822Ed34f1",
6
- "SWAP_ROUTER_02": "0x2626664c2603336E57B271c5C0b26F421741e481",
7
- "UNISWAP_QUOTER": "0x3d4e44Eb1374240CE5F1B871ab261CD16335B76a",
8
- "WETH": "0x4200000000000000000000000000000000000006"
9
- }
2
+ "COIN_IMPL": "0xFDfD1A05a22bd5Ee57a97Af4A2ADb7B3D74385E8",
3
+ "COIN_VERSION": "0.6.0",
4
+ "ZORA_FACTORY": "0x777777751622c0d3258f214F9DF38E35BF45baF3",
5
+ "ZORA_FACTORY_IMPL": "0x914f448760938Ba34aBf9bC992B7Fb7553B309eA"
6
+ }
@@ -1,9 +1,6 @@
1
1
  {
2
- "ZORA_FACTORY": "0x1E670515d3A4C75C0860846c0605c84AF0e0db0d",
3
- "ZORA_FACTORY_IMPL": "0xA86Ce280A49f5f902D4Bcc8B9099DdeC8C1A4AfB",
4
- "COIN": "0x41888F4BB5C2260Bf3d7c6f4c69a9D52222D1D84",
5
- "NONFUNGIBLE_POSITION_MANAGER": "0x27F971cb582BF9E50F397e4d29a5C7A34f11faA2",
6
- "SWAP_ROUTER_02": "0x94cC0AaC535CCDB3C01d6787D6413C739ae12bc4",
7
- "UNISWAP_QUOTER": "0xC5290058841028F1614F3A6F0F5816cAd0df5E27",
8
- "WETH": "0x4200000000000000000000000000000000000006"
9
- }
2
+ "COIN_IMPL": "0x80b7F916F744ecef6a937B0080D6eeC1e2B53F34",
3
+ "COIN_VERSION": "0.6.0",
4
+ "ZORA_FACTORY": "0x777777751622c0d3258f214F9DF38E35BF45baF3",
5
+ "ZORA_FACTORY_IMPL": "0xFC6d77d32d2545f2b08F7ffFb6E99E472ACa1cA3"
6
+ }