@zoralabs/comments-contracts 0.0.2 → 0.1.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 (42) hide show
  1. package/.turbo/turbo-build.log +71 -65
  2. package/CHANGELOG.md +15 -0
  3. package/abis/CommentsImpl.json +0 -5
  4. package/abis/CommentsPermitTest.json +2 -2
  5. package/abis/CommentsTest.json +30 -2
  6. package/abis/Comments_mintAndCommentTest.json +8 -1
  7. package/abis/Comments_smartWallet.json +36 -1
  8. package/abis/ICoinComments.json +53 -0
  9. package/abis/IComments.json +0 -5
  10. package/abis/IProtocolRewards.json +18 -0
  11. package/abis/MockCoin.json +395 -0
  12. package/abis/Vm.json +1482 -111
  13. package/abis/VmSafe.json +856 -32
  14. package/addresses/1.json +2 -2
  15. package/addresses/10.json +2 -2
  16. package/addresses/42161.json +2 -2
  17. package/addresses/7777777.json +2 -2
  18. package/addresses/81457.json +2 -2
  19. package/addresses/8453.json +2 -2
  20. package/addresses/84532.json +2 -2
  21. package/addresses/999999999.json +2 -2
  22. package/dist/index.cjs +133 -134
  23. package/dist/index.cjs.map +1 -1
  24. package/dist/index.js +130 -131
  25. package/dist/index.js.map +1 -1
  26. package/dist/wagmiGenerated.d.ts +65 -69
  27. package/dist/wagmiGenerated.d.ts.map +1 -1
  28. package/package/wagmiGenerated.ts +65 -66
  29. package/package.json +9 -8
  30. package/script/storage-check.sh +1 -1
  31. package/src/CommentsImpl.sol +41 -26
  32. package/src/interfaces/ICoinComments.sol +8 -0
  33. package/src/interfaces/IComments.sol +0 -3
  34. package/src/version/ContractVersionBase.sol +1 -1
  35. package/test/Comments.t.sol +68 -4
  36. package/test/CommentsTestBase.sol +7 -0
  37. package/test/Comments_delegateComment.t.sol +19 -2
  38. package/test/Comments_permit.t.sol +3 -3
  39. package/test/Comments_smartWallet.t.sol +97 -2
  40. package/test/mocks/MockCoin.sol +42 -0
  41. package/script/bundle-abis.ts +0 -109
  42. package/script/update-contract-version.ts +0 -63
@@ -1,78 +1,84 @@
1
1
 
2
- > @zoralabs/comments-contracts@0.0.2 build /home/runner/work/zora-protocol-private/zora-protocol-private/packages/comments
2
+ > @zoralabs/comments-contracts@0.1.0 build /home/runner/work/zora-protocol-private/zora-protocol-private/packages/comments
3
3
  > pnpm run wagmi:generate && pnpm run copy-abis && pnpm run prettier:write && tsup
4
4
 
5
5
 
6
- > @zoralabs/comments-contracts@0.0.2 wagmi:generate /home/runner/work/zora-protocol-private/zora-protocol-private/packages/comments
7
- > FOUNDRY_PROFILE=dev forge build && wagmi generate
6
+ > @zoralabs/comments-contracts@0.1.0 wagmi:generate /home/runner/work/zora-protocol-private/zora-protocol-private/packages/comments
7
+ > FOUNDRY_PROFILE=dev forge build && wagmi generate && pnpm exec rename-generated-abi-casing ./package/wagmiGenerated.ts
8
8
 
9
- Compiling 117 files with Solc 0.8.23
10
- Solc 0.8.23 finished in 57.16s
9
+ Compiling 121 files with Solc 0.8.23
10
+ Solc 0.8.23 finished in 85.76s
11
11
  Compiler run successful!
12
- - Validating plugins
13
- Validating plugins
14
- - Resolving contracts
15
- Resolving contracts
16
- - Running plugins
17
- Running plugins
18
- - Writing to package/wagmiGenerated.ts
19
- Writing to package/wagmiGenerated.ts
12
+ - Validating plugins
13
+ ✔ Validating plugins
14
+ - Resolving contracts
15
+ ✔ Resolving contracts
16
+ - Running plugins
17
+ ✔ Running plugins
18
+ - Writing to package/wagmiGenerated.ts
19
+ ✔ Writing to package/wagmiGenerated.ts
20
+ 🔄 Processing 1 file(s) to replace 'Abi' with 'ABI'...
21
+ 📝 Processing ./package/wagmiGenerated.ts...
22
+ ✅ Updated ./package/wagmiGenerated.ts (2 replacements)
23
+ ✨ All files processed successfully!
20
24
 
