@artblocks/contracts 1.4.0 → 1.5.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.
@@ -0,0 +1,435 @@
1
+ {
2
+ "_format": "hh-sol-artifact-1",
3
+ "contractName": "MintTimeAndTransferCountHooks",
4
+ "sourceName": "contracts/web3call/combined-hooks/MintTimeAndTransferCountHooks.sol",
5
+ "abi": [
6
+ {
7
+ "inputs": [
8
+ {
9
+ "internalType": "address",
10
+ "name": "pmp_",
11
+ "type": "address"
12
+ }
13
+ ],
14
+ "stateMutability": "nonpayable",
15
+ "type": "constructor"
16
+ },
17
+ {
18
+ "inputs": [
19
+ {
20
+ "internalType": "address",
21
+ "name": "coreContract",
22
+ "type": "address"
23
+ },
24
+ {
25
+ "internalType": "uint256",
26
+ "name": "projectId",
27
+ "type": "uint256"
28
+ },
29
+ {
30
+ "internalType": "address",
31
+ "name": "configuredHook",
32
+ "type": "address"
33
+ }
34
+ ],
35
+ "name": "HookNotConfiguredForProject",
36
+ "type": "error"
37
+ },
38
+ {
39
+ "inputs": [
40
+ {
41
+ "internalType": "address",
42
+ "name": "caller",
43
+ "type": "address"
44
+ },
45
+ {
46
+ "internalType": "address",
47
+ "name": "coreContract",
48
+ "type": "address"
49
+ }
50
+ ],
51
+ "name": "TransferHookCallerNotCoreContract",
52
+ "type": "error"
53
+ },
54
+ {
55
+ "anonymous": false,
56
+ "inputs": [
57
+ {
58
+ "indexed": true,
59
+ "internalType": "address",
60
+ "name": "coreContract",
61
+ "type": "address"
62
+ },
63
+ {
64
+ "indexed": true,
65
+ "internalType": "uint256",
66
+ "name": "tokenId",
67
+ "type": "uint256"
68
+ },
69
+ {
70
+ "indexed": false,
71
+ "internalType": "uint64",
72
+ "name": "timestamp",
73
+ "type": "uint64"
74
+ }
75
+ ],
76
+ "name": "MintTimestampRecorded",
77
+ "type": "event"
78
+ },
79
+ {
80
+ "anonymous": false,
81
+ "inputs": [
82
+ {
83
+ "indexed": true,
84
+ "internalType": "address",
85
+ "name": "coreContract",
86
+ "type": "address"
87
+ },
88
+ {
89
+ "indexed": true,
90
+ "internalType": "uint256",
91
+ "name": "tokenId",
92
+ "type": "uint256"
93
+ },
94
+ {
95
+ "indexed": false,
96
+ "internalType": "uint64",
97
+ "name": "transferCount",
98
+ "type": "uint64"
99
+ }
100
+ ],
101
+ "name": "TransferCountPMPSyncFailed",
102
+ "type": "event"
103
+ },
104
+ {
105
+ "anonymous": false,
106
+ "inputs": [
107
+ {
108
+ "indexed": true,
109
+ "internalType": "address",
110
+ "name": "coreContract",
111
+ "type": "address"
112
+ },
113
+ {
114
+ "indexed": true,
115
+ "internalType": "uint256",
116
+ "name": "tokenId",
117
+ "type": "uint256"
118
+ },
119
+ {
120
+ "indexed": false,
121
+ "internalType": "uint64",
122
+ "name": "transferCount",
123
+ "type": "uint64"
124
+ },
125
+ {
126
+ "indexed": false,
127
+ "internalType": "address",
128
+ "name": "from",
129
+ "type": "address"
130
+ },
131
+ {
132
+ "indexed": false,
133
+ "internalType": "address",
134
+ "name": "to",
135
+ "type": "address"
136
+ }
137
+ ],
138
+ "name": "TransferCounted",
139
+ "type": "event"
140
+ },
141
+ {
142
+ "inputs": [],
143
+ "name": "PARAM_KEY_MINT_TIMESTAMP",
144
+ "outputs": [
145
+ {
146
+ "internalType": "string",
147
+ "name": "",
148
+ "type": "string"
149
+ }
150
+ ],
151
+ "stateMutability": "view",
152
+ "type": "function"
153
+ },
154
+ {
155
+ "inputs": [],
156
+ "name": "PARAM_KEY_SECONDS_SINCE_MINT",
157
+ "outputs": [
158
+ {
159
+ "internalType": "string",
160
+ "name": "",
161
+ "type": "string"
162
+ }
163
+ ],
164
+ "stateMutability": "view",
165
+ "type": "function"
166
+ },
167
+ {
168
+ "inputs": [],
169
+ "name": "PARAM_KEY_TRANSFER_COUNT",
170
+ "outputs": [
171
+ {
172
+ "internalType": "string",
173
+ "name": "",
174
+ "type": "string"
175
+ }
176
+ ],
177
+ "stateMutability": "view",
178
+ "type": "function"
179
+ },
180
+ {
181
+ "inputs": [
182
+ {
183
+ "internalType": "address",
184
+ "name": "coreContract",
185
+ "type": "address"
186
+ },
187
+ {
188
+ "internalType": "uint256",
189
+ "name": "tokenId",
190
+ "type": "uint256"
191
+ }
192
+ ],
193
+ "name": "isTrackedFromMint",
194
+ "outputs": [
195
+ {
196
+ "internalType": "bool",
197
+ "name": "",
198
+ "type": "bool"
199
+ }
200
+ ],
201
+ "stateMutability": "view",
202
+ "type": "function"
203
+ },
204
+ {
205
+ "inputs": [
206
+ {
207
+ "internalType": "address",
208
+ "name": "coreContract",
209
+ "type": "address"
210
+ },
211
+ {
212
+ "internalType": "uint256",
213
+ "name": "tokenId",
214
+ "type": "uint256"
215
+ }
216
+ ],
217
+ "name": "mintTimestamp",
218
+ "outputs": [
219
+ {
220
+ "internalType": "uint256",
221
+ "name": "",
222
+ "type": "uint256"
223
+ }
224
+ ],
225
+ "stateMutability": "view",
226
+ "type": "function"
227
+ },
228
+ {
229
+ "inputs": [
230
+ {
231
+ "internalType": "address",
232
+ "name": "coreContract",
233
+ "type": "address"
234
+ },
235
+ {
236
+ "internalType": "uint256",
237
+ "name": "tokenId",
238
+ "type": "uint256"
239
+ },
240
+ {
241
+ "components": [
242
+ {
243
+ "internalType": "string",
244
+ "name": "key",
245
+ "type": "string"
246
+ },
247
+ {
248
+ "internalType": "string",
249
+ "name": "value",
250
+ "type": "string"
251
+ }
252
+ ],
253
+ "internalType": "struct IWeb3Call.TokenParam[]",
254
+ "name": "tokenParams",
255
+ "type": "tuple[]"
256
+ }
257
+ ],
258
+ "name": "onTokenPMPReadAugmentation",
259
+ "outputs": [
260
+ {
261
+ "components": [
262
+ {
263
+ "internalType": "string",
264
+ "name": "key",
265
+ "type": "string"
266
+ },
267
+ {
268
+ "internalType": "string",
269
+ "name": "value",
270
+ "type": "string"
271
+ }
272
+ ],
273
+ "internalType": "struct IWeb3Call.TokenParam[]",
274
+ "name": "augmentedTokenParams",
275
+ "type": "tuple[]"
276
+ }
277
+ ],
278
+ "stateMutability": "view",
279
+ "type": "function"
280
+ },
281
+ {
282
+ "inputs": [
283
+ {
284
+ "internalType": "address",
285
+ "name": "coreContract",
286
+ "type": "address"
287
+ },
288
+ {
289
+ "internalType": "uint256",
290
+ "name": "tokenId",
291
+ "type": "uint256"
292
+ },
293
+ {
294
+ "internalType": "address",
295
+ "name": "from",
296
+ "type": "address"
297
+ },
298
+ {
299
+ "internalType": "address",
300
+ "name": "to",
301
+ "type": "address"
302
+ },
303
+ {
304
+ "internalType": "address",
305
+ "name": "operator",
306
+ "type": "address"
307
+ }
308
+ ],
309
+ "name": "onTokenTransfer",
310
+ "outputs": [],
311
+ "stateMutability": "nonpayable",
312
+ "type": "function"
313
+ },
314
+ {
315
+ "inputs": [],
316
+ "name": "pmp",
317
+ "outputs": [
318
+ {
319
+ "internalType": "contract IPMPV0",
320
+ "name": "",
321
+ "type": "address"
322
+ }
323
+ ],
324
+ "stateMutability": "view",
325
+ "type": "function"
326
+ },
327
+ {
328
+ "inputs": [
329
+ {
330
+ "internalType": "address",
331
+ "name": "coreContract",
332
+ "type": "address"
333
+ },
334
+ {
335
+ "internalType": "uint256",
336
+ "name": "tokenId",
337
+ "type": "uint256"
338
+ }
339
+ ],
340
+ "name": "secondsSinceMint",
341
+ "outputs": [
342
+ {
343
+ "internalType": "uint256",
344
+ "name": "",
345
+ "type": "uint256"
346
+ }
347
+ ],
348
+ "stateMutability": "view",
349
+ "type": "function"
350
+ },
351
+ {
352
+ "inputs": [
353
+ {
354
+ "internalType": "bytes4",
355
+ "name": "interfaceId",
356
+ "type": "bytes4"
357
+ }
358
+ ],
359
+ "name": "supportsInterface",
360
+ "outputs": [
361
+ {
362
+ "internalType": "bool",
363
+ "name": "",
364
+ "type": "bool"
365
+ }
366
+ ],
367
+ "stateMutability": "view",
368
+ "type": "function"
369
+ },
370
+ {
371
+ "inputs": [
372
+ {
373
+ "internalType": "address",
374
+ "name": "coreContract",
375
+ "type": "address"
376
+ },
377
+ {
378
+ "internalType": "uint256",
379
+ "name": "tokenId",
380
+ "type": "uint256"
381
+ }
382
+ ],
383
+ "name": "tokenTransferState",
384
+ "outputs": [
385
+ {
386
+ "components": [
387
+ {
388
+ "internalType": "uint64",
389
+ "name": "mintTimestamp",
390
+ "type": "uint64"
391
+ },
392
+ {
393
+ "internalType": "uint64",
394
+ "name": "transferCount",
395
+ "type": "uint64"
396
+ }
397
+ ],
398
+ "internalType": "struct IMintTimeAndTransferCountHooks.TokenTransferState",
399
+ "name": "state",
400
+ "type": "tuple"
401
+ }
402
+ ],
403
+ "stateMutability": "view",
404
+ "type": "function"
405
+ },
406
+ {
407
+ "inputs": [
408
+ {
409
+ "internalType": "address",
410
+ "name": "coreContract",
411
+ "type": "address"
412
+ },
413
+ {
414
+ "internalType": "uint256",
415
+ "name": "tokenId",
416
+ "type": "uint256"
417
+ }
418
+ ],
419
+ "name": "transferCount",
420
+ "outputs": [
421
+ {
422
+ "internalType": "uint256",
423
+ "name": "",
424
+ "type": "uint256"
425
+ }
426
+ ],
427
+ "stateMutability": "view",
428
+ "type": "function"
429
+ }
430
+ ],
431
+ "bytecode": "0x60a060405234801561001057600080fd5b5060405161145838038061145883398101604081905261002f91610040565b6001600160a01b0316608052610070565b60006020828403121561005257600080fd5b81516001600160a01b038116811461006957600080fd5b9392505050565b6080516113bf610099600039600081816101ec01528181610c160152610d3501526113bf6000f3fe608060405234801561001057600080fd5b50600436106100a45760003560e01c806301ffc9a7146100a957806326b25168146100d15780632904cc281461016057806358f8699f146101b25780636344b0e2146101d2578063713f3647146101e7578063726b33fb146102265780637f78cdd814610263578063a5db87a01461029c578063c537c896146102c8578063c71610b5146102db578063ce64e6ce1461030a575b600080fd5b6100bc6100b7366004610ded565b610349565b60405190151581526020015b60405180910390f35b6101396100df366004610e2f565b604080518082018252600080825260209182018190526001600160a01b03949094168452838152818420928452918252918290208251808401909352546001600160401b038082168452600160401b909104169082015290565b6040805182516001600160401b0390811682526020938401511692810192909252016100c8565b6101a461016e366004610e2f565b6001600160a01b03919091166000908152602081815260408083209383529290522054600160401b90046001600160401b031690565b6040519081526020016100c8565b6101c56101c0366004610e5b565b6103aa565b6040516100c89190610f2c565b6101e56101e0366004610fb3565b610751565b005b61020e7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016100c8565b6101a4610234366004610e2f565b6001600160a01b039190911660009081526020818152604080832093835292905220546001600160401b031690565b61028f6040518060400160405280600d81526020016c06d696e7454696d657374616d7609c1b81525081565b6040516100c8919061101b565b61028f6040518060400160405280600d81526020016c1d1c985b9cd9995c90dbdd5b9d609a1b81525081565b6101a46102d6366004610e2f565b6107a4565b61028f6040518060400160405280601081526020016f1cd958dbdb991cd4da5b98d9535a5b9d60821b81525081565b6100bc610318366004610e2f565b6001600160a01b039190911660009081526020818152604080832093835292905220546001600160401b0316151590565b60006001600160e01b0319821663768e80e360e01b148061037a57506001600160e01b031982166331a2587160e11b145b8061039557506001600160e01b031982166358f8699f60e01b145b806103a457506103a4826107df565b92915050565b60608160006103ba826003611044565b9050806001600160401b038111156103d4576103d4611057565b60405190808252806020026020018201604052801561041957816020015b60408051808201909152606080825260208201528152602001906001900390816103f25790505b50604080518082018252600d8082526c06d696e7454696d657374616d7609c1b60209283015282518084018452601081526f1cd958dbdb991cd4da5b98d9535a5b9d60821b90830152825180840190935282526c1d1c985b9cd9995c90dbdd5b9d609a1b91015292507f969f8776446c3db07b06451d720814bb153793475f4749265ea9e77e9c8d43a57f5dad0a572eb01585ff744fa94f4d62bae38819e2ca1db8f27a2e3f9e4c2d7ad87ffb2104d3c983b536ecceaee47a1a5c50ba2294f36c1f82bf40900328e8ef42826000805b868110156105b45760008a8a838181106105055761050561106d565b90506020028101906105179190611083565b61052190806110a3565b60405161052f9291906110f0565b604051809103902090508581141580156105495750848114155b80156105555750838114155b156105ab578a8a8381811061056c5761056c61106d565b905060200281019061057e9190611083565b6105879061118c565b8984815181106105995761059961106d565b60200260200101819052508260010192505b506001016104e9565b506001600160a01b038b166000908152602081815260408083208d845282528083208151808301909252546001600160401b03808216808452600160401b90920416928201929092529161060782610804565b60408051608081018252600d9181019182526c06d696e7454696d657374616d7609c1b60608201529081529091506020810161064284610829565b8152508a85815181106106575761065761106d565b602002602001018190525083600101935060405180604001604052806040518060400160405280601081526020016f1cd958dbdb991cd4da5b98d9535a5b9d60821b81525081526020016106aa83610829565b8152508a85815181106106bf576106bf61106d565b602002602001018190525083600101935060405180604001604052806040518060400160405280600d81526020016c1d1c985b9cd9995c90dbdd5b9d609a1b815250815260200161071c85602001516001600160401b0316610829565b8152508a85815181106107315761073161106d565b602090810291909101015250505060010186525050505050949350505050565b336001600160a01b03861614610790576040516312069e6b60e31b81523360048201526001600160a01b03861660248201526044015b60405180910390fd5b61079d85858585856108bb565b5050505050565b6001600160a01b0382166000908152602081815260408083208484529091528120546107d8906001600160401b0316610804565b9392505050565b60006001600160e01b031982166358f8699f60e01b14806103a457506103a482610a44565b600081158061081257508142105b1561081f57506000919050565b6103a48242611211565b6060600061083683610a79565b60010190506000816001600160401b0381111561085557610855611057565b6040519080825280601f01601f19166020018201604052801561087f576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461088957509392505050565b6108cd856108c886610b4f565b610b5e565b816001600160a01b0316836001600160a01b0316031561079d576001600160a01b0380861660009081526020818152604080832088845290915290209084166109935780546001600160401b031660000361098d5780546001600160401b031916426001600160401b03811691821783556040519182529086906001600160a01b038916907fb1accc0433f8c0f526180d874b88b6995b2666f8af7a2da42d4ef28ee1c111b99060200160405180910390a361098b87876000610c14565b505b5061079d565b80546000906109b390600160401b90046001600160401b03166001611224565b8254600160401b600160801b031916600160401b6001600160401b038316908102919091178455604080519182526001600160a01b0388811660208401528781169183019190915291925087918916907f2a951e1df084e6862b328c57b30c82f1d12fb01aa5afc3daa62e6c493177e68f9060600160405180910390a3610a3b878783610c14565b50505050505050565b60006001600160e01b031982166331a2587160e11b14806103a457506301ffc9a760e01b6001600160e01b03198316146103a4565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b8310610ab85772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6904ee2d6d415b85acef8160201b8310610ae2576904ee2d6d415b85acef8160201b830492506020015b662386f26fc100008310610b0057662386f26fc10000830492506010015b6305f5e1008310610b18576305f5e100830492506008015b6127108310610b2c57612710830492506004015b60648310610b3e576064830492506002015b600a83106103a45760010192915050565b60006103a4620f42408361124b565b6040516339485be360e21b8152600481018290526000906001600160a01b0384169063e5216f8c906024016040805180830381865afa158015610ba5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bc9919061126d565b5090506001600160a01b0381163014610c0f5760405163e6c2fd0b60e01b81526001600160a01b0380851660048301526024820184905282166044820152606401610787565b505050565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610c4757505050565b604080516001808252818301909252600091816020015b610c8f6040805160a08101909152606081526020810160008152600060208201819052604082015260609081015290565b815260200190600190039081610c5e5750506040805160e081018252600d60a082019081526c1d1c985b9cd9995c90dbdd5b9d609a1b60c0830152815260036020808301919091526001600160401b0386168284015260006060830181905283519182019093528281526080820152825192935091839190610d1357610d1361106d565b602090810291909101015260405163037c31bd60e51b81526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690636f8637a090610d6e908790879086906004016112ac565b600060405180830381600087803b158015610d8857600080fd5b505af1925050508015610d99575060015b610de7576040516001600160401b038316815283906001600160a01b038616907f88be046c92a7450ef32faabbcdc69058ed7c4f88e4f1b8f6370fe9ee5969529e9060200160405180910390a35b50505050565b600060208284031215610dff57600080fd5b81356001600160e01b0319811681146107d857600080fd5b6001600160a01b0381168114610e2c57600080fd5b50565b60008060408385031215610e4257600080fd5b8235610e4d81610e17565b946020939093013593505050565b60008060008060608587031215610e7157600080fd5b8435610e7c81610e17565b93506020850135925060408501356001600160401b0380821115610e9f57600080fd5b818701915087601f830112610eb357600080fd5b813581811115610ec257600080fd5b8860208260051b8501011115610ed757600080fd5b95989497505060200194505050565b6000815180845260005b81811015610f0c57602081850181015186830182015201610ef0565b506000602082860101526020601f19601f83011685010191505092915050565b600060208083018184528085518083526040925060408601915060408160051b87010184880160005b83811015610fa557888303603f1901855281518051878552610f7988860182610ee6565b91890151858303868b0152919050610f918183610ee6565b968901969450505090860190600101610f55565b509098975050505050505050565b600080600080600060a08688031215610fcb57600080fd5b8535610fd681610e17565b9450602086013593506040860135610fed81610e17565b92506060860135610ffd81610e17565b9150608086013561100d81610e17565b809150509295509295909350565b6020815260006107d86020830184610ee6565b634e487b7160e01b600052601160045260246000fd5b808201808211156103a4576103a461102e565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b60008235603e1983360301811261109957600080fd5b9190910192915050565b6000808335601e198436030181126110ba57600080fd5b8301803591506001600160401b038211156110d457600080fd5b6020019150368190038213156110e957600080fd5b9250929050565b8183823760009101908152919050565b600082601f83011261111157600080fd5b81356001600160401b038082111561112b5761112b611057565b604051601f8301601f19908116603f0116810190828211818310171561115357611153611057565b8160405283815286602085880101111561116c57600080fd5b836020870160208301376000602085830101528094505050505092915050565b60006040823603121561119e57600080fd5b604080519081016001600160401b0380821183831017156111c1576111c1611057565b8160405284359150808211156111d657600080fd5b6111e236838701611100565b835260208501359150808211156111f857600080fd5b5061120536828601611100565b60208301525092915050565b818103818111156103a4576103a461102e565b6001600160401b038181168382160190808211156112445761124461102e565b5092915050565b60008261126857634e487b7160e01b600052601260045260246000fd5b500490565b6000806040838503121561128057600080fd5b825161128b81610e17565b602084015190925080151581146112a157600080fd5b809150509250929050565b6001600160a01b03841681526020808201849052606060408084018290528451848301819052600093608092909183870190600581901b8801850189850188805b8481101561137657607f198c8503018652825160a0815181875261131382880182610ee6565b915050898201516009811061133657634e487b7160e01b85526021600452602485fd5b868b015281890151898701528b82015115158c870152908a01518582038b870152906113628183610ee6565b978a019795505050918701916001016112ed565b50919d9c5050505050505050505050505056fea2646970667358221220c40e6e02306f4bf6cd6f5b433de2a164df08b861751588b9fa6efee7b1a1340a64736f6c63430008160033",
432
+ "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100a45760003560e01c806301ffc9a7146100a957806326b25168146100d15780632904cc281461016057806358f8699f146101b25780636344b0e2146101d2578063713f3647146101e7578063726b33fb146102265780637f78cdd814610263578063a5db87a01461029c578063c537c896146102c8578063c71610b5146102db578063ce64e6ce1461030a575b600080fd5b6100bc6100b7366004610ded565b610349565b60405190151581526020015b60405180910390f35b6101396100df366004610e2f565b604080518082018252600080825260209182018190526001600160a01b03949094168452838152818420928452918252918290208251808401909352546001600160401b038082168452600160401b909104169082015290565b6040805182516001600160401b0390811682526020938401511692810192909252016100c8565b6101a461016e366004610e2f565b6001600160a01b03919091166000908152602081815260408083209383529290522054600160401b90046001600160401b031690565b6040519081526020016100c8565b6101c56101c0366004610e5b565b6103aa565b6040516100c89190610f2c565b6101e56101e0366004610fb3565b610751565b005b61020e7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016100c8565b6101a4610234366004610e2f565b6001600160a01b039190911660009081526020818152604080832093835292905220546001600160401b031690565b61028f6040518060400160405280600d81526020016c06d696e7454696d657374616d7609c1b81525081565b6040516100c8919061101b565b61028f6040518060400160405280600d81526020016c1d1c985b9cd9995c90dbdd5b9d609a1b81525081565b6101a46102d6366004610e2f565b6107a4565b61028f6040518060400160405280601081526020016f1cd958dbdb991cd4da5b98d9535a5b9d60821b81525081565b6100bc610318366004610e2f565b6001600160a01b039190911660009081526020818152604080832093835292905220546001600160401b0316151590565b60006001600160e01b0319821663768e80e360e01b148061037a57506001600160e01b031982166331a2587160e11b145b8061039557506001600160e01b031982166358f8699f60e01b145b806103a457506103a4826107df565b92915050565b60608160006103ba826003611044565b9050806001600160401b038111156103d4576103d4611057565b60405190808252806020026020018201604052801561041957816020015b60408051808201909152606080825260208201528152602001906001900390816103f25790505b50604080518082018252600d8082526c06d696e7454696d657374616d7609c1b60209283015282518084018452601081526f1cd958dbdb991cd4da5b98d9535a5b9d60821b90830152825180840190935282526c1d1c985b9cd9995c90dbdd5b9d609a1b91015292507f969f8776446c3db07b06451d720814bb153793475f4749265ea9e77e9c8d43a57f5dad0a572eb01585ff744fa94f4d62bae38819e2ca1db8f27a2e3f9e4c2d7ad87ffb2104d3c983b536ecceaee47a1a5c50ba2294f36c1f82bf40900328e8ef42826000805b868110156105b45760008a8a838181106105055761050561106d565b90506020028101906105179190611083565b61052190806110a3565b60405161052f9291906110f0565b604051809103902090508581141580156105495750848114155b80156105555750838114155b156105ab578a8a8381811061056c5761056c61106d565b905060200281019061057e9190611083565b6105879061118c565b8984815181106105995761059961106d565b60200260200101819052508260010192505b506001016104e9565b506001600160a01b038b166000908152602081815260408083208d845282528083208151808301909252546001600160401b03808216808452600160401b90920416928201929092529161060782610804565b60408051608081018252600d9181019182526c06d696e7454696d657374616d7609c1b60608201529081529091506020810161064284610829565b8152508a85815181106106575761065761106d565b602002602001018190525083600101935060405180604001604052806040518060400160405280601081526020016f1cd958dbdb991cd4da5b98d9535a5b9d60821b81525081526020016106aa83610829565b8152508a85815181106106bf576106bf61106d565b602002602001018190525083600101935060405180604001604052806040518060400160405280600d81526020016c1d1c985b9cd9995c90dbdd5b9d609a1b815250815260200161071c85602001516001600160401b0316610829565b8152508a85815181106107315761073161106d565b602090810291909101015250505060010186525050505050949350505050565b336001600160a01b03861614610790576040516312069e6b60e31b81523360048201526001600160a01b03861660248201526044015b60405180910390fd5b61079d85858585856108bb565b5050505050565b6001600160a01b0382166000908152602081815260408083208484529091528120546107d8906001600160401b0316610804565b9392505050565b60006001600160e01b031982166358f8699f60e01b14806103a457506103a482610a44565b600081158061081257508142105b1561081f57506000919050565b6103a48242611211565b6060600061083683610a79565b60010190506000816001600160401b0381111561085557610855611057565b6040519080825280601f01601f19166020018201604052801561087f576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461088957509392505050565b6108cd856108c886610b4f565b610b5e565b816001600160a01b0316836001600160a01b0316031561079d576001600160a01b0380861660009081526020818152604080832088845290915290209084166109935780546001600160401b031660000361098d5780546001600160401b031916426001600160401b03811691821783556040519182529086906001600160a01b038916907fb1accc0433f8c0f526180d874b88b6995b2666f8af7a2da42d4ef28ee1c111b99060200160405180910390a361098b87876000610c14565b505b5061079d565b80546000906109b390600160401b90046001600160401b03166001611224565b8254600160401b600160801b031916600160401b6001600160401b038316908102919091178455604080519182526001600160a01b0388811660208401528781169183019190915291925087918916907f2a951e1df084e6862b328c57b30c82f1d12fb01aa5afc3daa62e6c493177e68f9060600160405180910390a3610a3b878783610c14565b50505050505050565b60006001600160e01b031982166331a2587160e11b14806103a457506301ffc9a760e01b6001600160e01b03198316146103a4565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b8310610ab85772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6904ee2d6d415b85acef8160201b8310610ae2576904ee2d6d415b85acef8160201b830492506020015b662386f26fc100008310610b0057662386f26fc10000830492506010015b6305f5e1008310610b18576305f5e100830492506008015b6127108310610b2c57612710830492506004015b60648310610b3e576064830492506002015b600a83106103a45760010192915050565b60006103a4620f42408361124b565b6040516339485be360e21b8152600481018290526000906001600160a01b0384169063e5216f8c906024016040805180830381865afa158015610ba5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bc9919061126d565b5090506001600160a01b0381163014610c0f5760405163e6c2fd0b60e01b81526001600160a01b0380851660048301526024820184905282166044820152606401610787565b505050565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610c4757505050565b604080516001808252818301909252600091816020015b610c8f6040805160a08101909152606081526020810160008152600060208201819052604082015260609081015290565b815260200190600190039081610c5e5750506040805160e081018252600d60a082019081526c1d1c985b9cd9995c90dbdd5b9d609a1b60c0830152815260036020808301919091526001600160401b0386168284015260006060830181905283519182019093528281526080820152825192935091839190610d1357610d1361106d565b602090810291909101015260405163037c31bd60e51b81526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690636f8637a090610d6e908790879086906004016112ac565b600060405180830381600087803b158015610d8857600080fd5b505af1925050508015610d99575060015b610de7576040516001600160401b038316815283906001600160a01b038616907f88be046c92a7450ef32faabbcdc69058ed7c4f88e4f1b8f6370fe9ee5969529e9060200160405180910390a35b50505050565b600060208284031215610dff57600080fd5b81356001600160e01b0319811681146107d857600080fd5b6001600160a01b0381168114610e2c57600080fd5b50565b60008060408385031215610e4257600080fd5b8235610e4d81610e17565b946020939093013593505050565b60008060008060608587031215610e7157600080fd5b8435610e7c81610e17565b93506020850135925060408501356001600160401b0380821115610e9f57600080fd5b818701915087601f830112610eb357600080fd5b813581811115610ec257600080fd5b8860208260051b8501011115610ed757600080fd5b95989497505060200194505050565b6000815180845260005b81811015610f0c57602081850181015186830182015201610ef0565b506000602082860101526020601f19601f83011685010191505092915050565b600060208083018184528085518083526040925060408601915060408160051b87010184880160005b83811015610fa557888303603f1901855281518051878552610f7988860182610ee6565b91890151858303868b0152919050610f918183610ee6565b968901969450505090860190600101610f55565b509098975050505050505050565b600080600080600060a08688031215610fcb57600080fd5b8535610fd681610e17565b9450602086013593506040860135610fed81610e17565b92506060860135610ffd81610e17565b9150608086013561100d81610e17565b809150509295509295909350565b6020815260006107d86020830184610ee6565b634e487b7160e01b600052601160045260246000fd5b808201808211156103a4576103a461102e565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b60008235603e1983360301811261109957600080fd5b9190910192915050565b6000808335601e198436030181126110ba57600080fd5b8301803591506001600160401b038211156110d457600080fd5b6020019150368190038213156110e957600080fd5b9250929050565b8183823760009101908152919050565b600082601f83011261111157600080fd5b81356001600160401b038082111561112b5761112b611057565b604051601f8301601f19908116603f0116810190828211818310171561115357611153611057565b8160405283815286602085880101111561116c57600080fd5b836020870160208301376000602085830101528094505050505092915050565b60006040823603121561119e57600080fd5b604080519081016001600160401b0380821183831017156111c1576111c1611057565b8160405284359150808211156111d657600080fd5b6111e236838701611100565b835260208501359150808211156111f857600080fd5b5061120536828601611100565b60208301525092915050565b818103818111156103a4576103a461102e565b6001600160401b038181168382160190808211156112445761124461102e565b5092915050565b60008261126857634e487b7160e01b600052601260045260246000fd5b500490565b6000806040838503121561128057600080fd5b825161128b81610e17565b602084015190925080151581146112a157600080fd5b809150509250929050565b6001600160a01b03841681526020808201849052606060408084018290528451848301819052600093608092909183870190600581901b8801850189850188805b8481101561137657607f198c8503018652825160a0815181875261131382880182610ee6565b915050898201516009811061133657634e487b7160e01b85526021600452602485fd5b868b015281890151898701528b82015115158c870152908a01518582038b870152906113628183610ee6565b978a019795505050918701916001016112ed565b50919d9c5050505050505050505050505056fea2646970667358221220c40e6e02306f4bf6cd6f5b433de2a164df08b861751588b9fa6efee7b1a1340a64736f6c63430008160033",
433
+ "linkReferences": {},
434
+ "deployedLinkReferences": {}
435
+ }
@@ -0,0 +1,125 @@
1
+ // SPDX-License-Identifier: LGPL-3.0-only
2
+ // Created By: Art Blocks Inc.
3
+
4
+ pragma solidity ^0.8.0;
5
+
6
+ import {ITransferHook} from "./ITransferHook.sol";
7
+ import {IPMPAugmentHook} from "./IPMPAugmentHook.sol";
8
+
9
+ /**
10
+ * @title Interface for the mint-time and transfer-count combined hook.
11
+ * @author Art Blocks Inc.
12
+ * @notice Reference implementation that records each token's mint timestamp
13
+ * and subsequent transfer count, and injects those values (plus live seconds
14
+ * since mint) into the token's PostParams.
15
+ */
16
+ interface IMintTimeAndTransferCountHooks is ITransferHook, IPMPAugmentHook {
17
+ /**
18
+ * @notice Packed per-token state written by the transfer hook.
19
+ * @dev Fits in a single storage slot. `mintTimestamp == 0` means this hook
20
+ * has not observed the token's mint.
21
+ * @param mintTimestamp Unix seconds of the mint block; `0` if the mint
22
+ * was not observed.
23
+ * @param transferCount Ownership-changing transfers after mint. Does not
24
+ * include the mint itself.
25
+ */
26
+ struct TokenTransferState {
27
+ uint64 mintTimestamp;
28
+ uint64 transferCount;
29
+ }
30
+
31
+ /**
32
+ * @notice Token `tokenId` on `coreContract` recorded its mint at
33
+ * `timestamp`.
34
+ */
35
+ event MintTimestampRecorded(
36
+ address indexed coreContract,
37
+ uint256 indexed tokenId,
38
+ uint64 timestamp
39
+ );
40
+
41
+ /**
42
+ * @notice Token `tokenId` on `coreContract` recorded an ownership-changing
43
+ * transfer. `transferCount` is the new count after this transfer.
44
+ */
45
+ event TransferCounted(
46
+ address indexed coreContract,
47
+ uint256 indexed tokenId,
48
+ uint64 transferCount,
49
+ address from,
50
+ address to
51
+ );
52
+
53
+ /**
54
+ * @notice PMP write of `transferCount` failed. Local hook state was still
55
+ * updated; the transfer that invoked this hook was not reverted.
56
+ * @dev Typical causes: the project has not configured a `transferCount`
57
+ * PMP with `AuthOption.Address` and `authAddress == this`, the param is
58
+ * locked, or the value is out of the configured range.
59
+ */
60
+ event TransferCountPMPSyncFailed(
61
+ address indexed coreContract,
62
+ uint256 indexed tokenId,
63
+ uint64 transferCount
64
+ );
65
+
66
+ /**
67
+ * @notice Thrown when the calling core does not have this hook configured
68
+ * for the token's project.
69
+ */
70
+ error HookNotConfiguredForProject(
71
+ address coreContract,
72
+ uint256 projectId,
73
+ address configuredHook
74
+ );
75
+
76
+ /**
77
+ * @notice Packed mint timestamp and transfer count for a token.
78
+ * @param coreContract Core contract the token belongs to.
79
+ * @param tokenId Token ID.
80
+ * @return state Packed state. Both fields are `0` if the token has never
81
+ * been recorded.
82
+ */
83
+ function tokenTransferState(
84
+ address coreContract,
85
+ uint256 tokenId
86
+ ) external view returns (TokenTransferState memory state);
87
+
88
+ /**
89
+ * @notice Unix seconds of the mint block, or `0` if this hook did not
90
+ * observe the mint.
91
+ */
92
+ function mintTimestamp(
93
+ address coreContract,
94
+ uint256 tokenId
95
+ ) external view returns (uint256);
96
+
97
+ /**
98
+ * @notice Ownership-changing transfers after mint. Does not include the
99
+ * mint itself. `0` until a post-mint transfer is recorded.
100
+ */
101
+ function transferCount(
102
+ address coreContract,
103
+ uint256 tokenId
104
+ ) external view returns (uint256);
105
+
106
+ /**
107
+ * @notice Seconds between the recorded mint timestamp and `block.timestamp`
108
+ * at the time of the call. `0` if the mint was not observed, or if
109
+ * `block.timestamp` is not after the mint timestamp.
110
+ */
111
+ function secondsSinceMint(
112
+ address coreContract,
113
+ uint256 tokenId
114
+ ) external view returns (uint256);
115
+
116
+ /**
117
+ * @notice Whether this hook observed the token's mint, which is the case
118
+ * only if it was configured as the project's transfer hook before the
119
+ * token was minted.
120
+ */
121
+ function isTrackedFromMint(
122
+ address coreContract,
123
+ uint256 tokenId
124
+ ) external view returns (bool);
125
+ }