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