21
- > @zoralabs/comments-contracts@0.0.2 copy-abis /home/runner/work/zora-protocol-private/zora-protocol-private/packages/comments
22
- > pnpm tsx script/bundle-abis.ts
25
+ > @zoralabs/comments-contracts@0.1.0 copy-abis /home/runner/work/zora-protocol-private/zora-protocol-private/packages/comments
26
+ > pnpm exec bundle-abis
23
27
 
24
28
 
25
- > @zoralabs/comments-contracts@0.0.2 prettier:write /home/runner/work/zora-protocol-private/zora-protocol-private/packages/comments
29
+ > @zoralabs/comments-contracts@0.1.0 prettier:write /home/runner/work/zora-protocol-private/zora-protocol-private/packages/comments
26
30
  > prettier --write 'src/**/*.sol' 'test/**/*.sol' 'script/**/*.sol'
27
31
 
28
- src/CommentsImpl.sol 1473ms (unchanged)
29
- src/CommentsImplConstants.sol 31ms (unchanged)
30
- src/interfaces/ICallerAndCommenter.sol 88ms (unchanged)
31
- src/interfaces/IComments.sol 58ms (unchanged)
32
- src/interfaces/IMultiOwnable.sol 11ms (unchanged)
33
- src/interfaces/ISecondarySwap.sol 29ms (unchanged)
34
- src/interfaces/IZoraCreator1155.sol 4ms (unchanged)
35
- src/interfaces/IZoraCreator1155TypesV1.sol 19ms (unchanged)
32
+ src/CommentsImpl.sol 1550ms (unchanged)
33
+ src/CommentsImplConstants.sol 17ms (unchanged)
34
+ src/interfaces/ICallerAndCommenter.sol 50ms (unchanged)
35
+ src/interfaces/ICoinComments.sol 8ms (unchanged)
36
+ src/interfaces/IComments.sol 70ms
37
+ src/interfaces/IMultiOwnable.sol 2ms (unchanged)
38
+ src/interfaces/ISecondarySwap.sol 24ms (unchanged)
39
+ src/interfaces/IZoraCreator1155.sol 8ms (unchanged)
40
+ src/interfaces/IZoraCreator1155TypesV1.sol 28ms (unchanged)
36
41
  src/interfaces/IZoraTimedSaleStrategy.sol 9ms (unchanged)
37
- src/proxy/CallerAndCommenter.sol 15ms (unchanged)
38
- src/proxy/Comments.sol 27ms (unchanged)
39
- src/utils/CallerAndCommenterImpl.sol 332ms (unchanged)
40
- src/utils/EIP712UpgradeableWithChainId.sol 24ms (unchanged)
41
- src/version/ContractVersionBase.sol 3ms (unchanged)
42
- test/CallerAndCommenter_mintAndComment.t copy.sol 256ms (unchanged)
43
- test/CallerAndCommenter_swapAndComment.t.sol 518ms (unchanged)
44
- test/CallerAndCommenterTestBase.sol 108ms (unchanged)
45
- test/Comments_delegateComment.t.sol 150ms (unchanged)
46
- test/Comments_permit.t.sol 392ms (unchanged)
47
- test/Comments_smartWallet.t.sol 106ms (unchanged)
48
- test/Comments.t.sol 730ms (unchanged)
49
- test/CommentsTestBase.sol 61ms (unchanged)
50
- test/mocks/Mock1155.sol 61ms (unchanged)
51
- test/mocks/Mock1155NoCreatorRewardRecipient.sol 36ms (unchanged)
52
- test/mocks/Mock1155NoOwner.sol 33ms (unchanged)
53
- test/mocks/MockDelegateCommenter.sol 20ms (unchanged)
42
+ src/proxy/CallerAndCommenter.sol 33ms (unchanged)
43
+ src/proxy/Comments.sol 17ms (unchanged)
44
+ src/utils/CallerAndCommenterImpl.sol 476ms (unchanged)
45
+ src/utils/EIP712UpgradeableWithChainId.sol 22ms (unchanged)
46
+ src/version/ContractVersionBase.sol 1ms (unchanged)
47
+ test/CallerAndCommenter_mintAndComment.t copy.sol 394ms (unchanged)
48
+ test/CallerAndCommenter_swapAndComment.t.sol 841ms (unchanged)
49
+ test/CallerAndCommenterTestBase.sol 146ms (unchanged)
50
+ test/Comments_delegateComment.t.sol 222ms (unchanged)
51
+ test/Comments_permit.t.sol 747ms (unchanged)
52
+ test/Comments_smartWallet.t.sol 302ms (unchanged)
53
+ test/Comments.t.sol 823ms (unchanged)
54
+ test/CommentsTestBase.sol 58ms (unchanged)
55
+ test/mocks/Mock1155.sol 34ms (unchanged)
56
+ test/mocks/Mock1155NoCreatorRewardRecipient.sol 24ms (unchanged)
57
+ test/mocks/Mock1155NoOwner.sol 16ms (unchanged)
58
+ test/mocks/MockCoin.sol 27ms (unchanged)
59
+ test/mocks/MockDelegateCommenter.sol 21ms (unchanged)
54
60
  test/mocks/MockIZoraCreator1155.sol 2ms (unchanged)
