@zoralabs/comments-contracts 0.0.1 → 0.0.2-COMMENTS.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.
- package/.turbo/turbo-build.log +48 -30
- package/CHANGELOG.md +8 -0
- package/README.md +10 -39
- package/abis/AddDelegateCommenterRole.json +22 -0
- package/abis/CallerAndCommenter.json +62 -0
- package/abis/CallerAndCommenterImpl.json +1218 -0
- package/abis/CallerAndCommenterMintAndCommentTest.json +771 -0
- package/abis/CallerAndCommenterSwapAndCommentTest.json +844 -0
- package/abis/CallerAndCommenterTestBase.json +577 -0
- package/abis/CommentsImpl.json +189 -59
- package/abis/CommentsImplConstants.json +106 -0
- package/abis/CommentsPermitTest.json +26 -6
- package/abis/CommentsTest.json +58 -10
- package/abis/Comments_mintAndCommentTest.json +11 -4
- package/abis/Comments_smartWallet.json +711 -0
- package/abis/DeployCallerAndCommenterImpl.json +22 -0
- package/abis/EIP712Upgradeable.json +74 -0
- package/abis/EIP712UpgradeableWithChainId.json +49 -0
- package/abis/ERC20.json +310 -0
- package/abis/ICallerAndCommenter.json +797 -0
- package/abis/IComments.json +629 -9
- package/abis/IERC20.json +39 -42
- package/abis/IERC20Metadata.json +224 -0
- package/abis/IMultiOwnable.json +21 -0
- package/abis/IProtocolRewards.json +19 -0
- package/abis/ISecondarySwap.json +45 -0
- package/abis/IZoraCreator1155.json +51 -0
- package/abis/IZoraTimedSaleStrategy.json +91 -0
- package/abis/Mock1155.json +75 -1
- package/abis/Mock1155NoCreatorRewardRecipient.json +605 -0
- package/abis/Mock1155NoOwner.json +566 -0
- package/abis/{MockMinter.json → MockDelegateCommenter.json} +12 -2
- package/abis/MockERC20z.json +315 -0
- package/abis/MockMultiOwnable.json +212 -0
- package/abis/MockSecondarySwap.json +95 -0
- package/abis/MockZoraTimedSale.json +139 -0
- package/abis/Ownable2StepUpgradeable.json +138 -0
- package/abis/UnorderedNoncesUpgradeable.json +4 -4
- package/addresses/10.json +9 -0
- package/addresses/11155111.json +9 -0
- package/addresses/11155420.json +9 -0
- package/addresses/42161.json +9 -0
- package/addresses/7777777.json +9 -0
- package/addresses/8453.json +9 -0
- package/addresses/84532.json +9 -0
- package/addresses/999999999.json +7 -2
- package/deterministicConfig/callerAndCommenter.json +8 -0
- package/deterministicConfig/comments.json +2 -2
- package/dist/index.cjs +724 -35
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +723 -35
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/wagmiGenerated.d.ts +1102 -57
- package/dist/wagmiGenerated.d.ts.map +1 -1
- package/package/types.ts +4 -1
- package/package/wagmiGenerated.ts +728 -32
- package/package.json +11 -10
- package/script/AddDelegateCommenterRole.s.sol +24 -0
- package/script/CommentsDeployerBase.sol +101 -19
- package/script/Deploy.s.sol +2 -44
- package/script/DeployCallerAndCommenterImpl.s.sol +27 -0
- package/script/DeployImpl.s.sol +1 -0
- package/script/DeployNonDeterministic.s.sol +22 -13
- package/script/GenerateDeterministicParams.s.sol +32 -4
- package/scripts/generateCommentsTestData.ts +170 -79
- package/src/CommentsImpl.sol +267 -134
- package/src/CommentsImplConstants.sol +44 -0
- package/src/interfaces/ICallerAndCommenter.sol +215 -0
- package/src/interfaces/IComments.sol +189 -42
- package/src/interfaces/IMultiOwnable.sol +10 -0
- package/src/interfaces/ISecondarySwap.sol +40 -0
- package/src/interfaces/IZoraCreator1155.sol +6 -1
- package/src/interfaces/IZoraCreator1155TypesV1.sol +46 -0
- package/src/interfaces/IZoraTimedSaleStrategy.sol +25 -0
- package/src/proxy/CallerAndCommenter.sol +43 -0
- package/src/utils/CallerAndCommenterImpl.sol +376 -0
- package/src/utils/EIP712UpgradeableWithChainId.sol +12 -23
- package/src/version/ContractVersionBase.sol +1 -1
- package/test/CallerAndCommenterTestBase.sol +77 -0
- package/test/CallerAndCommenter_mintAndComment.t copy.sol +214 -0
- package/test/CallerAndCommenter_swapAndComment.t.sol +523 -0
- package/test/Comments.t.sol +166 -29
- package/test/CommentsTestBase.sol +12 -20
- package/test/Comments_delegateComment.t.sol +129 -0
- package/test/Comments_permit.t.sol +131 -44
- package/test/Comments_smartWallet.t.sol +152 -0
- package/test/mocks/Mock1155.sol +12 -1
- package/test/mocks/Mock1155NoCreatorRewardRecipient.sol +65 -0
- package/test/mocks/Mock1155NoOwner.sol +53 -0
- package/test/mocks/MockDelegateCommenter.sol +36 -0
- package/test/mocks/MockIZoraCreator1155.sol +16 -0
- package/test/mocks/MockSecondarySwap.sol +30 -0
- package/test/mocks/MockZoraTimedSale.sol +38 -0
- package/wagmi.config.ts +3 -1
- package/scripts/backfillComments.ts +0 -176
- package/scripts/queries.ts +0 -73
- package/scripts/queryAndSaveComments.ts +0 -48
- package/scripts/queryQuantityOfComments.ts +0 -53
- package/scripts/writeComments.ts +0 -198
- package/src/deployments/CommentsDeployment.sol +0 -14
- package/test/Comments_mintAndComment.t.sol +0 -101
- package/test/mocks/MockMinter.sol +0 -29
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
|
|
2
|
-
> @zoralabs/comments-contracts@0.0.
|
|
2
|
+
> @zoralabs/comments-contracts@0.0.2-COMMENTS.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.
|
|
6
|
+
> @zoralabs/comments-contracts@0.0.2-COMMENTS.0 wagmi:generate /home/runner/work/zora-protocol-private/zora-protocol-private/packages/comments
|
|
7
7
|
> FOUNDRY_PROFILE=dev forge build && wagmi generate
|
|
8
8
|
|
|
9
|
-
Compiling
|
|
10
|
-
Solc 0.8.23 finished in
|
|
9
|
+
Compiling 117 files with Solc 0.8.23
|
|
10
|
+
Solc 0.8.23 finished in 52.51s
|
|
11
11
|
Compiler run successful!
|
|
12
12
|
- Validating plugins
|
|
13
13
|
✔ Validating plugins
|
|
@@ -18,32 +18,50 @@ Compiler run successful!
|
|
|
18
18
|
- Writing to [90mpackage/wagmiGenerated.ts[39m
|
|
19
19
|
✔ Writing to [90mpackage/wagmiGenerated.ts[39m
|
|
20
20
|
|
|
21
|
-
> @zoralabs/comments-contracts@0.0.
|
|
21
|
+
> @zoralabs/comments-contracts@0.0.2-COMMENTS.0 copy-abis /home/runner/work/zora-protocol-private/zora-protocol-private/packages/comments
|
|
22
22
|
> pnpm tsx script/bundle-abis.ts
|
|
23
23
|
|
|
24
24
|
|
|
25
|
-
> @zoralabs/comments-contracts@0.0.
|
|
25
|
+
> @zoralabs/comments-contracts@0.0.2-COMMENTS.0 prettier:write /home/runner/work/zora-protocol-private/zora-protocol-private/packages/comments
|
|
26
26
|
> prettier --write 'src/**/*.sol' 'test/**/*.sol' 'script/**/*.sol'
|
|
27
27
|
|
|
28
|
-
src/CommentsImpl.sol
|
|
29
|
-
src/
|
|
30
|
-
src/interfaces/
|
|
31
|
-
src/interfaces/
|
|
32
|
-
src/
|
|
33
|
-
src/
|
|
34
|
-
src/
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
28
|
+
src/CommentsImpl.sol 1416ms (unchanged)
|
|
29
|
+
src/CommentsImplConstants.sol 45ms (unchanged)
|
|
30
|
+
src/interfaces/ICallerAndCommenter.sol 67ms (unchanged)
|
|
31
|
+
src/interfaces/IComments.sol 59ms (unchanged)
|
|
32
|
+
src/interfaces/IMultiOwnable.sol 10ms (unchanged)
|
|
33
|
+
src/interfaces/ISecondarySwap.sol 18ms (unchanged)
|
|
34
|
+
src/interfaces/IZoraCreator1155.sol 3ms (unchanged)
|
|
35
|
+
src/interfaces/IZoraCreator1155TypesV1.sol 16ms (unchanged)
|
|
36
|
+
src/interfaces/IZoraTimedSaleStrategy.sol 5ms (unchanged)
|
|
37
|
+
src/proxy/CallerAndCommenter.sol 9ms (unchanged)
|
|
38
|
+
src/proxy/Comments.sol 23ms (unchanged)
|
|
39
|
+
src/utils/CallerAndCommenterImpl.sol 346ms (unchanged)
|
|
40
|
+
src/utils/EIP712UpgradeableWithChainId.sol 38ms (unchanged)
|
|
41
|
+
src/version/ContractVersionBase.sol 2ms (unchanged)
|
|
42
|
+
test/CallerAndCommenter_mintAndComment.t copy.sol 247ms (unchanged)
|
|
43
|
+
test/CallerAndCommenter_swapAndComment.t.sol 613ms (unchanged)
|
|
44
|
+
test/CallerAndCommenterTestBase.sol 87ms (unchanged)
|
|
45
|
+
test/Comments_delegateComment.t.sol 131ms (unchanged)
|
|
46
|
+
test/Comments_permit.t.sol 588ms (unchanged)
|
|
47
|
+
test/Comments_smartWallet.t.sol 133ms (unchanged)
|
|
48
|
+
test/Comments.t.sol 664ms (unchanged)
|
|
49
|
+
test/CommentsTestBase.sol 39ms (unchanged)
|
|
50
|
+
test/mocks/Mock1155.sol 23ms (unchanged)
|
|
51
|
+
test/mocks/Mock1155NoCreatorRewardRecipient.sol 20ms (unchanged)
|
|
52
|
+
test/mocks/Mock1155NoOwner.sol 15ms (unchanged)
|
|
53
|
+
test/mocks/MockDelegateCommenter.sol 17ms (unchanged)
|
|
54
|
+
test/mocks/MockIZoraCreator1155.sol 2ms (unchanged)
|
|
55
|
+
test/mocks/MockSecondarySwap.sol 31ms (unchanged)
|
|
56
|
+
test/mocks/MockZoraTimedSale.sol 21ms (unchanged)
|
|
57
|
+
test/mocks/ProtocolRewards.sol 401ms (unchanged)
|
|
58
|
+
script/AddDelegateCommenterRole.s.sol 10ms (unchanged)
|
|
42
59
|
script/CommentsDeployerBase.sol 63ms (unchanged)
|
|
43
|
-
script/Deploy.s.sol
|
|
44
|
-
script/
|
|
45
|
-
script/
|
|
46
|
-
script/
|
|
60
|
+
script/Deploy.s.sol 7ms (unchanged)
|
|
61
|
+
script/DeployCallerAndCommenterImpl.s.sol 18ms (unchanged)
|
|
62
|
+
script/DeployImpl.s.sol 15ms (unchanged)
|
|
63
|
+
script/DeployNonDeterministic.s.sol 26ms (unchanged)
|
|
64
|
+
script/GenerateDeterministicParams.s.sol 29ms (unchanged)
|
|
47
65
|
CLI Building entry: package/index.ts
|
|
48
66
|
CLI Using tsconfig: tsconfig.json
|
|
49
67
|
CLI tsup v7.3.0
|
|
@@ -52,9 +70,9 @@ CLI Target: es2021
|
|
|
52
70
|
CLI Cleaning output folder
|
|
53
71
|
CJS Build start
|
|
54
72
|
ESM Build start
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
73
|
+
CJS dist/index.cjs 49.03 KB
|
|
74
|
+
CJS dist/index.cjs.map 83.85 KB
|
|
75
|
+
CJS ⚡️ Build success in 25ms
|
|
76
|
+
ESM dist/index.js 47.94 KB
|
|
77
|
+
ESM dist/index.js.map 83.57 KB
|
|
78
|
+
ESM ⚡️ Build success in 25ms
|
package/CHANGELOG.md
ADDED
package/README.md
CHANGED
|
@@ -15,56 +15,27 @@ In the `packages/comments` directory:
|
|
|
15
15
|
|
|
16
16
|
1. Copy `.env.example` to `.env`
|
|
17
17
|
2. Populate the parameters in `.env`
|
|
18
|
-
3. Set `TURNKEY_TARGET_ADDRESS` to the address of the turnkey account that will sign the deployment.
|
|
19
18
|
|
|
20
|
-
### Deploying the Comments
|
|
19
|
+
### Deploying the Comments Contracts
|
|
21
20
|
|
|
22
|
-
1.
|
|
21
|
+
1. Deploy the `Comments` contract, you must pass the `--ffi` flag to enable calling an external script to sign the deployment with turnkey:
|
|
23
22
|
|
|
24
23
|
```bash
|
|
25
|
-
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
This saves the config to `./deterministicConfig/comments.json`.
|
|
29
|
-
|
|
30
|
-
2. Deploy the `Comments` contract:
|
|
31
|
-
|
|
32
|
-
```bash
|
|
33
|
-
forge script script/Deploy.s.sol $(chains {chainName} --rpc) --broadcast --verify
|
|
24
|
+
forge script script/Deploy.s.sol $(chains {chainName} --deploy) --broadcast --verify --ffi
|
|
34
25
|
```
|
|
35
26
|
|
|
36
27
|
where `{chainName}` is the emdash name of the chain you want to deploy on.
|
|
37
28
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
### Backfilling MintComments
|
|
41
|
-
|
|
42
|
-
`MintComment` events are legacy events for commenting when minting on
|
|
43
|
-
Zora 1155 contracts. To import the into a Comments contract, so that
|
|
44
|
-
they can be replied to and sparked, the following script can be run.
|
|
45
|
-
|
|
46
|
-
```
|
|
47
|
-
pnpm tsx scripts/backfillComments.ts {chainName}
|
|
48
|
-
```
|
|
29
|
+
2. Verify the proxy contracts. Since they are deployed with create2, foundry wont always recognize the deployed contract, so verification needs to happen manually:
|
|
49
30
|
|
|
50
|
-
|
|
31
|
+
for the comments contract:
|
|
51
32
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
```
|
|
55
|
-
// for zora sepolia
|
|
56
|
-
pnpm tsx scripts/backfillComments.ts zora-sepolia
|
|
57
|
-
// for zora mainnet
|
|
58
|
-
pnpm tsx scripts/backfillComments.ts zora
|
|
59
|
-
// for base
|
|
60
|
-
pnpm tsx scripts/backfillComments.ts base
|
|
33
|
+
```bash
|
|
34
|
+
forge verify-contract 0x7777777C2B3132e03a65721a41745C07170a5877 Comments $(chains {chainName} --verify) --constructor-args 0x000000000000000000000000064de410ce7aba82396332c5837b4c6b96108283
|
|
61
35
|
```
|
|
62
36
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
Currently only on Zora Sepolia, this will create some comments, replies,
|
|
66
|
-
and sparked comments.
|
|
37
|
+
for the caller and commenter contract:
|
|
67
38
|
|
|
68
|
-
```
|
|
69
|
-
|
|
39
|
+
```bash
|
|
40
|
+
forge verify-contract 0x77777775C5074b74540d9cC63Dd840A8c692B4B5 CallerAndCommenter $(chains {chainName} --verify) --constructor-args 0x000000000000000000000000064de410ce7aba82396332c5837b4c6b96108283
|
|
70
41
|
```
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"type": "function",
|
|
4
|
+
"name": "IS_SCRIPT",
|
|
5
|
+
"inputs": [],
|
|
6
|
+
"outputs": [
|
|
7
|
+
{
|
|
8
|
+
"name": "",
|
|
9
|
+
"type": "bool",
|
|
10
|
+
"internalType": "bool"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"stateMutability": "view"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"type": "function",
|
|
17
|
+
"name": "run",
|
|
18
|
+
"inputs": [],
|
|
19
|
+
"outputs": [],
|
|
20
|
+
"stateMutability": "view"
|
|
21
|
+
}
|
|
22
|
+
]
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"type": "constructor",
|
|
4
|
+
"inputs": [
|
|
5
|
+
{
|
|
6
|
+
"name": "_logic",
|
|
7
|
+
"type": "address",
|
|
8
|
+
"internalType": "address"
|
|
9
|
+
}
|
|
10
|
+
],
|
|
11
|
+
"stateMutability": "nonpayable"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"type": "fallback",
|
|
15
|
+
"stateMutability": "payable"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"type": "event",
|
|
19
|
+
"name": "Upgraded",
|
|
20
|
+
"inputs": [
|
|
21
|
+
{
|
|
22
|
+
"name": "implementation",
|
|
23
|
+
"type": "address",
|
|
24
|
+
"indexed": true,
|
|
25
|
+
"internalType": "address"
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
"anonymous": false
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"type": "error",
|
|
32
|
+
"name": "AddressEmptyCode",
|
|
33
|
+
"inputs": [
|
|
34
|
+
{
|
|
35
|
+
"name": "target",
|
|
36
|
+
"type": "address",
|
|
37
|
+
"internalType": "address"
|
|
38
|
+
}
|
|
39
|
+
]
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"type": "error",
|
|
43
|
+
"name": "ERC1967InvalidImplementation",
|
|
44
|
+
"inputs": [
|
|
45
|
+
{
|
|
46
|
+
"name": "implementation",
|
|
47
|
+
"type": "address",
|
|
48
|
+
"internalType": "address"
|
|
49
|
+
}
|
|
50
|
+
]
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"type": "error",
|
|
54
|
+
"name": "ERC1967NonPayable",
|
|
55
|
+
"inputs": []
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"type": "error",
|
|
59
|
+
"name": "FailedInnerCall",
|
|
60
|
+
"inputs": []
|
|
61
|
+
}
|
|
62
|
+
]
|