@paimaexample/evm-contracts 0.3.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 (79) hide show
  1. package/README.md +7 -0
  2. package/deno.json +28 -0
  3. package/docs/templates/contract.hbs +144 -0
  4. package/docs/templates/helpers.js +61 -0
  5. package/docs/templates/page.hbs +7 -0
  6. package/docs/templates/properties.js +76 -0
  7. package/hardhat.config.ts +11 -0
  8. package/index.js +1 -0
  9. package/mod.ts +0 -0
  10. package/package.json +13 -0
  11. package/remappings.txt +1 -0
  12. package/src/companions/ERC165Contract.json +21 -0
  13. package/src/companions/ERC165Contract.ts +21 -0
  14. package/src/companions/ERC20Contract.json +222 -0
  15. package/src/companions/ERC20Contract.ts +222 -0
  16. package/src/companions/ERC6551RegistryContract.json +128 -0
  17. package/src/companions/ERC6551RegistryContract.ts +128 -0
  18. package/src/companions/ERC721Contract.json +248 -0
  19. package/src/companions/ERC721Contract.ts +222 -0
  20. package/src/companions/IERC1155Contract.json +295 -0
  21. package/src/companions/IERC1155Contract.ts +295 -0
  22. package/src/companions/OldERC6551RegistryContract.json +133 -0
  23. package/src/companions/OldERC6551RegistryContract.ts +133 -0
  24. package/src/companions/PaimaERC721Contract.json +787 -0
  25. package/src/companions/PaimaERC721Contract.ts +787 -0
  26. package/src/companions/PaimaL2Contract.json +134 -0
  27. package/src/companions/PaimaL2Contract.ts +134 -0
  28. package/src/companions/README.md +5 -0
  29. package/src/contracts/AnnotatedMintNft.sol +171 -0
  30. package/src/contracts/BaseState.sol +16 -0
  31. package/src/contracts/ERC1967.sol +43 -0
  32. package/src/contracts/Erc20NftSale.sol +186 -0
  33. package/src/contracts/GenericPayment.sol +60 -0
  34. package/src/contracts/NativeNftSale.sol +97 -0
  35. package/src/contracts/PaimaL2Contract.sol +54 -0
  36. package/src/contracts/Proxy/Erc20NftSaleProxy.sol +79 -0
  37. package/src/contracts/Proxy/GenericPaymentProxy.sol +64 -0
  38. package/src/contracts/Proxy/NativeNftSaleProxy.sol +72 -0
  39. package/src/contracts/Proxy/OrderbookDexProxy.sol +27 -0
  40. package/src/contracts/README.md +72 -0
  41. package/src/contracts/State.sol +25 -0
  42. package/src/contracts/dev/ERC721Dev.sol +13 -0
  43. package/src/contracts/dev/Erc20Dev.sol +13 -0
  44. package/src/contracts/dev/NativeNftSaleUpgradeDev.sol +9 -0
  45. package/src/contracts/dev/NftSaleUpgradeDev.sol +12 -0
  46. package/src/contracts/dev/NftTypeMapper.sol +38 -0
  47. package/src/contracts/dev/Token.sol +15 -0
  48. package/src/contracts/dev/UpgradeDev.sol +10 -0
  49. package/src/contracts/orderbook/IOrderbookDex.sol +215 -0
  50. package/src/contracts/orderbook/OrderbookDex.sol +435 -0
  51. package/src/contracts/token/IERC4906Agnostic.sol +17 -0
  52. package/src/contracts/token/IInverseAppProjected1155.sol +40 -0
  53. package/src/contracts/token/IInverseAppProjectedNft.sol +38 -0
  54. package/src/contracts/token/IInverseBaseProjected1155.sol +25 -0
  55. package/src/contracts/token/IInverseBaseProjectedNft.sol +29 -0
  56. package/src/contracts/token/IInverseProjected1155.sol +38 -0
  57. package/src/contracts/token/IInverseProjectedNft.sol +41 -0
  58. package/src/contracts/token/ITokenUri.sol +10 -0
  59. package/src/contracts/token/IUri.sol +13 -0
  60. package/src/contracts/token/InverseAppProjected1155.sol +218 -0
  61. package/src/contracts/token/InverseAppProjectedNft.sol +192 -0
  62. package/src/contracts/token/InverseBaseProjected1155.sol +170 -0
  63. package/src/contracts/token/InverseBaseProjectedNft.sol +158 -0
  64. package/src/plugin/common.ts +35 -0
  65. package/src/plugin/deployment.ts +161 -0
  66. package/src/plugin/mod.ts +6 -0
  67. package/src/plugin/paimaL2.ts +202 -0
  68. package/src/recommendedHardhat.ts +86 -0
  69. package/test/lib/StdInvariant.sol +96 -0
  70. package/test/lib/cheatcodes.sol +89 -0
  71. package/test/lib/console.sol +1884 -0
  72. package/test/lib/ctest.sol +678 -0
  73. package/test/src/InverseAppProjected1155.t.sol +207 -0
  74. package/test/src/InverseAppProjectedNft.t.sol +164 -0
  75. package/test/src/InverseBaseProjected1155.t.sol +171 -0
  76. package/test/src/InverseBaseProjectedNft.t.sol +141 -0
  77. package/test/src/OrderbookDex.t.sol +710 -0
  78. package/test/src/OrderbookDexInvariant.t.sol +426 -0
  79. package/test/src/PaimaL2ContractTest.sol +115 -0