55
- test/mocks/MockSecondarySwap.sol 35ms (unchanged)
56
- test/mocks/MockZoraTimedSale.sol 53ms (unchanged)
57
- test/mocks/ProtocolRewards.sol 905ms (unchanged)
58
- script/AddDelegateCommenterRole.s.sol 16ms (unchanged)
59
- script/CommentsDeployerBase.sol 191ms (unchanged)
60
- script/Deploy.s.sol 8ms (unchanged)
61
- script/DeployCallerAndCommenterImpl.s.sol 18ms (unchanged)
62
- script/DeployImpl.s.sol 18ms (unchanged)
63
- script/DeployNonDeterministic.s.sol 57ms (unchanged)
64
- script/GenerateDeterministicParams.s.sol 58ms (unchanged)
65
- CLI Building entry: package/index.ts
66
- CLI Using tsconfig: tsconfig.json
67
- CLI tsup v7.3.0
68
- CLI Using tsup config: /home/runner/work/zora-protocol-private/zora-protocol-private/packages/comments/tsup.config.ts
69
- CLI Target: es2021
70
- CLI Cleaning output folder
71
- CJS Build start
72
- ESM Build start
73
- ESM dist/index.js 47.94 KB
74
- ESM dist/index.js.map 83.57 KB
75
- ESM ⚡️ Build success in 29ms
76
- CJS dist/index.cjs 49.03 KB
77
- CJS dist/index.cjs.map 83.85 KB
78
- CJS ⚡️ Build success in 30ms
61
+ test/mocks/MockSecondarySwap.sol 22ms (unchanged)
62
+ test/mocks/MockZoraTimedSale.sol 24ms (unchanged)
63
+ test/mocks/ProtocolRewards.sol 553ms (unchanged)
64
+ script/AddDelegateCommenterRole.s.sol 10ms (unchanged)
65
+ script/CommentsDeployerBase.sol 92ms (unchanged)
66
+ script/Deploy.s.sol 6ms (unchanged)
67
+ script/DeployCallerAndCommenterImpl.s.sol 16ms (unchanged)
68
+ script/DeployImpl.s.sol 15ms (unchanged)
69
+ script/DeployNonDeterministic.s.sol 27ms (unchanged)
70
+ script/GenerateDeterministicParams.s.sol 33ms (unchanged)
71
+ CLI Building entry: package/index.ts
72
+ CLI Using tsconfig: tsconfig.json
73
+ CLI tsup v8.4.0
74
+ CLI Using tsup config: /home/runner/work/zora-protocol-private/zora-protocol-private/packages/comments/tsup.config.ts
75
+ CLI Target: es2021
76
+ CLI Cleaning output folder
77
+ CJS Build start
78
+ ESM Build start
79
+ ESM dist/index.js 47.88 KB
80
+ ESM dist/index.js.map 83.45 KB
81
+ ESM ⚡️ Build success in 41ms
82
+ CJS dist/index.cjs 48.96 KB
83
+ CJS dist/index.cjs.map 83.73 KB
84
+ CJS ⚡️ Build success in 41ms
package/CHANGELOG.md ADDED
@@ -0,0 +1,15 @@
1
+ # @zoralabs/comments-contracts
2
+
3
+ ## 0.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - e4938846: Remove token holding requirement for commenting
8
+
9
+ Users can now comment on any coin without holding the token. Non-admin users must still send 1 spark to comment, but token ownership is no longer required. Delegate commenters can still comment with 0 sparks.
10
+
11
+ ## 0.0.3
12
+
13
+ ### Patch Changes
14
+
15
+ - 719cf7fc: Support for commenting on coin contracts
@@ -1830,11 +1830,6 @@
1830
1830
  "name": "NotSmartWalletOwner",
