@openzeppelin/wizard 0.1.0 → 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 (157) hide show
  1. package/README.md +28 -1
  2. package/dist/add-pausable.d.ts.map +1 -1
  3. package/dist/add-pausable.js +2 -2
  4. package/dist/add-pausable.js.map +1 -1
  5. package/dist/api.d.ts +8 -0
  6. package/dist/api.d.ts.map +1 -1
  7. package/dist/api.js +15 -5
  8. package/dist/api.js.map +1 -1
  9. package/dist/build-generic.d.ts +4 -0
  10. package/dist/build-generic.d.ts.map +1 -1
  11. package/dist/build-generic.js +3 -0
  12. package/dist/build-generic.js.map +1 -1
  13. package/dist/common-options.js +2 -2
  14. package/dist/common-options.js.map +1 -1
  15. package/dist/custom.d.ts +11 -0
  16. package/dist/custom.d.ts.map +1 -0
  17. package/dist/custom.js +47 -0
  18. package/dist/custom.js.map +1 -0
  19. package/dist/environments/hardhat/package-lock.json +14913 -0
  20. package/dist/environments/hardhat/package.json +34 -0
  21. package/dist/environments/hardhat/upgradeable/package-lock.json +15333 -0
  22. package/dist/environments/hardhat/upgradeable/package.json +35 -0
  23. package/dist/erc1155.d.ts +2 -0
  24. package/dist/erc1155.d.ts.map +1 -1
  25. package/dist/erc1155.js +16 -7
  26. package/dist/erc1155.js.map +1 -1
  27. package/dist/erc20.d.ts +1 -0
  28. package/dist/erc20.d.ts.map +1 -1
  29. package/dist/erc20.js +8 -3
  30. package/dist/erc20.js.map +1 -1
  31. package/dist/erc721.d.ts +1 -0
  32. package/dist/erc721.d.ts.map +1 -1
  33. package/dist/erc721.js +9 -2
  34. package/dist/erc721.js.map +1 -1
  35. package/dist/generate/custom.d.ts +3 -0
  36. package/dist/generate/custom.d.ts.map +1 -0
  37. package/dist/generate/custom.js +20 -0
  38. package/dist/generate/custom.js.map +1 -0
  39. package/dist/generate/erc1155.d.ts.map +1 -1
  40. package/dist/generate/erc1155.js +1 -0
  41. package/dist/generate/erc1155.js.map +1 -1
  42. package/dist/generate/sources.d.ts.map +1 -1
  43. package/dist/generate/sources.js +5 -1
  44. package/dist/generate/sources.js.map +1 -1
  45. package/dist/governor.d.ts +1 -0
  46. package/dist/governor.d.ts.map +1 -1
  47. package/dist/governor.js +8 -2
  48. package/dist/governor.js.map +1 -1
  49. package/dist/index.d.ts +1 -1
  50. package/dist/index.d.ts.map +1 -1
  51. package/dist/index.js +2 -1
  52. package/dist/index.js.map +1 -1
  53. package/dist/kind.js +1 -0
  54. package/dist/kind.js.map +1 -1
  55. package/dist/print.d.ts.map +1 -1
  56. package/dist/print.js +21 -14
  57. package/dist/print.js.map +1 -1
  58. package/dist/set-access-control.d.ts +9 -2
  59. package/dist/set-access-control.d.ts.map +1 -1
  60. package/dist/set-access-control.js +27 -6
  61. package/dist/set-access-control.js.map +1 -1
  62. package/dist/set-upgradeable.d.ts.map +1 -1
  63. package/dist/set-upgradeable.js +1 -1
  64. package/dist/set-upgradeable.js.map +1 -1
  65. package/dist/solidity-version.json +1 -0
  66. package/dist/test.js +30 -1
  67. package/dist/test.js.map +1 -1
  68. package/dist/utils/format-lines.d.ts +1 -0
  69. package/dist/utils/format-lines.d.ts.map +1 -1
  70. package/dist/utils/format-lines.js +9 -5
  71. package/dist/utils/format-lines.js.map +1 -1
  72. package/dist/zip-hardhat.d.ts +5 -0
  73. package/dist/zip-hardhat.d.ts.map +1 -0
  74. package/dist/zip-hardhat.js +187 -0
  75. package/dist/zip-hardhat.js.map +1 -0
  76. package/dist/zip.js +1 -1
  77. package/dist/zip.js.map +1 -1
  78. package/package.json +8 -6
  79. package/src/add-pausable.ts +3 -3
  80. package/src/api.ts +25 -8
  81. package/src/build-generic.ts +5 -0
  82. package/src/common-options.ts +2 -2
  83. package/src/custom.ts +55 -0
  84. package/src/environments/hardhat/package-lock.json +14913 -0
  85. package/src/environments/hardhat/package.json +34 -0
  86. package/src/environments/hardhat/upgradeable/package-lock.json +15333 -0
  87. package/src/environments/hardhat/upgradeable/package.json +35 -0
  88. package/src/erc1155.ts +17 -7
  89. package/src/erc20.ts +8 -4
  90. package/src/erc721.ts +9 -3
  91. package/src/generate/custom.ts +19 -0
  92. package/src/generate/erc1155.ts +1 -0
  93. package/src/generate/sources.ts +6 -1
  94. package/src/governor.ts +7 -2
  95. package/src/index.ts +1 -1
  96. package/src/kind.ts +1 -0
  97. package/src/print.ts +18 -14
  98. package/src/set-access-control.ts +27 -4
  99. package/src/set-upgradeable.ts +2 -2
  100. package/src/solidity-version.json +1 -0
  101. package/src/test.ts +34 -2
  102. package/src/utils/format-lines.ts +8 -3
  103. package/src/zip-hardhat.ts +186 -0
  104. package/src/zip.ts +1 -1
  105. package/dist/contract.test.d.ts +0 -2
  106. package/dist/contract.test.d.ts.map +0 -1
  107. package/dist/contract.test.js +0 -147
  108. package/dist/contract.test.js.map +0 -1
  109. package/dist/erc1155.test.d.ts +0 -2
  110. package/dist/erc1155.test.d.ts.map +0 -1
  111. package/dist/erc1155.test.js +0 -80
  112. package/dist/erc1155.test.js.map +0 -1
  113. package/dist/erc20.test.d.ts +0 -2
  114. package/dist/erc20.test.d.ts.map +0 -1
  115. package/dist/erc20.test.js +0 -126
  116. package/dist/erc20.test.js.map +0 -1
  117. package/dist/erc721.test.d.ts +0 -2
  118. package/dist/erc721.test.d.ts.map +0 -1
  119. package/dist/erc721.test.js +0 -106
  120. package/dist/erc721.test.js.map +0 -1
  121. package/dist/general.d.ts +0 -8
  122. package/dist/general.d.ts.map +0 -1
  123. package/dist/general.js +0 -22
  124. package/dist/general.js.map +0 -1
  125. package/dist/general.test.d.ts +0 -2
  126. package/dist/general.test.d.ts.map +0 -1
  127. package/dist/general.test.js +0 -42
  128. package/dist/general.test.js.map +0 -1
  129. package/dist/governor.test.d.ts +0 -2
  130. package/dist/governor.test.d.ts.map +0 -1
  131. package/dist/governor.test.js +0 -104
  132. package/dist/governor.test.js.map +0 -1
  133. package/dist/utils/to-identifier.test.d.ts +0 -2
  134. package/dist/utils/to-identifier.test.d.ts.map +0 -1
  135. package/dist/utils/to-identifier.test.js +0 -21
  136. package/dist/utils/to-identifier.test.js.map +0 -1
  137. package/dist/zip.test.d.ts +0 -2
  138. package/dist/zip.test.d.ts.map +0 -1
  139. package/dist/zip.test.js +0 -37
  140. package/dist/zip.test.js.map +0 -1
  141. package/src/contract.test.ts +0 -164
  142. package/src/contract.test.ts.md +0 -272
  143. package/src/contract.test.ts.snap +0 -0
  144. package/src/erc1155.test.ts +0 -90
  145. package/src/erc1155.test.ts.md +0 -416
  146. package/src/erc1155.test.ts.snap +0 -0
  147. package/src/erc20.test.ts +0 -144
  148. package/src/erc20.test.ts.md +0 -571
  149. package/src/erc20.test.ts.snap +0 -0
  150. package/src/erc721.test.ts +0 -122
  151. package/src/erc721.test.ts.md +0 -517
  152. package/src/erc721.test.ts.snap +0 -0
  153. package/src/governor.test.ts +0 -120
  154. package/src/governor.test.ts.md +0 -1419
  155. package/src/governor.test.ts.snap +0 -0
  156. package/src/utils/to-identifier.test.ts +0 -20
  157. package/src/zip.test.ts +0 -35