@@ -0,0 +1,787 @@
1
+ export default [
2
+ {
3
+ inputs: [
4
+ {
5
+ internalType: "string",
6
+ name: "name",
7
+ type: "string",
8
+ },
9
+ {
10
+ internalType: "string",
11
+ name: "symbol",
12
+ type: "string",
13
+ },
14
+ {
15
+ internalType: "uint256",
16
+ name: "supply",
17
+ type: "uint256",
18
+ },
19
+ {
20
+ internalType: "address",
21
+ name: "owner",
22
+ type: "address",
23
+ },
24
+ ],
25
+ stateMutability: "nonpayable",
26
+ type: "constructor",
27
+ },
28
+ {
29
+ anonymous: false,
30
+ inputs: [
31
+ {
32
+ indexed: true,
33
+ internalType: "address",
34
+ name: "owner",
35
+ type: "address",
36
+ },
37
+ {
38
+ indexed: true,
39
+ internalType: "address",
40
+ name: "approved",
41
+ type: "address",
42
+ },
43
+ {
44
+ indexed: true,
45
+ internalType: "uint256",
46
+ name: "tokenId",
47
+ type: "uint256",
48
+ },
49
+ ],
50
+ name: "Approval",
51
+ type: "event",
52
+ },
53
+ {
54
+ anonymous: false,
55
+ inputs: [
56
+ {
57
+ indexed: true,
58
+ internalType: "address",
59
+ name: "owner",
60
+ type: "address",
61
+ },
62
+ {
63
+ indexed: true,
64
+ internalType: "address",
65
+ name: "operator",
66
+ type: "address",
67
+ },
68
+ {
69
+ indexed: false,
70
+ internalType: "bool",
71
+ name: "approved",
72
+ type: "bool",
73
+ },
74
+ ],
75
+ name: "ApprovalForAll",
76
+ type: "event",
77
+ },
78
+ {
79
+ anonymous: false,
80
+ inputs: [
81
+ {
82
+ indexed: true,
83
+ internalType: "uint8",
84
+ name: "category",
85
+ type: "uint8",
86
+ },
87
+ {
88
+ indexed: true,
89
+ internalType: "uint256",
90
+ name: "tokenId",
91
+ type: "uint256",
92
+ },
93
+ ],
94
+ name: "Category",
95
+ type: "event",
96
+ },
97
+ {
98
+ anonymous: false,
99
+ inputs: [
100
+ {
101
+ indexed: true,
102
+ internalType: "uint256",
103
+ name: "tokenId",
104
+ type: "uint256",
105
+ },
106
+ {
107
+ indexed: false,
108
+ internalType: "string",
109
+ name: "initialData",
110
+ type: "string",
111
+ },
112
+ ],
113
+ name: "Minted",
114
+ type: "event",
115
+ },
116
+ {
117
+ anonymous: false,
118
+ inputs: [
119
+ {
120
+ indexed: true,
121
+ internalType: "address",
122
+ name: "previousOwner",
123
+ type: "address",
124
+ },
125
+ {
126
+ indexed: true,
127
+ internalType: "address",
128
+ name: "newOwner",
129
+ type: "address",
130
+ },
131
+ ],
132
+ name: "OwnershipTransferred",
133
+ type: "event",
134
+ },
135
+ {
136
+ anonymous: false,
137
+ inputs: [
138
+ {
139
+ indexed: true,
140
+ internalType: "address",
141
+ name: "oldMinter",
142
+ type: "address",
143
+ },
144
+ ],
145
+ name: "RemoveMinter",
146
+ type: "event",
147
+ },
148
+ {
149
+ anonymous: false,
150
+ inputs: [
151
+ {
152
+ indexed: true,
153
+ internalType: "string",
154
+ name: "oldUri",
155
+ type: "string",
156
+ },
157
+ {
158
+ indexed: true,
159
+ internalType: "string",
160
+ name: "newUri",
161
+ type: "string",
162
+ },
163
+ ],
164
+ name: "SetBaseURI",
165
+ type: "event",
166
+ },
167
+ {
168
+ anonymous: false,
169
+ inputs: [
170
+ {
171
+ indexed: true,
172
+ internalType: "address",
173
+ name: "newMinter",
174
+ type: "address",
175
+ },
176
+ ],
177
+ name: "SetMinter",
178
+ type: "event",
179
+ },
180
+ {
181
+ anonymous: false,
182
+ inputs: [
183
+ {
184
+ indexed: true,
185
+ internalType: "address",
186
+ name: "from",
187
+ type: "address",
188
+ },
189
+ {
190
+ indexed: true,
191
+ internalType: "address",
192
+ name: "to",
193
+ type: "address",
194
+ },
195
+ {
196
+ indexed: true,
197
+ internalType: "uint256",
198
+ name: "tokenId",
199
+ type: "uint256",
200
+ },
201
+ ],
202
+ name: "Transfer",
203
+ type: "event",
204
+ },
205
+ {
206
+ anonymous: false,
207
+ inputs: [
208
+ {
209
+ indexed: true,
210
+ internalType: "uint256",
211
+ name: "oldMaxSupply",
212
+ type: "uint256",
213
+ },
214
+ {
215
+ indexed: true,
216
+ internalType: "uint256",
217
+ name: "newMaxSupply",
218
+ type: "uint256",
219
+ },
220
+ ],
221
+ name: "UpdateMaxSupply",
222
+ type: "event",
223
+ },
224
+ {
225
+ inputs: [
226
+ {
227
+ internalType: "address",
228
+ name: "to",
229
+ type: "address",
230
+ },
231
+ {
232
+ internalType: "uint256",
233
+ name: "tokenId",
234
+ type: "uint256",
235
+ },
236
+ ],
237
+ name: "approve",
238
+ outputs: [],
239
+ stateMutability: "nonpayable",
240
+ type: "function",
241
+ },
242
+ {
243
+ inputs: [
244
+ {
245
+ internalType: "address",
246
+ name: "owner",
247
+ type: "address",
248
+ },
249
+ ],
250
+ name: "balanceOf",
251
+ outputs: [
252
+ {
253
+ internalType: "uint256",
254
+ name: "",
255
+ type: "uint256",
256
+ },
257
+ ],
258
+ stateMutability: "view",
259
+ type: "function",
260
+ constant: true,
261
+ },
262
+ {
263
+ inputs: [],
264
+ name: "baseExtension",
265
+ outputs: [
266
+ {
267
+ internalType: "string",
268
+ name: "",
269
+ type: "string",
270
+ },
271
+ ],
272
+ stateMutability: "view",
273
+ type: "function",
274
+ constant: true,
275
+ },
276
+ {
277
+ inputs: [],
278
+ name: "baseURI",
279
+ outputs: [
280
+ {
281
+ internalType: "string",
282
+ name: "",
283
+ type: "string",
284
+ },
285
+ ],
286
+ stateMutability: "view",
287
+ type: "function",
288
+ constant: true,
289
+ },
290
+ {
291
+ inputs: [],
292
+ name: "currentCategory",
293
+ outputs: [
294
+ {
295
+ internalType: "uint8",
296
+ name: "",
297
+ type: "uint8",
298
+ },
299
+ ],
300
+ stateMutability: "view",
301
+ type: "function",
302
+ constant: true,
303
+ },
304
+ {
305
+ inputs: [],
306
+ name: "currentTokenId",
307
+ outputs: [
308
+ {
309
+ internalType: "uint256",
310
+ name: "",
311
+ type: "uint256",
312
+ },
313
+ ],
314
+ stateMutability: "view",
315
+ type: "function",
316
+ constant: true,
317
+ },
318
+ {
319
+ inputs: [
320
+ {
321
+ internalType: "uint256",
322
+ name: "tokenId",
323
+ type: "uint256",
324
+ },
325
+ ],
326
+ name: "getApproved",
327
+ outputs: [
328
+ {
329
+ internalType: "address",
330
+ name: "",
331
+ type: "address",
332
+ },
333
+ ],
334
+ stateMutability: "view",
335
+ type: "function",
336
+ constant: true,
337
+ },
338
+ {
339
+ inputs: [
340
+ {
341
+ internalType: "address",
342
+ name: "owner",
343
+ type: "address",
344
+ },
345
+ {
346
+ internalType: "address",
347
+ name: "operator",
348
+ type: "address",
349
+ },
350
+ ],
351
+ name: "isApprovedForAll",
352
+ outputs: [
353
+ {
354
+ internalType: "bool",
355
+ name: "",
356
+ type: "bool",
357
+ },
358
+ ],
359
+ stateMutability: "view",
360
+ type: "function",
361
+ constant: true,
362
+ },
363
+ {
364
+ inputs: [],
365
+ name: "maxSupply",
366
+ outputs: [
367
+ {
368
+ internalType: "uint256",
369
+ name: "",
370
+ type: "uint256",
371
+ },
372
+ ],
373
+ stateMutability: "view",
374
+ type: "function",
375
+ constant: true,
376
+ },
377
+ {
378
+ inputs: [
379
+ {
380
+ internalType: "address",
381
+ name: "",
382
+ type: "address",
383
+ },
384
+ ],
385
+ name: "minters",
386
+ outputs: [
387
+ {
388
+ internalType: "bool",
389
+ name: "",
390
+ type: "bool",
391
+ },
392
+ ],
393
+ stateMutability: "view",
394
+ type: "function",
395
+ constant: true,
396
+ },
397
+ {
398
+ inputs: [],
399
+ name: "name",
400
+ outputs: [
401
+ {
402
+ internalType: "string",
403
+ name: "",
404
+ type: "string",
405
+ },
406
+ ],
407
+ stateMutability: "view",
408
+ type: "function",
409
+ constant: true,
410
+ },
411
+ {
412
+ inputs: [],
413
+ name: "owner",
414
+ outputs: [
415
+ {
416
+ internalType: "address",
417
+ name: "",
418
+ type: "address",
419
+ },
420
+ ],
421
+ stateMutability: "view",
422
+ type: "function",
423
+ constant: true,
424
+ },
425
+ {
426
+ inputs: [
427
+ {
428
+ internalType: "uint256",
429
+ name: "tokenId",
430
+ type: "uint256",
431
+ },
432
+ ],
433
+ name: "ownerOf",
434
+ outputs: [
435
+ {
436
+ internalType: "address",
437
+ name: "",
438
+ type: "address",
439
+ },
440
+ ],
441
+ stateMutability: "view",
442
+ type: "function",
443
+ constant: true,
444
+ },
445
+ {
446
+ inputs: [],
447
+ name: "renounceOwnership",
448
+ outputs: [],
449
+ stateMutability: "nonpayable",
450
+ type: "function",
451
+ },
452
+ {
453
+ inputs: [
454
+ {
455
+ internalType: "address",
456
+ name: "from",
457
+ type: "address",
458
+ },
459
+ {
460
+ internalType: "address",
461
+ name: "to",
462
+ type: "address",
463
+ },
464
+ {
465
+ internalType: "uint256",
466
+ name: "tokenId",
467
+ type: "uint256",
468
+ },
469
+ ],
470
+ name: "safeTransferFrom",
471
+ outputs: [],
472
+ stateMutability: "nonpayable",
473
+ type: "function",
474
+ },
475
+ {
476
+ inputs: [
477
+ {
478
+ internalType: "address",
479
+ name: "from",
480
+ type: "address",
481
+ },
482
+ {
483
+ internalType: "address",
484
+ name: "to",
485
+ type: "address",
486
+ },
487
+ {
488
+ internalType: "uint256",
489
+ name: "tokenId",
490
+ type: "uint256",
491
+ },
492
+ {
493
+ internalType: "bytes",
494
+ name: "data",
495
+ type: "bytes",
496
+ },
497
+ ],
498
+ name: "safeTransferFrom",
499
+ outputs: [],
500
+ stateMutability: "nonpayable",
501
+ type: "function",
502
+ },
503
+ {
504
+ inputs: [
505
+ {
506
+ internalType: "address",
507
+ name: "operator",
508
+ type: "address",
509
+ },
510
+ {
511
+ internalType: "bool",
512
+ name: "approved",
513
+ type: "bool",
514
+ },
515
+ ],
516
+ name: "setApprovalForAll",
517
+ outputs: [],
518
+ stateMutability: "nonpayable",
519
+ type: "function",
520
+ },
521
+ {
522
+ inputs: [],
523
+ name: "symbol",
524
+ outputs: [
525
+ {
526
+ internalType: "string",
527
+ name: "",
528
+ type: "string",
529
+ },
530
+ ],
531
+ stateMutability: "view",
532
+ type: "function",
533
+ constant: true,
534
+ },
535
+ {
536
+ inputs: [
537
+ {
538
+ internalType: "uint256",
539
+ name: "",
540
+ type: "uint256",
541
+ },
542
+ ],
543
+ name: "tokens",
544
+ outputs: [
545
+ {
546
+ internalType: "uint8",
547
+ name: "category",
548
+ type: "uint8",
549
+ },
550
+ ],
551
+ stateMutability: "view",
552
+ type: "function",
553
+ constant: true,
554
+ },
555
+ {
556
+ inputs: [],
557
+ name: "totalSupply",
558
+ outputs: [
559
+ {
560
+ internalType: "uint256",
561
+ name: "",
562
+ type: "uint256",
563
+ },
564
+ ],
565
+ stateMutability: "view",
566
+ type: "function",
567
+ constant: true,
568
+ },
569
+ {
570
+ inputs: [
571
+ {
572
+ internalType: "address",
573
+ name: "from",
574
+ type: "address",
575
+ },
576
+ {
577
+ internalType: "address",
578
+ name: "to",
579
+ type: "address",
580
+ },
581
+ {
582
+ internalType: "uint256",
583
+ name: "tokenId",
584
+ type: "uint256",
585
+ },
586
+ ],
587
+ name: "transferFrom",
588
+ outputs: [],
589
+ stateMutability: "nonpayable",
590
+ type: "function",
591
+ },
592
+ {
593
+ inputs: [
594
+ {
595
+ internalType: "address",
596
+ name: "newOwner",
597
+ type: "address",
598
+ },
599
+ ],
600
+ name: "transferOwnership",
601
+ outputs: [],
602
+ stateMutability: "nonpayable",
603
+ type: "function",
604
+ },
605
+ {
606
+ inputs: [
607
+ {
608
+ internalType: "bytes4",
609
+ name: "interfaceID",
610
+ type: "bytes4",
611
+ },
612
+ ],
613
+ name: "supportsInterface",
614
+ outputs: [
615
+ {
616
+ internalType: "bool",
617
+ name: "",
618
+ type: "bool",
619
+ },
620
+ ],
621
+ stateMutability: "pure",
622
+ type: "function",
623
+ constant: true,
624
+ },
625
+ {
626
+ inputs: [
627
+ {
628
+ internalType: "address",
629
+ name: "_to",
630
+ type: "address",
631
+ },
632
+ {
633
+ internalType: "string",
634
+ name: "initialData",
635
+ type: "string",
636
+ },
637
+ ],
638
+ name: "mint",
639
+ outputs: [
640
+ {
641
+ internalType: "uint256",
642
+ name: "",
643
+ type: "uint256",
644
+ },
645
+ ],
646
+ stateMutability: "nonpayable",
647
+ type: "function",
648
+ },
649
+ {
650
+ inputs: [
651
+ {
652
+ internalType: "uint256",
653
+ name: "_tokenId",
654
+ type: "uint256",
655
+ },
656
+ ],
657
+ name: "burn",
658
+ outputs: [],
659
+ stateMutability: "nonpayable",
660
+ type: "function",
661
+ },
662
+ {
663
+ inputs: [
664
+ {
665
+ internalType: "address",
666
+ name: "_minter",
667
+ type: "address",
668
+ },
669
+ ],
670
+ name: "setMinter",
671
+ outputs: [],
672
+ stateMutability: "nonpayable",
673
+ type: "function",
674
+ },
675
+ {
676
+ inputs: [
677
+ {
678
+ internalType: "address",
679
+ name: "_minter",
680
+ type: "address",
681
+ },
682
+ ],
683
+ name: "removeMinter",
684
+ outputs: [],
685
+ stateMutability: "nonpayable",
686
+ type: "function",
687
+ },
688
+ {
689
+ inputs: [
690
+ {
691
+ internalType: "uint256",
692
+ name: "tokenId",
693
+ type: "uint256",
694
+ },
695
+ ],
696
+ name: "tokenURI",
697
+ outputs: [
698
+ {
699
+ internalType: "string",
700
+ name: "",
701
+ type: "string",
702
+ },
703
+ ],
704
+ stateMutability: "view",
705
+ type: "function",
706
+ constant: true,
707
+ },
708
+ {
709
+ inputs: [
710
+ {
711
+ internalType: "string",
712
+ name: "_URI",
713
+ type: "string",
714
+ },
715
+ ],
716
+ name: "setBaseURI",
717
+ outputs: [],
718
+ stateMutability: "nonpayable",
719
+ type: "function",
720
+ },
721
+ {
722
+ inputs: [
723
+ {
724
+ internalType: "string",
725
+ name: "_newBaseExtension",
726
+ type: "string",
727
+ },
728
+ ],
729
+ name: "setBaseExtension",
730
+ outputs: [],
731
+ stateMutability: "nonpayable",
732
+ type: "function",
733
+ },
734
+ {
735
+ inputs: [
736
+ {
737
+ internalType: "uint256",
738
+ name: "_maxSupply",
739
+ type: "uint256",
740
+ },
741
+ ],
742
+ name: "updateMaxSupply",
743
+ outputs: [],
744
+ stateMutability: "nonpayable",
745
+ type: "function",
746
+ },
747
+ {
748
+ inputs: [
749
+ {
750
+ internalType: "uint256",
751
+ name: "_tokenId",
752
+ type: "uint256",
753
+ },
754
+ ],
755
+ name: "exists",
756
+ outputs: [
757
+ {
758
+ internalType: "bool",
759
+ name: "",
760
+ type: "bool",
761
+ },
762
+ ],
763
+ stateMutability: "view",
764
+ type: "function",
765
+ constant: true,
766
+ },
767
+ {
768
+ inputs: [
769
+ {
770
+ internalType: "address",
771
+ name: "_account",
772
+ type: "address",
773
+ },
774
+ ],
775
+ name: "isMinter",
776
+ outputs: [
777
+ {
778
+ internalType: "bool",
779
+ name: "",
780
+ type: "bool",
781
+ },
782
+ ],
783
+ stateMutability: "view",
784
+ type: "function",
785
+ constant: true,
786
+ },
787
+ ] as const;