1831
1831
  "inputs": []
1832
1832
  },
1833
- {
1834
- "type": "error",
1835
- "name": "NotTokenHolderOrAdmin",
1836
- "inputs": []
1837
- },
1838
1833
  {
1839
1834
  "type": "error",
1840
1835
  "name": "OnlySparksContract",
@@ -247,14 +247,14 @@
247
247
  },
248
248
  {
249
249
  "type": "function",
250
- "name": "testPermitComment_NonceUsedTwice",
250
+ "name": "testPermitComment_Non1155HolderCanCommentWithSpark",
251
251
  "inputs": [],
252
252
  "outputs": [],
253
253
  "stateMutability": "nonpayable"
254
254
  },
255
255
  {
256
256
  "type": "function",
257
- "name": "testPermitComment_Not1155Holder",
257
+ "name": "testPermitComment_NonceUsedTwice",
258
258
  "inputs": [],
259
259
  "outputs": [],
260
260
  "stateMutability": "nonpayable"
@@ -236,6 +236,20 @@
236
236
  ],
237
237
  "stateMutability": "view"
238
238
  },
239
+ {
240
+ "type": "function",
241
+ "name": "testCommentAsCoinAdmin",
242
+ "inputs": [],
243
+ "outputs": [],
244
+ "stateMutability": "nonpayable"
245
+ },
246
+ {
247
+ "type": "function",
248
+ "name": "testCommentAsCoinHolder",
249
+ "inputs": [],
250
+ "outputs": [],
251
+ "stateMutability": "nonpayable"
252
+ },
239
253
  {
240
254
  "type": "function",
241
255
  "name": "testCommentBackfillBatchAddCommentShouldEmitCommented",
@@ -409,6 +423,20 @@
409
423
  "outputs": [],
410
424
  "stateMutability": "view"
411
425
  },
426
+ {
427
+ "type": "function",
428
+ "name": "testNonCoinHolderCanCommentWithSpark",
429
+ "inputs": [],
430
+ "outputs": [],
431
+ "stateMutability": "nonpayable"
432
+ },
433
+ {
434
+ "type": "function",
435
+ "name": "testNonHolderCanCommentWithSpark",
436
+ "inputs": [],
437
+ "outputs": [],
438
+ "stateMutability": "nonpayable"
439
+ },
412
440
  {
413
441
  "type": "function",
414
442
  "name": "testReplyToCommentThatAddressDoesNotMatch",
@@ -432,14 +460,14 @@
432
460
  },
433
461
  {
434
462
  "type": "function",
435
- "name": "testRevertOnEmptyComment",
463
+ "name": "testRevertCommentAsCoinHolderWithoutSparks",
436
464
  "inputs": [],
437
465
  "outputs": [],
438
466
  "stateMutability": "nonpayable"
439
467
  },
440
468
  {
441
469
  "type": "function",
442
- "name": "testRevertOnNotTokenHolderOrAdmin",
470
+ "name": "testRevertOnEmptyComment",
443
471
  "inputs": [],
444
472
  "outputs": [],
445
473
  "stateMutability": "nonpayable"
@@ -226,7 +226,14 @@
226
226
  },
227
227
  {
228
228
  "type": "function",
229
- "name": "test_delegateComment_revertsWhenNotOwnerOrCreator",
229
+ "name": "test_delegateComment_canCommentWithZeroSparks",
230
+ "inputs": [],
231
+ "outputs": [],
232
+ "stateMutability": "nonpayable"
233
+ },
234
+ {
235
+ "type": "function",
236
+ "name": "test_delegateComment_nonOwnerCanCommentWithSpark",
230
237
  "inputs": [],
231
238
  "outputs": [],
232
239
  "stateMutability": "nonpayable"
@@ -212,7 +212,28 @@
212
212
  },
