@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,248 @@
1
+ [
2
+ {
3
+ "anonymous": false,
4
+ "inputs": [
5
+ {
6
+ "indexed": true,
7
+ "internalType": "address",
8
+ "name": "owner",
9
+ "type": "address"
10
+ },
11
+ {
12
+ "indexed": true,
13
+ "internalType": "address",
14
+ "name": "approved",
15
+ "type": "address"
16
+ },
17
+ {
18
+ "indexed": true,
19
+ "internalType": "uint256",
20
+ "name": "tokenId",
21
+ "type": "uint256"
22
+ }
23
+ ],
24
+ "name": "Approval",
25
+ "type": "event"
26
+ },
27
+ {
28
+ "anonymous": false,
29
+ "inputs": [
30
+ {
31
+ "indexed": true,
32
+ "internalType": "address",
33
+ "name": "owner",
34
+ "type": "address"
35
+ },
36
+ {
37
+ "indexed": true,
38
+ "internalType": "address",
39
+ "name": "operator",
40
+ "type": "address"
41
+ },
42
+ {
43
+ "indexed": false,
44
+ "internalType": "bool",
45
+ "name": "approved",
46
+ "type": "bool"
47
+ }
48
+ ],
49
+ "name": "ApprovalForAll",
50
+ "type": "event"
51
+ },
52
+ {
53
+ "anonymous": false,
54
+ "inputs": [
55
+ {
56
+ "indexed": true,
57
+ "internalType": "address",
58
+ "name": "from",
59
+ "type": "address"
60
+ },
61
+ {
62
+ "indexed": true,
63
+ "internalType": "address",
64
+ "name": "to",
65
+ "type": "address"
66
+ },
67
+ {
68
+ "indexed": true,
69
+ "internalType": "uint256",
70
+ "name": "tokenId",
71
+ "type": "uint256"
72
+ }
73
+ ],
74
+ "name": "Transfer",
75
+ "type": "event"
76
+ },
77
+ {
78
+ "inputs": [
79
+ { "internalType": "address", "name": "to", "type": "address" },
80
+ {
81
+ "internalType": "uint256",
82
+ "name": "tokenId",
83
+ "type": "uint256"
84
+ }
85
+ ],
86
+ "name": "approve",
87
+ "outputs": [],
88
+ "stateMutability": "nonpayable",
89
+ "type": "function"
90
+ },
91
+ {
92
+ "constant": true,
93
+ "inputs": [],
94
+ "name": "totalSupply",
95
+ "outputs": [
96
+ {
97
+ "name": "",
98
+ "type": "uint256"
99
+ }
100
+ ],
101
+ "payable": false,
102
+ "stateMutability": "view",
103
+ "type": "function"
104
+ },
105
+ {
106
+ "inputs": [
107
+ { "internalType": "address", "name": "owner", "type": "address" }
108
+ ],
109
+ "name": "balanceOf",
110
+ "outputs": [
111
+ { "internalType": "uint256", "name": "balance", "type": "uint256" }
112
+ ],
113
+ "stateMutability": "view",
114
+ "type": "function"
115
+ },
116
+ {
117
+ "inputs": [
118
+ { "internalType": "uint256", "name": "tokenId", "type": "uint256" }
119
+ ],
120
+ "name": "getApproved",
121
+ "outputs": [
122
+ { "internalType": "address", "name": "operator", "type": "address" }
123
+ ],
124
+ "stateMutability": "view",
125
+ "type": "function"
126
+ },
127
+ {
128
+ "inputs": [
129
+ { "internalType": "address", "name": "owner", "type": "address" },
130
+ {
131
+ "internalType": "address",
132
+ "name": "operator",
133
+ "type": "address"
134
+ }
135
+ ],
136
+ "name": "isApprovedForAll",
137
+ "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
138
+ "stateMutability": "view",
139
+ "type": "function"
140
+ },
141
+ {
142
+ "inputs": [],
143
+ "name": "name",
144
+ "outputs": [{ "internalType": "string", "name": "", "type": "string" }],
145
+ "stateMutability": "view",
146
+ "type": "function"
147
+ },
148
+ {
149
+ "inputs": [
150
+ { "internalType": "uint256", "name": "tokenId", "type": "uint256" }
151
+ ],
152
+ "name": "ownerOf",
153
+ "outputs": [
154
+ { "internalType": "address", "name": "owner", "type": "address" }
155
+ ],
156
+ "stateMutability": "view",
157
+ "type": "function"
158
+ },
159
+ {
160
+ "inputs": [
161
+ { "internalType": "address", "name": "from", "type": "address" },
162
+ {
163
+ "internalType": "address",
164
+ "name": "to",
165
+ "type": "address"
166
+ },
167
+ { "internalType": "uint256", "name": "tokenId", "type": "uint256" }
168
+ ],
169
+ "name": "safeTransferFrom",
170
+ "outputs": [],
171
+ "stateMutability": "nonpayable",
172
+ "type": "function"
173
+ },
174
+ {
175
+ "inputs": [
176
+ { "internalType": "address", "name": "from", "type": "address" },
177
+ {
178
+ "internalType": "address",
179
+ "name": "to",
180
+ "type": "address"
181
+ },
182
+ { "internalType": "uint256", "name": "tokenId", "type": "uint256" },
183
+ {
184
+ "internalType": "bytes",
185
+ "name": "data",
186
+ "type": "bytes"
187
+ }
188
+ ],
189
+ "name": "safeTransferFrom",
190
+ "outputs": [],
191
+ "stateMutability": "nonpayable",
192
+ "type": "function"
193
+ },
194
+ {
195
+ "inputs": [
196
+ { "internalType": "address", "name": "operator", "type": "address" },
197
+ {
198
+ "internalType": "bool",
199
+ "name": "_approved",
200
+ "type": "bool"
201
+ }
202
+ ],
203
+ "name": "setApprovalForAll",
204
+ "outputs": [],
205
+ "stateMutability": "nonpayable",
206
+ "type": "function"
207
+ },
208
+ {
209
+ "inputs": [
210
+ { "internalType": "bytes4", "name": "interfaceId", "type": "bytes4" }
211
+ ],
212
+ "name": "supportsInterface",
213
+ "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
214
+ "stateMutability": "view",
215
+ "type": "function"
216
+ },
217
+ {
218
+ "inputs": [],
219
+ "name": "symbol",
220
+ "outputs": [{ "internalType": "string", "name": "", "type": "string" }],
221
+ "stateMutability": "view",
222
+ "type": "function"
223
+ },
224
+ {
225
+ "inputs": [
226
+ { "internalType": "uint256", "name": "tokenId", "type": "uint256" }
227
+ ],
228
+ "name": "tokenURI",
229
+ "outputs": [{ "internalType": "string", "name": "", "type": "string" }],
230
+ "stateMutability": "view",
231
+ "type": "function"
232
+ },
233
+ {
234
+ "inputs": [
235
+ { "internalType": "address", "name": "from", "type": "address" },
236
+ {
237
+ "internalType": "address",
238
+ "name": "to",
239
+ "type": "address"
240
+ },
241
+ { "internalType": "uint256", "name": "tokenId", "type": "uint256" }
242
+ ],
243
+ "name": "transferFrom",
244
+ "outputs": [],
245
+ "stateMutability": "nonpayable",
246
+ "type": "function"
247
+ }
248
+ ]
@@ -0,0 +1,222 @@
1
+ export default [
2
+ {
3
+ anonymous: false,
4
+ inputs: [
5
+ {
6
+ indexed: true,
7
+ internalType: "address",
8
+ name: "owner",
9
+ type: "address",
10
+ },
11
+ {
12
+ indexed: true,
13
+ internalType: "address",
14
+ name: "approved",
15
+ type: "address",
16
+ },
17
+ {
18
+ indexed: true,
19
+ internalType: "uint256",
20
+ name: "tokenId",
21
+ type: "uint256",
22
+ },
23
+ ],
24
+ name: "Approval",
25
+ type: "event",
26
+ },
27
+ {
28
+ anonymous: false,
29
+ inputs: [
30
+ {
31
+ indexed: true,
32
+ internalType: "address",
33
+ name: "owner",
34
+ type: "address",
35
+ },
36
+ {
37
+ indexed: true,
38
+ internalType: "address",
39
+ name: "operator",
40
+ type: "address",
41
+ },
42
+ { indexed: false, internalType: "bool", name: "approved", type: "bool" },
43
+ ],
44
+ name: "ApprovalForAll",
45
+ type: "event",
46
+ },
47
+ {
48
+ anonymous: false,
49
+ inputs: [
50
+ { indexed: true, internalType: "address", name: "from", type: "address" },
51
+ {
52
+ indexed: true,
53
+ internalType: "address",
54
+ name: "to",
55
+ type: "address",
56
+ },
57
+ {
58
+ indexed: true,
59
+ internalType: "uint256",
60
+ name: "tokenId",
61
+ type: "uint256",
62
+ },
63
+ ],
64
+ name: "Transfer",
65
+ type: "event",
66
+ },
67
+ {
68
+ inputs: [
69
+ { internalType: "address", name: "to", type: "address" },
70
+ {
71
+ internalType: "uint256",
72
+ name: "tokenId",
73
+ type: "uint256",
74
+ },
75
+ ],
76
+ name: "approve",
77
+ outputs: [],
78
+ stateMutability: "nonpayable",
79
+ type: "function",
80
+ },
81
+ {
82
+ constant: true,
83
+ inputs: [],
84
+ name: "totalSupply",
85
+ outputs: [
86
+ {
87
+ name: "",
88
+ type: "uint256",
89
+ },
90
+ ],
91
+ payable: false,
92
+ stateMutability: "view",
93
+ type: "function",
94
+ },
95
+ {
96
+ inputs: [{ internalType: "address", name: "owner", type: "address" }],
97
+ name: "balanceOf",
98
+ outputs: [{ internalType: "uint256", name: "balance", type: "uint256" }],
99
+ stateMutability: "view",
100
+ type: "function",
101
+ },
102
+ {
103
+ inputs: [{ internalType: "uint256", name: "tokenId", type: "uint256" }],
104
+ name: "getApproved",
105
+ outputs: [{ internalType: "address", name: "operator", type: "address" }],
106
+ stateMutability: "view",
107
+ type: "function",
108
+ },
109
+ {
110
+ inputs: [
111
+ { internalType: "address", name: "owner", type: "address" },
112
+ {
113
+ internalType: "address",
114
+ name: "operator",
115
+ type: "address",
116
+ },
117
+ ],
118
+ name: "isApprovedForAll",
119
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
120
+ stateMutability: "view",
121
+ type: "function",
122
+ },
123
+ {
124
+ inputs: [],
125
+ name: "name",
126
+ outputs: [{ internalType: "string", name: "", type: "string" }],
127
+ stateMutability: "view",
128
+ type: "function",
129
+ },
130
+ {
131
+ inputs: [{ internalType: "uint256", name: "tokenId", type: "uint256" }],
132
+ name: "ownerOf",
133
+ outputs: [{ internalType: "address", name: "owner", type: "address" }],
134
+ stateMutability: "view",
135
+ type: "function",
136
+ },
137
+ {
138
+ inputs: [
139
+ { internalType: "address", name: "from", type: "address" },
140
+ {
141
+ internalType: "address",
142
+ name: "to",
143
+ type: "address",
144
+ },
145
+ { internalType: "uint256", name: "tokenId", type: "uint256" },
146
+ ],
147
+ name: "safeTransferFrom",
148
+ outputs: [],
149
+ stateMutability: "nonpayable",
150
+ type: "function",
151
+ },
152
+ {
153
+ inputs: [
154
+ { internalType: "address", name: "from", type: "address" },
155
+ {
156
+ internalType: "address",
157
+ name: "to",
158
+ type: "address",
159
+ },
160
+ { internalType: "uint256", name: "tokenId", type: "uint256" },
161
+ {
162
+ internalType: "bytes",
163
+ name: "data",
164
+ type: "bytes",
165
+ },
166
+ ],
167
+ name: "safeTransferFrom",
168
+ outputs: [],
169
+ stateMutability: "nonpayable",
170
+ type: "function",
171
+ },
172
+ {
173
+ inputs: [
174
+ { internalType: "address", name: "operator", type: "address" },
175
+ {
176
+ internalType: "bool",
177
+ name: "_approved",
178
+ type: "bool",
179
+ },
180
+ ],
181
+ name: "setApprovalForAll",
182
+ outputs: [],
183
+ stateMutability: "nonpayable",
184
+ type: "function",
185
+ },
186
+ {
187
+ inputs: [{ internalType: "bytes4", name: "interfaceId", type: "bytes4" }],
188
+ name: "supportsInterface",
189
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
190
+ stateMutability: "view",
191
+ type: "function",
192
+ },
193
+ {
194
+ inputs: [],
195
+ name: "symbol",
196
+ outputs: [{ internalType: "string", name: "", type: "string" }],
197
+ stateMutability: "view",
198
+ type: "function",
199
+ },
200
+ {
201
+ inputs: [{ internalType: "uint256", name: "tokenId", type: "uint256" }],
202
+ name: "tokenURI",
203
+ outputs: [{ internalType: "string", name: "", type: "string" }],
204
+ stateMutability: "view",
205
+ type: "function",
206
+ },
207
+ {
208
+ inputs: [
209
+ { internalType: "address", name: "from", type: "address" },
210
+ {
211
+ internalType: "address",
212
+ name: "to",
213
+ type: "address",
214
+ },
215
+ { internalType: "uint256", name: "tokenId", type: "uint256" },
216
+ ],
217
+ name: "transferFrom",
218
+ outputs: [],
219
+ stateMutability: "nonpayable",
220
+ type: "function",
221
+ },
222
+ ] as const;