@openzeppelin/wizard 0.1.1 → 0.2.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 (87) hide show
  1. package/README.md +2 -0
  2. package/dist/environments/hardhat/package-lock.json +14913 -0
  3. package/dist/environments/hardhat/package.json +34 -0
  4. package/dist/environments/hardhat/upgradeable/package-lock.json +15333 -0
  5. package/dist/environments/hardhat/upgradeable/package.json +35 -0
  6. package/dist/erc721.js +2 -0
  7. package/dist/erc721.js.map +1 -1
  8. package/dist/governor.js +1 -1
  9. package/dist/governor.js.map +1 -1
  10. package/dist/print.d.ts.map +1 -1
  11. package/dist/print.js +5 -2
  12. package/dist/print.js.map +1 -1
  13. package/dist/solidity-version.json +1 -0
  14. package/dist/utils/format-lines.d.ts +1 -0
  15. package/dist/utils/format-lines.d.ts.map +1 -1
  16. package/dist/utils/format-lines.js +9 -5
  17. package/dist/utils/format-lines.js.map +1 -1
  18. package/dist/zip-hardhat.d.ts +5 -0
  19. package/dist/zip-hardhat.d.ts.map +1 -0
  20. package/dist/zip-hardhat.js +187 -0
  21. package/dist/zip-hardhat.js.map +1 -0
  22. package/dist/zip.js +1 -1
  23. package/dist/zip.js.map +1 -1
  24. package/package.json +8 -6
  25. package/src/environments/hardhat/package-lock.json +14913 -0
  26. package/src/environments/hardhat/package.json +34 -0
  27. package/src/environments/hardhat/upgradeable/package-lock.json +15333 -0
  28. package/src/environments/hardhat/upgradeable/package.json +35 -0
  29. package/src/erc721.ts +2 -0
  30. package/src/governor.ts +1 -1
  31. package/src/print.ts +1 -2
  32. package/src/solidity-version.json +1 -0
  33. package/src/utils/format-lines.ts +8 -3
  34. package/src/zip-hardhat.ts +186 -0
  35. package/src/zip.ts +1 -1
  36. package/dist/contract.test.d.ts +0 -2
  37. package/dist/contract.test.d.ts.map +0 -1
  38. package/dist/contract.test.js +0 -147
  39. package/dist/contract.test.js.map +0 -1
  40. package/dist/custom.test.d.ts +0 -2
  41. package/dist/custom.test.d.ts.map +0 -1
  42. package/dist/custom.test.js +0 -70
  43. package/dist/custom.test.js.map +0 -1
  44. package/dist/erc1155.test.d.ts +0 -2
  45. package/dist/erc1155.test.d.ts.map +0 -1
  46. package/dist/erc1155.test.js +0 -91
  47. package/dist/erc1155.test.js.map +0 -1
  48. package/dist/erc20.test.d.ts +0 -2
  49. package/dist/erc20.test.d.ts.map +0 -1
  50. package/dist/erc20.test.js +0 -133
  51. package/dist/erc20.test.js.map +0 -1
  52. package/dist/erc721.test.d.ts +0 -2
  53. package/dist/erc721.test.d.ts.map +0 -1
  54. package/dist/erc721.test.js +0 -112
  55. package/dist/erc721.test.js.map +0 -1
  56. package/dist/governor.test.d.ts +0 -2
  57. package/dist/governor.test.d.ts.map +0 -1
  58. package/dist/governor.test.js +0 -108
  59. package/dist/governor.test.js.map +0 -1
  60. package/dist/utils/to-identifier.test.d.ts +0 -2
  61. package/dist/utils/to-identifier.test.d.ts.map +0 -1
  62. package/dist/utils/to-identifier.test.js +0 -21
  63. package/dist/utils/to-identifier.test.js.map +0 -1
  64. package/dist/zip.test.d.ts +0 -2
  65. package/dist/zip.test.d.ts.map +0 -1
  66. package/dist/zip.test.js +0 -37
  67. package/dist/zip.test.js.map +0 -1
  68. package/src/contract.test.ts +0 -164
  69. package/src/contract.test.ts.md +0 -272
  70. package/src/contract.test.ts.snap +0 -0
  71. package/src/custom.test.ts +0 -80
  72. package/src/custom.test.ts.md +0 -154
  73. package/src/custom.test.ts.snap +0 -0
  74. package/src/erc1155.test.ts +0 -103
  75. package/src/erc1155.test.ts.md +0 -432
  76. package/src/erc1155.test.ts.snap +0 -0
  77. package/src/erc20.test.ts +0 -152
  78. package/src/erc20.test.ts.md +0 -571
  79. package/src/erc20.test.ts.snap +0 -0
  80. package/src/erc721.test.ts +0 -129
  81. package/src/erc721.test.ts.md +0 -517
  82. package/src/erc721.test.ts.snap +0 -0
  83. package/src/governor.test.ts +0 -125
  84. package/src/governor.test.ts.md +0 -1419
  85. package/src/governor.test.ts.snap +0 -0
  86. package/src/utils/to-identifier.test.ts +0 -20
  87. package/src/zip.test.ts +0 -35