@@ -1,106 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const ava_1 = __importDefault(require("ava"));
7
- const _1 = require(".");
8
- const erc721_1 = require("./erc721");
9
- const print_1 = require("./print");
10
- function testERC721(title, opts) {
11
- (0, ava_1.default)(title, t => {
12
- const c = (0, erc721_1.buildERC721)({
13
- name: 'MyToken',
14
- symbol: 'MTK',
15
- ...opts,
16
- });
17
- t.snapshot((0, print_1.printContract)(c));
18
- });
19
- }
20
- /**
21
- * Tests external API for equivalence with internal API
22
- */
23
- function testAPIEquivalence(title, opts) {
24
- (0, ava_1.default)(title, t => {
25
- t.is(_1.erc721.print(opts), (0, print_1.printContract)((0, erc721_1.buildERC721)({
26
- name: 'MyToken',
27
- symbol: 'MTK',
28
- ...opts,
29
- })));
30
- });
31
- }
32
- testERC721('basic', {});
33
- testERC721('base uri', {
34
- baseUri: 'https://gateway.pinata.cloud/ipfs/QmcP9hxrnC1T5ATPmq2saFeAM1ypFX9BnAswCdHB9JCjLA/',
35
- });
36
- testERC721('enumerable', {
37
- enumerable: true,
38
- });
39
- testERC721('uri storage', {
40
- uriStorage: true,
41
- });
42
- testERC721('mintable + uri storage', {
43
- mintable: true,
44
- uriStorage: true,
45
- });
46
- testERC721('mintable + uri storage + incremental', {
47
- mintable: true,
48
- uriStorage: true,
49
- incremental: true,
50
- });
51
- testERC721('burnable', {
52
- burnable: true,
53
- });
54
- testERC721('burnable + uri storage', {
55
- uriStorage: true,
56
- burnable: true,
57
- });
58
- testERC721('pausable', {
59
- pausable: true,
60
- });
61
- testERC721('mintable', {
62
- mintable: true,
63
- });
64
- testERC721('mintable + roles', {
65
- mintable: true,
66
- access: 'roles',
67
- });
68
- testERC721('mintable + incremental', {
69
- mintable: true,
70
- incremental: true,
71
- });
72
- testERC721('votes', {
73
- votes: true,
74
- });
75
- testERC721('full upgradeable transparent', {
76
- mintable: true,
77
- enumerable: true,
78
- pausable: true,
79
- burnable: true,
80
- votes: true,
81
- upgradeable: 'transparent',
82
- });
83
- testERC721('full upgradeable uups', {
84
- mintable: true,
85
- enumerable: true,
86
- pausable: true,
87
- burnable: true,
88
- votes: true,
89
- upgradeable: 'uups',
90
- });
91
- testAPIEquivalence('API default');
92
- testAPIEquivalence('API basic', { name: 'CustomToken', symbol: 'CTK' });
93
- testAPIEquivalence('API full upgradeable', {
94
- name: 'CustomToken',
95
- symbol: 'CTK',
96
- mintable: true,
97
- enumerable: true,
98
- pausable: true,
99
- burnable: true,
100
- votes: true,
101
- upgradeable: 'uups',
102
- });
103
- (0, ava_1.default)('API assert defaults', async (t) => {
104
- t.is(_1.erc721.print(_1.erc721.defaults), _1.erc721.print());
105
- });
106
- //# sourceMappingURL=erc721.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"erc721.test.js","sourceRoot":"","sources":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Q,EAAE,IAAI;IACd,UAAU,EAAE,IAAI;IAChB,QAAQ,EAAE,IAAI;IACd,QAAQ,EAAE,IAAI;IACd,KAAK,EAAE,IAAI;IACX,WAAW,EAAE,MAAM;CACpB,CAAC,CAAC;AAEH,IAAA,aAAI,EAAC,qBAAqB,EAAE,KAAK,EAAC,CAAC,EAAC,EAAE;IACpC,CAAC,CAAC,EAAE,CAAC,SAAM,CAAC,KAAK,CAAC,SAAM,CAAC,QAAQ,CAAC,EAAE,SAAM,CAAC,KAAK,EAAE,CAAC,CAAC;AACtD,CAAC,CAAC,CAAC"}
package/dist/general.d.ts DELETED
@@ -1,8 +0,0 @@
1
- import { Contract } from './contract';
2
- import { CommonOptions } from './common-options';
3
- export interface GeneralOptions extends CommonOptions {
4
- name: string;
5
- pausable?: boolean;
6
- }
7
- export declare function buildGeneral(opts: GeneralOptions): Contract;
8
- //# sourceMappingURL=general.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"general.d.ts","sourceRoot":"","sources":["../src/general.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAmB,MAAM,YAAY,CAAC;AACvD,OAAO,EAAE,aAAa,EAAsB,MAAM,kBAAkB,CAAC;AAMrE,MAAM,WAAW,cAAe,SAAQ,aAAa;IACnD,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,cAAc,GAAG,QAAQ,CAc3D"}
package/dist/general.js DELETED
@@ -1,22 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.buildGeneral = void 0;
4
- const contract_1 = require("./contract");
5
- const common_options_1 = require("./common-options");
6
- const set_upgradeable_1 = require("./set-upgradeable");
7
- const set_info_1 = require("./set-info");
8
- const set_access_control_1 = require("./set-access-control");
9
- const add_pausable_1 = require("./add-pausable");
10
- function buildGeneral(opts) {
11
- const c = new contract_1.ContractBuilder(opts.name);
12
- const { access, upgradeable, info } = (0, common_options_1.withCommonDefaults)(opts);
13
- if (opts.pausable) {
14
- (0, add_pausable_1.addPausable)(c, access, []);
15
- }
16
- (0, set_access_control_1.setAccessControlForContract)(c, access);
17
- (0, set_upgradeable_1.setUpgradeable)(c, upgradeable, access);
18
- (0, set_info_1.setInfo)(c, info);
19
- return c;
20
- }
21
- exports.buildGeneral = buildGeneral;
22
- //# sourceMappingURL=general.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"general.js","sourceRoot":"","sources":["../src/general.ts"],"names":[],"mappings":";;;AAAA,yCAAuD;AACvD,qDAAqE;AACrE,uDAAmD;AACnD,yCAAqC;AACrC,6DAAmE;AACnE,iDAA6C;AAO7C,SAAgB,YAAY,CAAC,IAAoB;IAC/C,MAAM,CAAC,GAAG,IAAI,0BAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAEzC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,GAAG,IAAA,mCAAkB,EAAC,IAAI,CAAC,CAAC;IAE/D,IAAI,IAAI,CAAC,QAAQ,EAAE;QACjB,IAAA,0BAAW,EAAC,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC,CAAC;KAC5B;IAED,IAAA,gDAA2B,EAAC,CAAC,EAAE,MAAM,CAAC,CAAC;IACvC,IAAA,gCAAc,EAAC,CAAC,EAAE,WAAW,EAAE,MAAM,CAAC,CAAC;IACvC,IAAA,kBAAO,EAAC,CAAC,EAAE,IAAI,CAAC,CAAC;IAEjB,OAAO,CAAC,CAAC;AACX,CAAC;AAdD,oCAcC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=general.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"general.test.d.ts","sourceRoot":"","sources":["../src/general.test.ts"],"names":[],"mappings":""}
@@ -1,42 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const ava_1 = __importDefault(require("ava"));
7
- const general_1 = require("./general");
8
- const print_1 = require("./print");
9
- function testGeneral(title, opts) {
10
- (0, ava_1.default)(title, t => {
11
- const c = (0, general_1.buildGeneral)({
12
- name: 'MyContract',
13
- ...opts,
14
- });
15
- t.snapshot((0, print_1.printContract)(c));
16
- });
17
- }
18
- testGeneral('general', {});
19
- testGeneral('pausable', {
20
- pausable: true,
21
- });
22
- testGeneral('upgradeable transparent', {
23
- upgradeable: 'transparent',
24
- });
25
- testGeneral('upgradeable uups', {
26
- upgradeable: 'uups',
27
- });
28
- testGeneral('access control disabled', {
29
- access: false,
30
- });
31
- testGeneral('access control ownable', {
32
- access: 'ownable',
33
- });
34
- testGeneral('access control roles', {
35
- access: 'roles',
36
- });
37
- testGeneral('upgradeable uups with access control disabled', {
38
- // API should override access to true since it is required for UUPS
39
- access: false,
40
- upgradeable: 'uups',
41
- });
42
- //# sourceMappingURL=general.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"general.test.js","sourceRoot":"","sources":["../src/general.test.ts"],"names":[],"mappings":";;;;;AAAA,8CAAuB;AAGvB,uCAAyD;AACzD,mCAAwC;AAExC,SAAS,WAAW,CAAC,KAAa,EAAE,IAA6B;IAC/D,IAAA,aAAI,EAAC,KAAK,EAAE,CAAC,CAAC,EAAE;QACd,MAAM,CAAC,GAAG,IAAA,sBAAY,EAAC;YACrB,IAAI,EAAE,YAAY;YAClB,GAAG,IAAI;SACR,CAAC,CAAC;QACH,CAAC,CAAC,QAAQ,CAAC,IAAA,qBAAa,EAAC,CAAC,CAAC,CAAC,CAAC;IAC/B,CAAC,CAAC,CAAC;AACL,CAAC;AAED,WAAW,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;AAE3B,WAAW,CAAC,UAAU,EAAE;IACtB,QAAQ,EAAE,IAAI;CACf,CAAC,CAAC;AAEH,WAAW,CAAC,yBAAyB,EAAE;IACrC,WAAW,EAAE,aAAa;CAC3B,CAAC,CAAC;AAEH,WAAW,CAAC,kBAAkB,EAAE;IAC9B,WAAW,EAAE,MAAM;CACpB,CAAC,CAAC;AAEH,WAAW,CAAC,yBAAyB,EAAE;IACrC,MAAM,EAAE,KAAK;CACd,CAAC,CAAC;AAEH,WAAW,CAAC,wBAAwB,EAAE;IACpC,MAAM,EAAE,SAAS;CAClB,CAAC,CAAC;AAEH,WAAW,CAAC,sBAAsB,EAAE;IAClC,MAAM,EAAE,OAAO;CAChB,CAAC,CAAC;AAEH,WAAW,CAAC,+CAA+C,EAAE;IAC3D,mEAAmE;IACnE,MAAM,EAAE,KAAK;IACb,WAAW,EAAE,MAAM;CACpB,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=governor.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"governor.test.d.ts","sourceRoot":"","sources":["../src/governor.test.ts"],"names":[],"mappings":""}
@@ -1,104 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const ava_1 = __importDefault(require("ava"));
7
- const _1 = require(".");
8
- const governor_1 = require("./governor");
9
- const print_1 = require("./print");
10
- function testGovernor(title, opts) {
11
- (0, ava_1.default)(title, t => {
12
- const c = (0, governor_1.buildGovernor)({
13
- name: 'MyGovernor',
14
- delay: '1 week',
15
- period: '1 week',
16
- settings: false,
17
- ...opts,
18
- });
19
- t.snapshot((0, print_1.printContract)(c));
20
- });
21
- }
22
- /**
23
- * Tests external API for equivalence with internal API
24
- */
25
- function testAPIEquivalence(title, opts) {
26
- (0, ava_1.default)(title, t => {
27
- t.is(_1.governor.print(opts), (0, print_1.printContract)((0, governor_1.buildGovernor)({
28
- name: 'MyGovernor',
29
- delay: '1 block',
30
- period: '1 week',
31
- ...opts,
32
- })));
33
- });
34
- }
35
- testGovernor('governor with proposal threshold', {
36
- proposalThreshold: '1',
37
- });
38
- testGovernor('governor with custom block time', {
39
- blockTime: 6,
40
- });
41
- testGovernor('governor with custom decimals', {
42
- decimals: 6,
43
- proposalThreshold: '1',
44
- quorumMode: 'absolute',
45
- quorumAbsolute: '1',
46
- });
47
- testGovernor('governor with 0 decimals', {
48
- decimals: 0,
49
- proposalThreshold: '1',
50
- quorumMode: 'absolute',
51
- quorumAbsolute: '1',
52
- });
53
- testGovernor('governor with settings', {
54
- settings: true,
55
- proposalThreshold: '1',
56
- });
57
- testGovernor('governor with bravo', {
58
- bravo: true,
59
- });
60
- testGovernor('governor with erc20votes', {
61
- votes: 'erc20votes',
62
- });
63
- testGovernor('governor with erc721votes', {
64
- votes: 'erc721votes',
65
- });
66
- testGovernor('governor with erc721votes omit decimals', {
67
- votes: 'erc721votes',
68
- decimals: 6,
69
- proposalThreshold: '1',
70
- quorumMode: 'absolute',
71
- quorumAbsolute: '5',
72
- });
73
- testGovernor('governor with erc721votes settings omit decimals', {
74
- votes: 'erc721votes',
75
- decimals: 6,
76
- proposalThreshold: '10',
77
- settings: true,
78
- });
79
- testGovernor('governor with comp', {
80
- votes: 'comp',
81
- quorumMode: 'absolute',
82
- quorumAbsolute: '1',
83
- });
84
- testGovernor('governor with percent quorum', {
85
- quorumMode: 'percent',
86
- quorumPercent: 6,
87
- });
88
- testGovernor('governor with fractional percent quorum', {
89
- quorumMode: 'percent',
90
- quorumPercent: 0.5,
91
- });
92
- testGovernor('governor with openzeppelin timelock', {
93
- timelock: 'openzeppelin',
94
- });
95
- testGovernor('governor with compound timelock', {
96
- timelock: 'compound',
97
- });
98
- testAPIEquivalence('API default');
99
- testAPIEquivalence('API basic', { name: 'CustomGovernor', delay: '2 weeks', period: '2 week' });
100
- testAPIEquivalence('API basic upgradeable', { name: 'CustomGovernor', delay: '2 weeks', period: '2 week', upgradeable: 'uups' });
101
- (0, ava_1.default)('API assert defaults', async (t) => {
102
- t.is(_1.governor.print(_1.governor.defaults), _1.governor.print());
103
- });
104
- //# sourceMappingURL=governor.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"governor.test.js","sourceRoot":"","sources":["../src/governor.test.ts"],"names":[],"mappings":";;;;;AAAA,8CAAuB;AACvB,wBAA6B;AAE7B,yCAA4D;AAC5D,mCAAwC;AAExC,SAAS,YAAY,CAAC,KAAa,EAAE,IAA8B;IACjE,IAAA,aAAI,EAAC,KAAK,EAAE,CAAC,CAAC,EAAE;QACd,MAAM,CAAC,GAAG,IAAA,wBAAa,EAAC;YACtB,IAAI,EAAE,YAAY;YAClB,KAAK,EAAE,QAAQ;YACf,MAAM,EAAE,QAAQ;YAChB,QAAQ,EAAE,KAAK;YACf,GAAG,IAAI;SACR,CAAC,CAAC;QACH,CAAC,CAAC,QAAQ,CAAC,IAAA,qBAAa,EAAC,CAAC,CAAC,CAAC,CAAC;IAC/B,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;GAEG;AACF,SAAS,kBAAkB,CAAC,KAAa,EAAE,IAAsB;IAChE,IAAA,aAAI,EAAC,KAAK,EAAE,CAAC,CAAC,EAAE;QACd,CAAC,CAAC,EAAE,CAAC,WAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,IAAA,qBAAa,EAAC,IAAA,wBAAa,EAAC;YACrD,IAAI,EAAE,YAAY;YAClB,KAAK,EAAE,SAAS;YAChB,MAAM,EAAE,QAAQ;YAChB,GAAG,IAAI;SACR,CAAC,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACL,CAAC;AAED,YAAY,CAAC,kCAAkC,EAAE;IAC/C,iBAAiB,EAAE,GAAG;CACvB,CAAC,CAAC;AAEH,YAAY,CAAC,iCAAiC,EAAE;IAC9C,SAAS,EAAE,CAAC;CACb,CAAC,CAAC;AAEH,YAAY,CAAC,+BAA+B,EAAE;IAC5C,QAAQ,EAAE,CAAC;IACX,iBAAiB,EAAE,GAAG;IACtB,UAAU,EAAE,UAAU;IACtB,cAAc,EAAE,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AC,iCAAiC,EAAE;IAC9C,QAAQ,EAAE,UAAU;CACrB,CAAC,CAAC;AAEH,kBAAkB,CAAC,aAAa,CAAC,CAAC;AAElC,kBAAkB,CAAC,WAAW,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC;AAEhG,kBAAkB,CAAC,uBAAuB,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,EAAE,CAAC,CAAC;AAEjI,IAAA,aAAI,EAAC,qBAAqB,EAAE,KAAK,EAAC,CAAC,EAAC,EAAE;IACpC,CAAC,CAAC,EAAE,CAAC,WAAQ,CAAC,KAAK,CAAC,WAAQ,CAAC,QAAQ,CAAC,EAAE,WAAQ,CAAC,KAAK,EAAE,CAAC,CAAC;AAC5D,CAAC,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=to-identifier.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"to-identifier.test.d.ts","sourceRoot":"","sources":["../../src/utils/to-identifier.test.ts"],"names":[],"mappings":""}
@@ -1,21 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const ava_1 = __importDefault(require("ava"));
7
- const to_identifier_1 = require("./to-identifier");
8
- (0, ava_1.default)('unmodified', t => {
9
- t.is((0, to_identifier_1.toIdentifier)('abc'), 'abc');
10
- });
11
- (0, ava_1.default)('remove leading specials', t => {
12
- t.is((0, to_identifier_1.toIdentifier)('--abc'), 'abc');
13
- });
14
- (0, ava_1.default)('remove specials and upcase next char', t => {
15
- t.is((0, to_identifier_1.toIdentifier)('abc-def'), 'abcDef');
16
- t.is((0, to_identifier_1.toIdentifier)('abc--def'), 'abcDef');
17
- });
18
- (0, ava_1.default)('capitalize', t => {
19
- t.is((0, to_identifier_1.toIdentifier)('abc', true), 'Abc');
20
- });
21
- //# sourceMappingURL=to-identifier.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"to-identifier.test.js","sourceRoot":"","sources":["../../src/utils/to-identifier.test.ts"],"names":[],"mappings":";;;;;AAAA,8CAAuB;AAEvB,mDAA+C;AAE/C,IAAA,aAAI,EAAC,YAAY,EAAE,CAAC,CAAC,EAAE;IACrB,CAAC,CAAC,EAAE,CAAC,IAAA,4BAAY,EAAC,KAAK,CAAC,EAAE,KAAK,CAAC,CAAC;AACnC,CAAC,CAAC,CAAC;AAEH,IAAA,aAAI,EAAC,yBAAyB,EAAE,CAAC,CAAC,EAAE;IAClC,CAAC,CAAC,EAAE,CAAC,IAAA,4BAAY,EAAC,OAAO,CAAC,EAAE,KAAK,CAAC,CAAC;AACrC,CAAC,CAAC,CAAC;AAEH,IAAA,aAAI,EAAC,sCAAsC,EAAE,CAAC,CAAC,EAAE;IAC/C,CAAC,CAAC,EAAE,CAAC,IAAA,4BAAY,EAAC,SAAS,CAAC,EAAE,QAAQ,CAAC,CAAC;IACxC,CAAC,CAAC,EAAE,CAAC,IAAA,4BAAY,EAAC,UAAU,CAAC,EAAE,QAAQ,CAAC,CAAC;AAC3C,CAAC,CAAC,CAAC;AAEH,IAAA,aAAI,EAAC,YAAY,EAAE,CAAC,CAAC,EAAE;IACrB,CAAC,CAAC,EAAE,CAAC,IAAA,4BAAY,EAAC,KAAK,EAAE,IAAI,CAAC,EAAE,KAAK,CAAC,CAAC;AACzC,CAAC,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=zip.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"zip.test.d.ts","sourceRoot":"","sources":["../src/zip.test.ts"],"names":[],"mappings":""}
package/dist/zip.test.js DELETED
@@ -1,37 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const ava_1 = __importDefault(require("ava"));
7
- const zip_1 = require("./zip");
8
- const erc20_1 = require("./erc20");
9
- const sources_1 = require("./generate/sources");
10
- const build_generic_1 = require("./build-generic");
11
- (0, ava_1.default)('erc20 basic', t => {
12
- const c = (0, erc20_1.buildERC20)({ name: 'MyToken', symbol: 'MTK' });
13
- const zip = (0, zip_1.zipContract)(c);
14
- const files = Object.values(zip.files).map(f => f.name).sort();
15
- t.deepEqual(files, [
16
- '@openzeppelin/',
17
- '@openzeppelin/contracts/',
18
- '@openzeppelin/contracts/README.md',
19
- '@openzeppelin/contracts/token/',
20
- '@openzeppelin/contracts/token/ERC20/',
21
- '@openzeppelin/contracts/token/ERC20/ERC20.sol',
22
- '@openzeppelin/contracts/token/ERC20/IERC20.sol',
23
- '@openzeppelin/contracts/token/ERC20/extensions/',
24
- '@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol',
25
- '@openzeppelin/contracts/utils/',
26
- '@openzeppelin/contracts/utils/Context.sol',
27
- 'MyToken.sol',
28
- ]);
29
- });
30
- (0, ava_1.default)('can zip all combinations', t => {
31
- for (const { options } of (0, sources_1.generateSources)('all')) {
32
- const c = (0, build_generic_1.buildGeneric)(options);
33
- (0, zip_1.zipContract)(c);
34
- }
35
- t.pass();
36
- });
37
- //# sourceMappingURL=zip.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"zip.test.js","sourceRoot":"","sources":["../src/zip.test.ts"],"names":[],"mappings":";;;;;AAAA,8CAAuB;AAEvB,+BAAoC;AACpC,mCAAqC;AACrC,gDAAqD;AACrD,mDAA+C;AAE/C,IAAA,aAAI,EAAC,aAAa,EAAE,CAAC,CAAC,EAAE;IACtB,MAAM,CAAC,GAAG,IAAA,kBAAU,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC;IACzD,MAAM,GAAG,GAAG,IAAA,iBAAW,EAAC,CAAC,CAAC,CAAC;IAC3B,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC;IAE/D,CAAC,CAAC,SAAS,CAAC,KAAK,EAAE;QACjB,gBAAgB;QAChB,0BAA0B;QAC1B,mCAAmC;QACnC,gCAAgC;QAChC,sCAAsC;QACtC,+CAA+C;QAC/C,gDAAgD;QAChD,iDAAiD;QACjD,mEAAmE;QACnE,gCAAgC;QAChC,2CAA2C;QAC3C,aAAa;KACd,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,IAAA,aAAI,EAAC,0BAA0B,EAAE,CAAC,CAAC,EAAE;IACnC,KAAK,MAAM,EAAE,OAAO,EAAE,IAAI,IAAA,yBAAe,EAAC,KAAK,CAAC,EAAE;QAChD,MAAM,CAAC,GAAG,IAAA,4BAAY,EAAC,OAAO,CAAC,CAAC;QAChC,IAAA,iBAAW,EAAC,CAAC,CAAC,CAAC;KAChB;IACD,CAAC,CAAC,IAAI,EAAE,CAAC;AACX,CAAC,CAAC,CAAC"}
@@ -1,164 +0,0 @@
1
- import test from 'ava';
2
-
3
- import { ContractBuilder } from './contract';
4
- import { printContract } from './print';
5
- import { TAG_SECURITY_CONTACT } from './set-info';
6
-
7
- test('contract basics', t => {
8
- const Foo = new ContractBuilder('Foo');
9
- t.snapshot(printContract(Foo));
10
- });
11
-
12
- test('contract with a parent', t => {
13
- const Foo = new ContractBuilder('Foo');
14
- const Bar = { name: 'Bar', path: './Bar.sol' };
15
- Foo.addParent(Bar);
16
- t.snapshot(printContract(Foo));
17
- });
18
-
19
- test('contract with two parents', t => {
20
- const Foo = new ContractBuilder('Foo');
21
- const Bar = { name: 'Bar', path: './Bar.sol' };
22
- const Quux = { name: 'Quux', path: './Quux.sol' };
23
- Foo.addParent(Bar);
24
- Foo.addParent(Quux);
25
- t.snapshot(printContract(Foo));
26
- });
27
-
28
- test('contract with a parent with parameters', t => {
29
- const Foo = new ContractBuilder('Foo');
30
- const Bar = { name: 'Bar', path: './Bar.sol' };
31
- Foo.addParent(Bar, ["param1", "param2"]);
32
- t.snapshot(printContract(Foo));
33
- });
34
-
35
- test('contract with two parents only one with parameters', t => {
36
- const Foo = new ContractBuilder('Foo');
37
- const Bar = { name: 'Bar', path: './Bar.sol' };
38
- const Quux = { name: 'Quux', path: './Quux.sol' };
39
- Foo.addParent(Bar, ["param1", "param2"]);
40
- Foo.addParent(Quux);
41
- t.snapshot(printContract(Foo));
42
- });
43
-
44
- test('contract with one override', t => {
45
- const Foo = new ContractBuilder('Foo');
46
- const _beforeTokenTransfer = {
47
- name: '_beforeTokenTransfer',
48
- kind: 'internal' as const,
49
- args: [
50
- { name: 'from', type: 'address' },
51
- { name: 'to', type: 'address' },
52
- { name: 'amount', type: 'uint256' },
53
- ],
54
- };
55
- Foo.addOverride('ERC20', _beforeTokenTransfer);
56
- t.snapshot(printContract(Foo));
57
- });
58
-
59
- test('contract with two overrides', t => {
60
- const Foo = new ContractBuilder('Foo');
61
- Foo.addOverride('ERC20', _beforeTokenTransfer);
62
- Foo.addOverride('ERC20Snapshot', _beforeTokenTransfer);
63
- t.snapshot(printContract(Foo));
64
- });
65
-
66
- test('contract with two different overrides', t => {
67
- const Foo = new ContractBuilder('Foo');
68
- Foo.addOverride('ERC20', _beforeTokenTransfer);
69
- Foo.addOverride('OtherParent', _beforeTokenTransfer);
70
- Foo.addOverride('ERC20', _otherFunction);
71
- Foo.addOverride('OtherParent', _otherFunction);
72
- t.snapshot(printContract(Foo));
73
- });
74
-
75
- test('contract with a modifier', t => {
76
- const Foo = new ContractBuilder('Foo');
77
- Foo.addModifier('whenNotPaused', _otherFunction);
78
- t.snapshot(printContract(Foo));
79
- });
80
-
81
- test('contract with a modifier and override', t => {
82
- const Foo = new ContractBuilder('Foo');
83
- Foo.addModifier('whenNotPaused', _otherFunction);
84
- Foo.addOverride('ERC20', _otherFunction);
85
- Foo.addOverride('OtherParent', _otherFunction);
86
- t.snapshot(printContract(Foo));
87
- });
88
-
89
- test('contract with constructor code', t => {
90
- const Foo = new ContractBuilder('Foo');
91
- Foo.addConstructorCode('_mint(msg.sender, 10 ether);');
92
- t.snapshot(printContract(Foo));
93
- });
94
-
95
- test('contract with constructor code and a parent', t => {
96
- const Foo = new ContractBuilder('Foo');
97
- const Bar = { name: 'Bar', path: './Bar.sol' };
98
- Foo.addParent(Bar, ["param1", "param2"]);
99
- Foo.addConstructorCode('_mint(msg.sender, 10 ether);');
100
- t.snapshot(printContract(Foo));
101
- });
102
-
103
- test('contract with function code', t => {
104
- const Foo = new ContractBuilder('Foo');
105
- Foo.addFunctionCode('_mint(msg.sender, 10 ether);', _otherFunction);
106
- t.snapshot(printContract(Foo));
107
- });
108
-
109
- test('contract with overriden function with code', t => {
110
- const Foo = new ContractBuilder('Foo');
111
- Foo.addOverride('Bar', _otherFunction);
112
- Foo.addFunctionCode('_mint(msg.sender, 10 ether);', _otherFunction);
113
- t.snapshot(printContract(Foo));
114
- });
115
-
116
- test('contract with one variable', t => {
117
- const Foo = new ContractBuilder('Foo');
118
- Foo.addVariable('uint value = 42;');
119
- t.snapshot(printContract(Foo));
120
- });
121
-
122
- test('contract with two variables', t => {
123
- const Foo = new ContractBuilder('Foo');
124
- Foo.addVariable('uint value = 42;');
125
- Foo.addVariable('string name = "john";');
126
- t.snapshot(printContract(Foo));
127
- });
128
-
129
- test('name with special characters', t => {
130
- const Foo = new ContractBuilder('foo bar baz');
131
- t.snapshot(printContract(Foo));
132
- });
133
-
134
- test('using for statement', t => {
135
- const Foo = new ContractBuilder('Foo');
136
- Foo.addUsing({
137
- name: 'Counters',
138
- path: './Counters.sol',
139
- }, 'Counters.Counter');
140
- t.snapshot(printContract(Foo));
141
- });
142
-
143
- test('contract with info', t => {
144
- const Foo = new ContractBuilder('Foo');
145
- Foo.addNatspecTag(TAG_SECURITY_CONTACT, 'security@example.com');
146
- t.snapshot(printContract(Foo));
147
- });
148
-
149
-
150
- const _beforeTokenTransfer = {
151
- name: '_beforeTokenTransfer',
152
- kind: 'internal' as const,
153
- args: [
154
- { name: 'from', type: 'address' },
155
- { name: 'to', type: 'address' },
156
- { name: 'amount', type: 'uint256' },
157
- ],
158
- };
159
-
160
- const _otherFunction = {
161
- name: '_otherFunction',
162
- kind: 'internal' as const,
163
- args: [],
164
- };