213
213
  {
214
214
  "type": "function",
215
- "name": "test_commentWithSmartWalletOwner_revertsWhenNotHolder",
215
+ "name": "test_commentWithSmartWalletOwner_canCommentWithSpark",
216
+ "inputs": [],
217
+ "outputs": [],
218
+ "stateMutability": "nonpayable"
219
+ },
220
+ {
221
+ "type": "function",
222
+ "name": "test_commentWithSmartWalletOwner_nonCoinHolderCanCommentWithSpark",
223
+ "inputs": [],
224
+ "outputs": [],
225
+ "stateMutability": "nonpayable"
226
+ },
227
+ {
228
+ "type": "function",
229
+ "name": "test_commentWithSmartWalletOwner_revertsWhenNotCoinSmartWallet",
230
+ "inputs": [],
231
+ "outputs": [],
232
+ "stateMutability": "nonpayable"
233
+ },
234
+ {
235
+ "type": "function",
236
+ "name": "test_commentWithSmartWalletOwner_revertsWhenNotCoinSmartWalletOwner",
216
237
  "inputs": [],
217
238
  "outputs": [],
218
239
  "stateMutability": "nonpayable"
@@ -231,6 +252,20 @@
231
252
  "outputs": [],
232
253
  "stateMutability": "nonpayable"
233
254
  },
255
+ {
256
+ "type": "function",
257
+ "name": "test_commentWithSmartWalletOwner_whenCoinHolder",
258
+ "inputs": [],
259
+ "outputs": [],
260
+ "stateMutability": "nonpayable"
261
+ },
262
+ {
263
+ "type": "function",
264
+ "name": "test_commentWithSmartWalletOwner_whenCoinOwner",
265
+ "inputs": [],
266
+ "outputs": [],
267
+ "stateMutability": "nonpayable"
268
+ },
234
269
  {
235
270
  "type": "function",
236
271
  "name": "test_commentWithSmartWalletOwner_whenCreator",
@@ -0,0 +1,53 @@
1
+ [
2
+ {
3
+ "type": "function",
4
+ "name": "balanceOf",
5
+ "inputs": [
6
+ {
7
+ "name": "",
8
+ "type": "address",
9
+ "internalType": "address"
10
+ }
11
+ ],
12
+ "outputs": [
13
+ {
14
+ "name": "",
15
+ "type": "uint256",
16
+ "internalType": "uint256"
17
+ }
18
+ ],
19
+ "stateMutability": "view"
20
+ },
21
+ {
22
+ "type": "function",
23
+ "name": "isOwner",
24
+ "inputs": [
25
+ {
26
+ "name": "",
27
+ "type": "address",
28
+ "internalType": "address"
29
+ }
30
+ ],
31
+ "outputs": [
32
+ {
33
+ "name": "",
34
+ "type": "bool",
35
+ "internalType": "bool"
36
+ }
37
+ ],
38
+ "stateMutability": "view"
39
+ },
40
+ {
41
+ "type": "function",
42
+ "name": "payoutRecipient",
43
+ "inputs": [],
44
+ "outputs": [
45
+ {
46
+ "name": "",
47
+ "type": "address",
48
+ "internalType": "address"
49
+ }
50
+ ],
51
+ "stateMutability": "view"
52
+ }
53
+ ]
@@ -1240,11 +1240,6 @@
1240
1240
  "name": "NotSmartWalletOwner",
1241
1241
  "inputs": []
1242
1242
  },
1243
- {
1244
- "type": "error",
1245
- "name": "NotTokenHolderOrAdmin",
1246
- "inputs": []
1247
- },
1248
1243
  {
1249
1244
  "type": "error",
1250
1245
  "name": "OnlySparksContract",
@@ -145,6 +145,24 @@
145
145
  "outputs": [],
146
146
  "stateMutability": "nonpayable"
147
147
  },
148
+ {
149
+ "type": "function",
150
+ "name": "withdrawFor",
151
+ "inputs": [
152
+ {
153
+ "name": "to",
154
+ "type": "address",
155
+ "internalType": "address"
156
+ },
157
+ {
158
+ "name": "amount",
159
+ "type": "uint256",
160
+ "internalType": "uint256"
161
+ }
162
+ ],
163
+ "outputs": [],
164
+ "stateMutability": "nonpayable"
165
+ },
148
166
  {
149
167
  "type": "function",
150
168
  "name": "withdrawWithSig",