@@ -1,432 +0,0 @@
1
- # Snapshot report for `src/erc1155.test.ts`
2
-
3
- The actual snapshot is saved in `erc1155.test.ts.snap`.
4
-
5
- Generated by [AVA](https://avajs.dev).
6
-
7
- ## basic
8
-
9
- > Snapshot 1
10
-
11
- `// SPDX-License-Identifier: MIT␊
12
- pragma solidity ^0.8.4;␊
13
-
14
- import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";␊
15
- import "@openzeppelin/contracts/access/Ownable.sol";␊
16
-
17
- contract MyToken is ERC1155, Ownable {␊
18
- constructor()␊
19
- ERC1155("https://gateway.pinata.cloud/ipfs/QmcP9hxrnC1T5ATPmq2saFeAM1ypFX9BnAswCdHB9JCjLA/")␊
20
- {}␊
21
-
22
- function setURI(string memory newuri) public onlyOwner {␊
23
- _setURI(newuri);␊
24
- }␊
25
- }␊
26
- `
27
-
28
- ## basic + roles
29
-
30
- > Snapshot 1
31
-
32
- `// SPDX-License-Identifier: MIT␊
33
- pragma solidity ^0.8.4;␊
34
-
35
- import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";␊
36
- import "@openzeppelin/contracts/access/AccessControl.sol";␊
37
-
38
- contract MyToken is ERC1155, AccessControl {␊
39
- bytes32 public constant URI_SETTER_ROLE = keccak256("URI_SETTER_ROLE");␊
40
-
41
- constructor()␊
42
- ERC1155("https://gateway.pinata.cloud/ipfs/QmcP9hxrnC1T5ATPmq2saFeAM1ypFX9BnAswCdHB9JCjLA/")␊
43
- {␊
44
- _grantRole(DEFAULT_ADMIN_ROLE, msg.sender);␊
45
- _grantRole(URI_SETTER_ROLE, msg.sender);␊
46
- }␊
47
-
48
- function setURI(string memory newuri) public onlyRole(URI_SETTER_ROLE) {␊
49
- _setURI(newuri);␊
50
- }␊
51
-
52
- // The following functions are overrides required by Solidity.␊
53
-
54
- function supportsInterface(bytes4 interfaceId)␊
55
- public␊
56
- view␊
57
- override(ERC1155, AccessControl)␊
58
- returns (bool)␊
59
- {␊
60
- return super.supportsInterface(interfaceId);␊
61
- }␊
62
- }␊
63
- `
64
-
65
- ## no updatable uri
66
-
67
- > Snapshot 1
68
-
69
- `// SPDX-License-Identifier: MIT␊
70
- pragma solidity ^0.8.4;␊
71
-
72
- import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";␊
73
-
74
- contract MyToken is ERC1155 {␊
75
- constructor()␊
76
- ERC1155("https://gateway.pinata.cloud/ipfs/QmcP9hxrnC1T5ATPmq2saFeAM1ypFX9BnAswCdHB9JCjLA/")␊
77
- {}␊
78
- }␊
79
- `
80
-
81
- ## burnable
82
-
83
- > Snapshot 1
84
-
85
- `// SPDX-License-Identifier: MIT␊
86
- pragma solidity ^0.8.4;␊
87
-
88
- import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";␊
89
- import "@openzeppelin/contracts/access/Ownable.sol";␊
90
- import "@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Burnable.sol";␊
91
-
92
- contract MyToken is ERC1155, Ownable, ERC1155Burnable {␊
93
- constructor()␊
94
- ERC1155("https://gateway.pinata.cloud/ipfs/QmcP9hxrnC1T5ATPmq2saFeAM1ypFX9BnAswCdHB9JCjLA/")␊
95
- {}␊
96
-
97
- function setURI(string memory newuri) public onlyOwner {␊
98
- _setURI(newuri);␊
99
- }␊
100
- }␊
101
- `
102
-
103
- ## pausable
104
-
105
- > Snapshot 1
106
-
107
- `// SPDX-License-Identifier: MIT␊
108
- pragma solidity ^0.8.4;␊
109
-
110
- import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";␊
111
- import "@openzeppelin/contracts/access/Ownable.sol";␊
112
- import "@openzeppelin/contracts/security/Pausable.sol";␊
113
-
114
- contract MyToken is ERC1155, Ownable, Pausable {␊
115
- constructor()␊
116
- ERC1155("https://gateway.pinata.cloud/ipfs/QmcP9hxrnC1T5ATPmq2saFeAM1ypFX9BnAswCdHB9JCjLA/")␊
117
- {}␊
118
-
119
- function setURI(string memory newuri) public onlyOwner {␊
120
- _setURI(newuri);␊
121
- }␊
122
-
123
- function pause() public onlyOwner {␊
124
- _pause();␊
125
- }␊
126
-
127
- function unpause() public onlyOwner {␊
128
- _unpause();␊
129
- }␊
130
-
131
- function _beforeTokenTransfer(address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data)␊
132
- internal␊
133
- whenNotPaused␊
134
- override␊
135
- {␊
136
- super._beforeTokenTransfer(operator, from, to, ids, amounts, data);␊
137
- }␊
138
- }␊
139
- `
140
-
141
- ## mintable
142
-
143
- > Snapshot 1
144
-
145
- `// SPDX-License-Identifier: MIT␊
146
- pragma solidity ^0.8.4;␊
147
-
148
- import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";␊
149
- import "@openzeppelin/contracts/access/Ownable.sol";␊
150
-
151
- contract MyToken is ERC1155, Ownable {␊
152
- constructor()␊
153
- ERC1155("https://gateway.pinata.cloud/ipfs/QmcP9hxrnC1T5ATPmq2saFeAM1ypFX9BnAswCdHB9JCjLA/")␊
154
- {}␊
155
-
156
- function setURI(string memory newuri) public onlyOwner {␊
157
- _setURI(newuri);␊
158
- }␊
159
-
160
- function mint(address account, uint256 id, uint256 amount, bytes memory data)␊
161
- public␊
162
- onlyOwner␊
163
- {␊
164
- _mint(account, id, amount, data);␊
165
- }␊
166
-
167
- function mintBatch(address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data)␊
168
- public␊
169
- onlyOwner␊
170
- {␊
171
- _mintBatch(to, ids, amounts, data);␊
172
- }␊
173
- }␊
174
- `
175
-
176
- ## mintable + roles
177
-
178
- > Snapshot 1
179
-
180
- `// SPDX-License-Identifier: MIT␊
181
- pragma solidity ^0.8.4;␊
182
-
183
- import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";␊
184
- import "@openzeppelin/contracts/access/AccessControl.sol";␊
185
-
186
- contract MyToken is ERC1155, AccessControl {␊
187
- bytes32 public constant URI_SETTER_ROLE = keccak256("URI_SETTER_ROLE");␊
188
- bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE");␊
189
-
190
- constructor()␊
191
- ERC1155("https://gateway.pinata.cloud/ipfs/QmcP9hxrnC1T5ATPmq2saFeAM1ypFX9BnAswCdHB9JCjLA/")␊
192
- {␊
193
- _grantRole(DEFAULT_ADMIN_ROLE, msg.sender);␊
194
- _grantRole(URI_SETTER_ROLE, msg.sender);␊
195
- _grantRole(MINTER_ROLE, msg.sender);␊
196
- }␊
197
-
198
- function setURI(string memory newuri) public onlyRole(URI_SETTER_ROLE) {␊
199
- _setURI(newuri);␊
200
- }␊
201
-
202
- function mint(address account, uint256 id, uint256 amount, bytes memory data)␊
203
- public␊
204
- onlyRole(MINTER_ROLE)␊
205
- {␊
206
- _mint(account, id, amount, data);␊
207
- }␊
208
-
209
- function mintBatch(address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data)␊
210
- public␊
211
- onlyRole(MINTER_ROLE)␊
212
- {␊
213
- _mintBatch(to, ids, amounts, data);␊
214
- }␊
215
-
216
- // The following functions are overrides required by Solidity.␊
217
-
218
- function supportsInterface(bytes4 interfaceId)␊
219
- public␊
220
- view␊
221
- override(ERC1155, AccessControl)␊
222
- returns (bool)␊
223
- {␊
224
- return super.supportsInterface(interfaceId);␊
225
- }␊
226
- }␊
227
- `
228
-
229
- ## supply tracking
230
-
231
- > Snapshot 1
232
-
233
- `// SPDX-License-Identifier: MIT␊
234
- pragma solidity ^0.8.4;␊
235
-
236
- import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";␊
237
- import "@openzeppelin/contracts/access/Ownable.sol";␊
238
- import "@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Supply.sol";␊
239
-
240
- contract MyToken is ERC1155, Ownable, ERC1155Supply {␊
241
- constructor()␊
242
- ERC1155("https://gateway.pinata.cloud/ipfs/QmcP9hxrnC1T5ATPmq2saFeAM1ypFX9BnAswCdHB9JCjLA/")␊
243
- {}␊
244
-
245
- function setURI(string memory newuri) public onlyOwner {␊
246
- _setURI(newuri);␊
247
- }␊
248
-
249
- // The following functions are overrides required by Solidity.␊
250
-
251
- function _beforeTokenTransfer(address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data)␊
252
- internal␊
253
- override(ERC1155, ERC1155Supply)␊
254
- {␊
255
- super._beforeTokenTransfer(operator, from, to, ids, amounts, data);␊
256
- }␊
257
- }␊
258
- `
259
-
260
- ## full upgradeable transparent
261
-
262
- > Snapshot 1
263
-
264
- `// SPDX-License-Identifier: MIT␊
265
- pragma solidity ^0.8.4;␊
266
-
267
- import "@openzeppelin/contracts-upgradeable/token/ERC1155/ERC1155Upgradeable.sol";␊
268
- import "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol";␊
269
- import "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol";␊
270
- import "@openzeppelin/contracts-upgradeable/token/ERC1155/extensions/ERC1155BurnableUpgradeable.sol";␊
271
- import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊
272
-
273
- contract MyToken is Initializable, ERC1155Upgradeable, AccessControlUpgradeable, PausableUpgradeable, ERC1155BurnableUpgradeable {␊
274
- bytes32 public constant URI_SETTER_ROLE = keccak256("URI_SETTER_ROLE");␊
275
- bytes32 public constant PAUSER_ROLE = keccak256("PAUSER_ROLE");␊
276
- bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE");␊
277
-
278
- /// @custom:oz-upgrades-unsafe-allow constructor␊
279
- constructor() {␊
280
- _disableInitializers();␊
281
- }␊
282
-
283
- function initialize() initializer public {␊
284
- __ERC1155_init("https://gateway.pinata.cloud/ipfs/QmcP9hxrnC1T5ATPmq2saFeAM1ypFX9BnAswCdHB9JCjLA/");␊
285
- __AccessControl_init();␊
286
- __Pausable_init();␊
287
- __ERC1155Burnable_init();␊
288
-
289
- _grantRole(DEFAULT_ADMIN_ROLE, msg.sender);␊
290
- _grantRole(URI_SETTER_ROLE, msg.sender);␊
291
- _grantRole(PAUSER_ROLE, msg.sender);␊
292
- _grantRole(MINTER_ROLE, msg.sender);␊
293
- }␊
294
-
295
- function setURI(string memory newuri) public onlyRole(URI_SETTER_ROLE) {␊
296
- _setURI(newuri);␊
297
- }␊
298
-
299
- function pause() public onlyRole(PAUSER_ROLE) {␊
300
- _pause();␊
301
- }␊
302
-
303
- function unpause() public onlyRole(PAUSER_ROLE) {␊
304
- _unpause();␊
305
- }␊
306
-
307
- function mint(address account, uint256 id, uint256 amount, bytes memory data)␊
308
- public␊
309
- onlyRole(MINTER_ROLE)␊
310
- {␊
311
- _mint(account, id, amount, data);␊
312
- }␊
313
-
314
- function mintBatch(address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data)␊
315
- public␊
316
- onlyRole(MINTER_ROLE)␊
317
- {␊
318
- _mintBatch(to, ids, amounts, data);␊
319
- }␊
320
-
321
- function _beforeTokenTransfer(address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data)␊
322
- internal␊
323
- whenNotPaused␊
324
- override␊
325
- {␊
326
- super._beforeTokenTransfer(operator, from, to, ids, amounts, data);␊
327
- }␊
328
-
329
- // The following functions are overrides required by Solidity.␊
330
-
331
- function supportsInterface(bytes4 interfaceId)␊
332
- public␊
333
- view␊
334
- override(ERC1155Upgradeable, AccessControlUpgradeable)␊
335
- returns (bool)␊
336
- {␊
337
- return super.supportsInterface(interfaceId);␊
338
- }␊
339
- }␊
340
- `
341
-
342
- ## full upgradeable uups
343
-
344
- > Snapshot 1
345
-
346
- `// SPDX-License-Identifier: MIT␊
347
- pragma solidity ^0.8.4;␊
348
-
349
- import "@openzeppelin/contracts-upgradeable/token/ERC1155/ERC1155Upgradeable.sol";␊
350
- import "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol";␊
351
- import "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol";␊
352
- import "@openzeppelin/contracts-upgradeable/token/ERC1155/extensions/ERC1155BurnableUpgradeable.sol";␊
353
- import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";␊
354
- import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";␊
355
-
356
- contract MyToken is Initializable, ERC1155Upgradeable, AccessControlUpgradeable, PausableUpgradeable, ERC1155BurnableUpgradeable, UUPSUpgradeable {␊
357
- bytes32 public constant URI_SETTER_ROLE = keccak256("URI_SETTER_ROLE");␊
358
- bytes32 public constant PAUSER_ROLE = keccak256("PAUSER_ROLE");␊
359
- bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE");␊
360
- bytes32 public constant UPGRADER_ROLE = keccak256("UPGRADER_ROLE");␊
361
-
362
- /// @custom:oz-upgrades-unsafe-allow constructor␊
363
- constructor() {␊
364
- _disableInitializers();␊
365
- }␊
366
-
367
- function initialize() initializer public {␊
368
- __ERC1155_init("https://gateway.pinata.cloud/ipfs/QmcP9hxrnC1T5ATPmq2saFeAM1ypFX9BnAswCdHB9JCjLA/");␊
369
- __AccessControl_init();␊
370
- __Pausable_init();␊
371
- __ERC1155Burnable_init();␊
372
- __UUPSUpgradeable_init();␊
373
-
374
- _grantRole(DEFAULT_ADMIN_ROLE, msg.sender);␊
375
- _grantRole(URI_SETTER_ROLE, msg.sender);␊
376
- _grantRole(PAUSER_ROLE, msg.sender);␊
377
- _grantRole(MINTER_ROLE, msg.sender);␊
378
- _grantRole(UPGRADER_ROLE, msg.sender);␊
379
- }␊
380
-
381
- function setURI(string memory newuri) public onlyRole(URI_SETTER_ROLE) {␊
382
- _setURI(newuri);␊
383
- }␊
384
-
385
- function pause() public onlyRole(PAUSER_ROLE) {␊
386
- _pause();␊
387
- }␊
388
-
389
- function unpause() public onlyRole(PAUSER_ROLE) {␊
390
- _unpause();␊
391
- }␊
392
-
393
- function mint(address account, uint256 id, uint256 amount, bytes memory data)␊
394
- public␊
395
- onlyRole(MINTER_ROLE)␊
396
- {␊
397
- _mint(account, id, amount, data);␊
398
- }␊
399
-
400
- function mintBatch(address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data)␊
401
- public␊
402
- onlyRole(MINTER_ROLE)␊
403
- {␊
404
- _mintBatch(to, ids, amounts, data);␊
405
- }␊
406
-
407
- function _beforeTokenTransfer(address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data)␊
408
- internal␊
409
- whenNotPaused␊
410
- override␊
411
- {␊
412
- super._beforeTokenTransfer(operator, from, to, ids, amounts, data);␊
413
- }␊
414
-
415
- function _authorizeUpgrade(address newImplementation)␊
416
- internal␊
417
- onlyRole(UPGRADER_ROLE)␊
418
- override␊
419
- {}␊
420
-
421
- // The following functions are overrides required by Solidity.␊
422
-
423
- function supportsInterface(bytes4 interfaceId)␊
424
- public␊
425
- view␊
426
- override(ERC1155Upgradeable, AccessControlUpgradeable)␊
427
- returns (bool)␊
428
- {␊
429
- return super.supportsInterface(interfaceId);␊
430
- }␊
431
- }␊
432
- `
Binary file
package/src/erc20.test.ts DELETED
@@ -1,152 +0,0 @@
1
- import test from 'ava';
2
- import { erc20 } from '.';
3
-
4
- import { buildERC20, ERC20Options } from './erc20';
5
- import { printContract } from './print';
6
-
7
- function testERC20(title: string, opts: Partial<ERC20Options>) {
8
- test(title, t => {
9
- const c = buildERC20({
10
- name: 'MyToken',
11
- symbol: 'MTK',
12
- ...opts,
13
- });
14
- t.snapshot(printContract(c));
15
- });
16
- }
17
-
18
- /**
19
- * Tests external API for equivalence with internal API
20
- */
21
- function testAPIEquivalence(title: string, opts?: ERC20Options) {
22
- test(title, t => {
23
- t.is(erc20.print(opts), printContract(buildERC20({
24
- name: 'MyToken',
25
- symbol: 'MTK',
26
- ...opts,
27
- })));
28
- });
29
- }
30
-
31
- testERC20('basic erc20', {});
32
-
33
- testERC20('erc20 with snapshots', {
34
- snapshots: true,
35
- });
36
-
37
- testERC20('erc20 burnable', {
38
- burnable: true,
39
- });
40
-
41
- testERC20('erc20 burnable with snapshots', {
42
- burnable: true,
43
- snapshots: true,
44
- });
45
-
46
- testERC20('erc20 pausable', {
47
- pausable: true,
48
- access: 'ownable',
49
- });
50
-
51
- testERC20('erc20 pausable with roles', {
52
- pausable: true,
53
- access: 'roles',
54
- });
55
-
56
- testERC20('erc20 burnable pausable', {
57
- burnable: true,
58
- pausable: true,
59
- });
60
-
61
- testERC20('erc20 burnable pausable with snapshots', {
62
- burnable: true,
63
- pausable: true,
64
- snapshots: true,
65
- });
66
-
67
- testERC20('erc20 preminted', {
68
- premint: '1000',
69
- });
70
-
71
- testERC20('erc20 premint of 0', {
72
- premint: '0',
73
- });
74
-
75
- testERC20('erc20 mintable', {
76
- mintable: true,
77
- access: 'ownable',
78
- });
79
-
80
- testERC20('erc20 mintable with roles', {
81
- mintable: true,
82
- access: 'roles',
83
- });
84
-
85
- testERC20('erc20 permit', {
86
- permit: true,
87
- });
88
-
89
- testERC20('erc20 votes', {
90
- votes: true,
91
- });
92
-
93
- testERC20('erc20 flashmint', {
94
- flashmint: true,
95
- });
96
-
97
- testERC20('erc20 full upgradeable transparent', {
98
- premint: '2000',
99
- access: 'roles',
100
- burnable: true,
101
- mintable: true,
102
- pausable: true,
103
- snapshots: true,
104
- permit: true,
105
- votes: true,
106
- flashmint: true,
107
- upgradeable: 'transparent',
108
- });
109
-
110
- testERC20('erc20 full upgradeable uups', {
111
- premint: '2000',
112
- access: 'roles',
113
- burnable: true,
114
- mintable: true,
115
- pausable: true,
116
- snapshots: true,
117
- permit: true,
118
- votes: true,
119
- flashmint: true,
120
- upgradeable: 'uups',
121
- });
122
-
123
- testAPIEquivalence('erc20 API default');
124
-
125
- testAPIEquivalence('erc20 API basic', { name: 'CustomToken', symbol: 'CTK' });
126
-
127
- testAPIEquivalence('erc20 API full upgradeable', {
128
- name: 'CustomToken',
129
- symbol: 'CTK',
130
- premint: '2000',
131
- access: 'roles',
132
- burnable: true,
133
- mintable: true,
134
- pausable: true,
135
- snapshots: true,
136
- permit: true,
137
- votes: true,
138
- flashmint: true,
139
- upgradeable: 'uups',
140
- });
141
-
142
- test('erc20 API assert defaults', async t => {
143
- t.is(erc20.print(erc20.defaults), erc20.print());
144
- });
145
-
146
- test('erc20 API isAccessControlRequired', async t => {
147
- t.is(erc20.isAccessControlRequired({ mintable: true }), true);
148
- t.is(erc20.isAccessControlRequired({ pausable: true }), true);
149
- t.is(erc20.isAccessControlRequired({ snapshots: true }), true);
150
- t.is(erc20.isAccessControlRequired({ upgradeable: 'uups' }), true);
151
- t.is(erc20.isAccessControlRequired({ upgradeable: 'transparent' }), false);
152
- });