create-microact-app 1.0.1 → 1.0.2
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.
- package/package.json +1 -1
- package/templates/vanilla/package.json +1 -1
- package/templates/vanilla/src/components/App.js +22 -35
- package/templates/vanilla/src/components/Card.js +5 -12
- package/templates/vanilla/src/components/Hero.js +6 -8
- package/templates/vanilla/src/components/InteractiveDemo.js +34 -32
- package/templates/vanilla/src/main.js +2 -6
- package/templates/web3/contracts/.gitmodules +3 -0
- package/templates/web3/contracts/foundry.lock +8 -0
- package/templates/web3/contracts/lib/forge-std/.gitattributes +1 -0
- package/templates/web3/contracts/lib/forge-std/.github/CODEOWNERS +1 -0
- package/templates/web3/contracts/lib/forge-std/.github/dependabot.yml +6 -0
- package/templates/web3/contracts/lib/forge-std/.github/workflows/ci.yml +125 -0
- package/templates/web3/contracts/lib/forge-std/.github/workflows/sync.yml +36 -0
- package/templates/web3/contracts/lib/forge-std/CONTRIBUTING.md +193 -0
- package/templates/web3/contracts/lib/forge-std/LICENSE-APACHE +203 -0
- package/templates/web3/contracts/lib/forge-std/LICENSE-MIT +25 -0
- package/templates/web3/contracts/lib/forge-std/README.md +268 -0
- package/templates/web3/contracts/lib/forge-std/RELEASE_CHECKLIST.md +12 -0
- package/templates/web3/contracts/lib/forge-std/foundry.toml +18 -0
- package/templates/web3/contracts/lib/forge-std/package.json +16 -0
- package/templates/web3/contracts/lib/forge-std/scripts/vm.py +636 -0
- package/templates/web3/contracts/lib/forge-std/src/Base.sol +48 -0
- package/templates/web3/contracts/lib/forge-std/src/Config.sol +60 -0
- package/templates/web3/contracts/lib/forge-std/src/LibVariable.sol +477 -0
- package/templates/web3/contracts/lib/forge-std/src/Script.sol +28 -0
- package/templates/web3/contracts/lib/forge-std/src/StdAssertions.sol +779 -0
- package/templates/web3/contracts/lib/forge-std/src/StdChains.sol +295 -0
- package/templates/web3/contracts/lib/forge-std/src/StdCheats.sol +825 -0
- package/templates/web3/contracts/lib/forge-std/src/StdConfig.sol +632 -0
- package/templates/web3/contracts/lib/forge-std/src/StdConstants.sol +30 -0
- package/templates/web3/contracts/lib/forge-std/src/StdError.sol +15 -0
- package/templates/web3/contracts/lib/forge-std/src/StdInvariant.sol +120 -0
- package/templates/web3/contracts/lib/forge-std/src/StdJson.sol +275 -0
- package/templates/web3/contracts/lib/forge-std/src/StdMath.sol +47 -0
- package/templates/web3/contracts/lib/forge-std/src/StdStorage.sol +475 -0
- package/templates/web3/contracts/lib/forge-std/src/StdStyle.sol +333 -0
- package/templates/web3/contracts/lib/forge-std/src/StdToml.sol +275 -0
- package/templates/web3/contracts/lib/forge-std/src/StdUtils.sol +200 -0
- package/templates/web3/contracts/lib/forge-std/src/Test.sol +32 -0
- package/templates/web3/contracts/lib/forge-std/src/Vm.sol +2500 -0
- package/templates/web3/contracts/lib/forge-std/src/console.sol +1551 -0
- package/templates/web3/contracts/lib/forge-std/src/console2.sol +4 -0
- package/templates/web3/contracts/lib/forge-std/src/interfaces/IERC1155.sol +105 -0
- package/templates/web3/contracts/lib/forge-std/src/interfaces/IERC165.sol +12 -0
- package/templates/web3/contracts/lib/forge-std/src/interfaces/IERC20.sol +43 -0
- package/templates/web3/contracts/lib/forge-std/src/interfaces/IERC4626.sol +190 -0
- package/templates/web3/contracts/lib/forge-std/src/interfaces/IERC6909.sol +72 -0
- package/templates/web3/contracts/lib/forge-std/src/interfaces/IERC721.sol +164 -0
- package/templates/web3/contracts/lib/forge-std/src/interfaces/IERC7540.sol +144 -0
- package/templates/web3/contracts/lib/forge-std/src/interfaces/IERC7575.sol +241 -0
- package/templates/web3/contracts/lib/forge-std/src/interfaces/IMulticall3.sol +68 -0
- package/templates/web3/contracts/lib/forge-std/src/safeconsole.sol +13248 -0
- package/templates/web3/contracts/lib/forge-std/test/CommonBase.t.sol +44 -0
- package/templates/web3/contracts/lib/forge-std/test/Config.t.sol +381 -0
- package/templates/web3/contracts/lib/forge-std/test/LibVariable.t.sol +452 -0
- package/templates/web3/contracts/lib/forge-std/test/StdAssertions.t.sol +141 -0
- package/templates/web3/contracts/lib/forge-std/test/StdChains.t.sol +227 -0
- package/templates/web3/contracts/lib/forge-std/test/StdCheats.t.sol +638 -0
- package/templates/web3/contracts/lib/forge-std/test/StdConstants.t.sol +38 -0
- package/templates/web3/contracts/lib/forge-std/test/StdError.t.sol +119 -0
- package/templates/web3/contracts/lib/forge-std/test/StdJson.t.sol +49 -0
- package/templates/web3/contracts/lib/forge-std/test/StdMath.t.sol +202 -0
- package/templates/web3/contracts/lib/forge-std/test/StdStorage.t.sol +485 -0
- package/templates/web3/contracts/lib/forge-std/test/StdStyle.t.sol +110 -0
- package/templates/web3/contracts/lib/forge-std/test/StdToml.t.sol +49 -0
- package/templates/web3/contracts/lib/forge-std/test/StdUtils.t.sol +342 -0
- package/templates/web3/contracts/lib/forge-std/test/Vm.t.sol +18 -0
- package/templates/web3/contracts/lib/forge-std/test/compilation/CompilationScript.sol +8 -0
- package/templates/web3/contracts/lib/forge-std/test/compilation/CompilationScriptBase.sol +8 -0
- package/templates/web3/contracts/lib/forge-std/test/compilation/CompilationTest.sol +8 -0
- package/templates/web3/contracts/lib/forge-std/test/compilation/CompilationTestBase.sol +8 -0
- package/templates/web3/contracts/lib/forge-std/test/fixtures/broadcast.log.json +187 -0
- package/templates/web3/contracts/lib/forge-std/test/fixtures/config.toml +81 -0
- package/templates/web3/contracts/lib/forge-std/test/fixtures/test.json +8 -0
- package/templates/web3/contracts/lib/forge-std/test/fixtures/test.toml +6 -0
- package/templates/web3/package.json +1 -1
- package/templates/web3/src/components/App.js +23 -36
- package/templates/web3/src/components/CounterCard.js +45 -45
- package/templates/web3/src/main.js +5 -7
- package/templates/vanilla/node_modules/.package-lock.json +0 -207
- package/templates/vanilla/node_modules/@esbuild/darwin-x64/README.md +0 -3
- package/templates/vanilla/node_modules/@esbuild/darwin-x64/bin/esbuild +0 -0
- package/templates/vanilla/node_modules/@esbuild/darwin-x64/package.json +0 -17
- package/templates/vanilla/node_modules/@monygroupcorp/microact/README.md +0 -154
- package/templates/vanilla/node_modules/@monygroupcorp/microact/dist/microact.cjs.js +0 -1749
- package/templates/vanilla/node_modules/@monygroupcorp/microact/dist/microact.cjs.js.map +0 -1
- package/templates/vanilla/node_modules/@monygroupcorp/microact/dist/microact.esm.js +0 -1743
- package/templates/vanilla/node_modules/@monygroupcorp/microact/dist/microact.esm.js.map +0 -1
- package/templates/vanilla/node_modules/@monygroupcorp/microact/dist/microact.umd.js +0 -2
- package/templates/vanilla/node_modules/@monygroupcorp/microact/dist/microact.umd.js.map +0 -1
- package/templates/vanilla/node_modules/@monygroupcorp/microact/example/index.html +0 -13
- package/templates/vanilla/node_modules/@monygroupcorp/microact/example/index.js +0 -63
- package/templates/vanilla/node_modules/@monygroupcorp/microact/package.json +0 -38
- package/templates/vanilla/node_modules/@monygroupcorp/microact/rollup.config.cjs +0 -30
- package/templates/vanilla/node_modules/@monygroupcorp/microact/src/Component.js +0 -831
- package/templates/vanilla/node_modules/@monygroupcorp/microact/src/DOMUpdater.js +0 -320
- package/templates/vanilla/node_modules/@monygroupcorp/microact/src/EventBus.js +0 -123
- package/templates/vanilla/node_modules/@monygroupcorp/microact/src/Router.js +0 -253
- package/templates/vanilla/node_modules/@monygroupcorp/microact/src/UpdateScheduler.js +0 -218
- package/templates/vanilla/node_modules/@monygroupcorp/microact/src/index.js +0 -6
- package/templates/vanilla/node_modules/esbuild/LICENSE.md +0 -21
- package/templates/vanilla/node_modules/esbuild/README.md +0 -3
- package/templates/vanilla/node_modules/esbuild/bin/esbuild +0 -0
- package/templates/vanilla/node_modules/esbuild/install.js +0 -287
- package/templates/vanilla/node_modules/esbuild/lib/main.d.ts +0 -660
- package/templates/vanilla/node_modules/esbuild/lib/main.js +0 -2393
- package/templates/vanilla/node_modules/esbuild/package.json +0 -42
- package/templates/vanilla/node_modules/nanoid/LICENSE +0 -20
- package/templates/vanilla/node_modules/nanoid/README.md +0 -39
- package/templates/vanilla/node_modules/nanoid/async/index.browser.cjs +0 -69
- package/templates/vanilla/node_modules/nanoid/async/index.browser.js +0 -34
- package/templates/vanilla/node_modules/nanoid/async/index.cjs +0 -71
- package/templates/vanilla/node_modules/nanoid/async/index.d.ts +0 -56
- package/templates/vanilla/node_modules/nanoid/async/index.js +0 -35
- package/templates/vanilla/node_modules/nanoid/async/index.native.js +0 -26
- package/templates/vanilla/node_modules/nanoid/async/package.json +0 -12
- package/templates/vanilla/node_modules/nanoid/bin/nanoid.cjs +0 -55
- package/templates/vanilla/node_modules/nanoid/index.browser.cjs +0 -72
- package/templates/vanilla/node_modules/nanoid/index.browser.js +0 -34
- package/templates/vanilla/node_modules/nanoid/index.cjs +0 -85
- package/templates/vanilla/node_modules/nanoid/index.d.cts +0 -91
- package/templates/vanilla/node_modules/nanoid/index.d.ts +0 -91
- package/templates/vanilla/node_modules/nanoid/index.js +0 -45
- package/templates/vanilla/node_modules/nanoid/nanoid.js +0 -1
- package/templates/vanilla/node_modules/nanoid/non-secure/index.cjs +0 -34
- package/templates/vanilla/node_modules/nanoid/non-secure/index.d.ts +0 -33
- package/templates/vanilla/node_modules/nanoid/non-secure/index.js +0 -21
- package/templates/vanilla/node_modules/nanoid/non-secure/package.json +0 -6
- package/templates/vanilla/node_modules/nanoid/package.json +0 -89
- package/templates/vanilla/node_modules/nanoid/url-alphabet/index.cjs +0 -7
- package/templates/vanilla/node_modules/nanoid/url-alphabet/index.js +0 -3
- package/templates/vanilla/node_modules/nanoid/url-alphabet/package.json +0 -6
- package/templates/vanilla/node_modules/picocolors/LICENSE +0 -15
- package/templates/vanilla/node_modules/picocolors/README.md +0 -21
- package/templates/vanilla/node_modules/picocolors/package.json +0 -25
- package/templates/vanilla/node_modules/picocolors/picocolors.browser.js +0 -4
- package/templates/vanilla/node_modules/picocolors/picocolors.d.ts +0 -5
- package/templates/vanilla/node_modules/picocolors/picocolors.js +0 -75
- package/templates/vanilla/node_modules/picocolors/types.d.ts +0 -51
- package/templates/vanilla/node_modules/postcss/LICENSE +0 -20
- package/templates/vanilla/node_modules/postcss/README.md +0 -29
- package/templates/vanilla/node_modules/postcss/lib/at-rule.d.ts +0 -140
- package/templates/vanilla/node_modules/postcss/lib/at-rule.js +0 -25
- package/templates/vanilla/node_modules/postcss/lib/comment.d.ts +0 -68
- package/templates/vanilla/node_modules/postcss/lib/comment.js +0 -13
- package/templates/vanilla/node_modules/postcss/lib/container.d.ts +0 -483
- package/templates/vanilla/node_modules/postcss/lib/container.js +0 -447
- package/templates/vanilla/node_modules/postcss/lib/css-syntax-error.d.ts +0 -248
- package/templates/vanilla/node_modules/postcss/lib/css-syntax-error.js +0 -133
- package/templates/vanilla/node_modules/postcss/lib/declaration.d.ts +0 -151
- package/templates/vanilla/node_modules/postcss/lib/declaration.js +0 -24
- package/templates/vanilla/node_modules/postcss/lib/document.d.ts +0 -69
- package/templates/vanilla/node_modules/postcss/lib/document.js +0 -33
- package/templates/vanilla/node_modules/postcss/lib/fromJSON.d.ts +0 -9
- package/templates/vanilla/node_modules/postcss/lib/fromJSON.js +0 -54
- package/templates/vanilla/node_modules/postcss/lib/input.d.ts +0 -227
- package/templates/vanilla/node_modules/postcss/lib/input.js +0 -265
- package/templates/vanilla/node_modules/postcss/lib/lazy-result.d.ts +0 -190
- package/templates/vanilla/node_modules/postcss/lib/lazy-result.js +0 -550
- package/templates/vanilla/node_modules/postcss/lib/list.d.ts +0 -60
- package/templates/vanilla/node_modules/postcss/lib/list.js +0 -58
- package/templates/vanilla/node_modules/postcss/lib/map-generator.js +0 -368
- package/templates/vanilla/node_modules/postcss/lib/no-work-result.d.ts +0 -46
- package/templates/vanilla/node_modules/postcss/lib/no-work-result.js +0 -138
- package/templates/vanilla/node_modules/postcss/lib/node.d.ts +0 -556
- package/templates/vanilla/node_modules/postcss/lib/node.js +0 -449
- package/templates/vanilla/node_modules/postcss/lib/parse.d.ts +0 -9
- package/templates/vanilla/node_modules/postcss/lib/parse.js +0 -42
- package/templates/vanilla/node_modules/postcss/lib/parser.js +0 -611
- package/templates/vanilla/node_modules/postcss/lib/postcss.d.mts +0 -69
- package/templates/vanilla/node_modules/postcss/lib/postcss.d.ts +0 -458
- package/templates/vanilla/node_modules/postcss/lib/postcss.js +0 -101
- package/templates/vanilla/node_modules/postcss/lib/postcss.mjs +0 -30
- package/templates/vanilla/node_modules/postcss/lib/previous-map.d.ts +0 -81
- package/templates/vanilla/node_modules/postcss/lib/previous-map.js +0 -144
- package/templates/vanilla/node_modules/postcss/lib/processor.d.ts +0 -115
- package/templates/vanilla/node_modules/postcss/lib/processor.js +0 -67
- package/templates/vanilla/node_modules/postcss/lib/result.d.ts +0 -205
- package/templates/vanilla/node_modules/postcss/lib/result.js +0 -42
- package/templates/vanilla/node_modules/postcss/lib/root.d.ts +0 -87
- package/templates/vanilla/node_modules/postcss/lib/root.js +0 -61
- package/templates/vanilla/node_modules/postcss/lib/rule.d.ts +0 -126
- package/templates/vanilla/node_modules/postcss/lib/rule.js +0 -27
- package/templates/vanilla/node_modules/postcss/lib/stringifier.d.ts +0 -46
- package/templates/vanilla/node_modules/postcss/lib/stringifier.js +0 -353
- package/templates/vanilla/node_modules/postcss/lib/stringify.d.ts +0 -9
- package/templates/vanilla/node_modules/postcss/lib/stringify.js +0 -11
- package/templates/vanilla/node_modules/postcss/lib/symbols.js +0 -5
- package/templates/vanilla/node_modules/postcss/lib/terminal-highlight.js +0 -70
- package/templates/vanilla/node_modules/postcss/lib/tokenize.js +0 -266
- package/templates/vanilla/node_modules/postcss/lib/warn-once.js +0 -13
- package/templates/vanilla/node_modules/postcss/lib/warning.d.ts +0 -147
- package/templates/vanilla/node_modules/postcss/lib/warning.js +0 -37
- package/templates/vanilla/node_modules/postcss/package.json +0 -88
- package/templates/vanilla/node_modules/rollup/LICENSE.md +0 -695
- package/templates/vanilla/node_modules/rollup/README.md +0 -125
- package/templates/vanilla/node_modules/rollup/dist/bin/rollup +0 -1715
- package/templates/vanilla/node_modules/rollup/dist/es/getLogFilter.js +0 -64
- package/templates/vanilla/node_modules/rollup/dist/es/package.json +0 -1
- package/templates/vanilla/node_modules/rollup/dist/es/rollup.js +0 -17
- package/templates/vanilla/node_modules/rollup/dist/es/shared/node-entry.js +0 -27273
- package/templates/vanilla/node_modules/rollup/dist/es/shared/watch.js +0 -4857
- package/templates/vanilla/node_modules/rollup/dist/getLogFilter.d.ts +0 -5
- package/templates/vanilla/node_modules/rollup/dist/getLogFilter.js +0 -69
- package/templates/vanilla/node_modules/rollup/dist/loadConfigFile.d.ts +0 -20
- package/templates/vanilla/node_modules/rollup/dist/loadConfigFile.js +0 -29
- package/templates/vanilla/node_modules/rollup/dist/rollup.d.ts +0 -1012
- package/templates/vanilla/node_modules/rollup/dist/rollup.js +0 -31
- package/templates/vanilla/node_modules/rollup/dist/shared/fsevents-importer.js +0 -37
- package/templates/vanilla/node_modules/rollup/dist/shared/index.js +0 -4571
- package/templates/vanilla/node_modules/rollup/dist/shared/loadConfigFile.js +0 -546
- package/templates/vanilla/node_modules/rollup/dist/shared/rollup.js +0 -27351
- package/templates/vanilla/node_modules/rollup/dist/shared/watch-cli.js +0 -561
- package/templates/vanilla/node_modules/rollup/dist/shared/watch-proxy.js +0 -87
- package/templates/vanilla/node_modules/rollup/dist/shared/watch.js +0 -316
- package/templates/vanilla/node_modules/rollup/package.json +0 -181
- package/templates/vanilla/node_modules/source-map-js/LICENSE +0 -28
- package/templates/vanilla/node_modules/source-map-js/README.md +0 -765
- package/templates/vanilla/node_modules/source-map-js/lib/array-set.js +0 -121
- package/templates/vanilla/node_modules/source-map-js/lib/base64-vlq.js +0 -140
- package/templates/vanilla/node_modules/source-map-js/lib/base64.js +0 -67
- package/templates/vanilla/node_modules/source-map-js/lib/binary-search.js +0 -111
- package/templates/vanilla/node_modules/source-map-js/lib/mapping-list.js +0 -79
- package/templates/vanilla/node_modules/source-map-js/lib/quick-sort.js +0 -132
- package/templates/vanilla/node_modules/source-map-js/lib/source-map-consumer.d.ts +0 -1
- package/templates/vanilla/node_modules/source-map-js/lib/source-map-consumer.js +0 -1188
- package/templates/vanilla/node_modules/source-map-js/lib/source-map-generator.d.ts +0 -1
- package/templates/vanilla/node_modules/source-map-js/lib/source-map-generator.js +0 -444
- package/templates/vanilla/node_modules/source-map-js/lib/source-node.d.ts +0 -1
- package/templates/vanilla/node_modules/source-map-js/lib/source-node.js +0 -413
- package/templates/vanilla/node_modules/source-map-js/lib/util.js +0 -594
- package/templates/vanilla/node_modules/source-map-js/package.json +0 -71
- package/templates/vanilla/node_modules/source-map-js/source-map.d.ts +0 -104
- package/templates/vanilla/node_modules/source-map-js/source-map.js +0 -8
- package/templates/vanilla/node_modules/vite/LICENSE.md +0 -3396
- package/templates/vanilla/node_modules/vite/README.md +0 -20
- package/templates/vanilla/node_modules/vite/bin/openChrome.applescript +0 -95
- package/templates/vanilla/node_modules/vite/bin/vite.js +0 -61
- package/templates/vanilla/node_modules/vite/client.d.ts +0 -281
- package/templates/vanilla/node_modules/vite/dist/client/client.mjs +0 -725
- package/templates/vanilla/node_modules/vite/dist/client/client.mjs.map +0 -1
- package/templates/vanilla/node_modules/vite/dist/client/env.mjs +0 -30
- package/templates/vanilla/node_modules/vite/dist/client/env.mjs.map +0 -1
- package/templates/vanilla/node_modules/vite/dist/node/chunks/dep-7ec6f216.js +0 -914
- package/templates/vanilla/node_modules/vite/dist/node/chunks/dep-827b23df.js +0 -66713
- package/templates/vanilla/node_modules/vite/dist/node/chunks/dep-c423598f.js +0 -561
- package/templates/vanilla/node_modules/vite/dist/node/chunks/dep-f0c7dae0.js +0 -7930
- package/templates/vanilla/node_modules/vite/dist/node/chunks/dep-f1e8587f.js +0 -7646
- package/templates/vanilla/node_modules/vite/dist/node/cli.js +0 -929
- package/templates/vanilla/node_modules/vite/dist/node/constants.js +0 -130
- package/templates/vanilla/node_modules/vite/dist/node/index.d.ts +0 -3548
- package/templates/vanilla/node_modules/vite/dist/node/index.js +0 -158
- package/templates/vanilla/node_modules/vite/dist/node-cjs/publicUtils.cjs +0 -4555
- package/templates/vanilla/node_modules/vite/index.cjs +0 -34
- package/templates/vanilla/node_modules/vite/package.json +0 -173
- package/templates/vanilla/node_modules/vite/types/customEvent.d.ts +0 -35
- package/templates/vanilla/node_modules/vite/types/hmrPayload.d.ts +0 -61
- package/templates/vanilla/node_modules/vite/types/hot.d.ts +0 -32
- package/templates/vanilla/node_modules/vite/types/importGlob.d.ts +0 -97
- package/templates/vanilla/node_modules/vite/types/importMeta.d.ts +0 -26
- package/templates/vanilla/node_modules/vite/types/metadata.d.ts +0 -10
- package/templates/vanilla/node_modules/vite/types/package.json +0 -4
- package/templates/vanilla/package-lock.json +0 -589
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
Copyright Contributors to Forge Standard Library
|
|
2
|
+
|
|
3
|
+
Apache License
|
|
4
|
+
Version 2.0, January 2004
|
|
5
|
+
http://www.apache.org/licenses/
|
|
6
|
+
|
|
7
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
8
|
+
|
|
9
|
+
1. Definitions.
|
|
10
|
+
|
|
11
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
12
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
13
|
+
|
|
14
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
15
|
+
the copyright owner that is granting the License.
|
|
16
|
+
|
|
17
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
18
|
+
other entities that control, are controlled by, or are under common
|
|
19
|
+
control with that entity. For the purposes of this definition,
|
|
20
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
21
|
+
direction or management of such entity, whether by contract or
|
|
22
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
23
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
24
|
+
|
|
25
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
26
|
+
exercising permissions granted by this License.
|
|
27
|
+
|
|
28
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
29
|
+
including but not limited to software source code, documentation
|
|
30
|
+
source, and configuration files.
|
|
31
|
+
|
|
32
|
+
"Object" form shall mean any form resulting from mechanical
|
|
33
|
+
transformation or translation of a Source form, including but
|
|
34
|
+
not limited to compiled object code, generated documentation,
|
|
35
|
+
and conversions to other media types.
|
|
36
|
+
|
|
37
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
38
|
+
Object form, made available under the License, as indicated by a
|
|
39
|
+
copyright notice that is included in or attached to the work
|
|
40
|
+
(an example is provided in the Appendix below).
|
|
41
|
+
|
|
42
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
43
|
+
form, that is based on (or derived from) the Work and for which the
|
|
44
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
45
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
46
|
+
of this License, Derivative Works shall not include works that remain
|
|
47
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
48
|
+
the Work and Derivative Works thereof.
|
|
49
|
+
|
|
50
|
+
"Contribution" shall mean any work of authorship, including
|
|
51
|
+
the original version of the Work and any modifications or additions
|
|
52
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
53
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
54
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
55
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
56
|
+
means any form of electronic, verbal, or written communication sent
|
|
57
|
+
to the Licensor or its representatives, including but not limited to
|
|
58
|
+
communication on electronic mailing lists, source code control systems,
|
|
59
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
60
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
61
|
+
excluding communication that is conspicuously marked or otherwise
|
|
62
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
63
|
+
|
|
64
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
65
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
66
|
+
subsequently incorporated within the Work.
|
|
67
|
+
|
|
68
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
69
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
70
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
71
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
72
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
73
|
+
Work and such Derivative Works in Source or Object form.
|
|
74
|
+
|
|
75
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
76
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
77
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
78
|
+
(except as stated in this section) patent license to make, have made,
|
|
79
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
80
|
+
where such license applies only to those patent claims licensable
|
|
81
|
+
by such Contributor that are necessarily infringed by their
|
|
82
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
83
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
84
|
+
institute patent litigation against any entity (including a
|
|
85
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
86
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
87
|
+
or contributory patent infringement, then any patent licenses
|
|
88
|
+
granted to You under this License for that Work shall terminate
|
|
89
|
+
as of the date such litigation is filed.
|
|
90
|
+
|
|
91
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
92
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
93
|
+
modifications, and in Source or Object form, provided that You
|
|
94
|
+
meet the following conditions:
|
|
95
|
+
|
|
96
|
+
(a) You must give any other recipients of the Work or
|
|
97
|
+
Derivative Works a copy of this License; and
|
|
98
|
+
|
|
99
|
+
(b) You must cause any modified files to carry prominent notices
|
|
100
|
+
stating that You changed the files; and
|
|
101
|
+
|
|
102
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
103
|
+
that You distribute, all copyright, patent, trademark, and
|
|
104
|
+
attribution notices from the Source form of the Work,
|
|
105
|
+
excluding those notices that do not pertain to any part of
|
|
106
|
+
the Derivative Works; and
|
|
107
|
+
|
|
108
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
109
|
+
distribution, then any Derivative Works that You distribute must
|
|
110
|
+
include a readable copy of the attribution notices contained
|
|
111
|
+
within such NOTICE file, excluding those notices that do not
|
|
112
|
+
pertain to any part of the Derivative Works, in at least one
|
|
113
|
+
of the following places: within a NOTICE text file distributed
|
|
114
|
+
as part of the Derivative Works; within the Source form or
|
|
115
|
+
documentation, if provided along with the Derivative Works; or,
|
|
116
|
+
within a display generated by the Derivative Works, if and
|
|
117
|
+
wherever such third-party notices normally appear. The contents
|
|
118
|
+
of the NOTICE file are for informational purposes only and
|
|
119
|
+
do not modify the License. You may add Your own attribution
|
|
120
|
+
notices within Derivative Works that You distribute, alongside
|
|
121
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
122
|
+
that such additional attribution notices cannot be construed
|
|
123
|
+
as modifying the License.
|
|
124
|
+
|
|
125
|
+
You may add Your own copyright statement to Your modifications and
|
|
126
|
+
may provide additional or different license terms and conditions
|
|
127
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
128
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
129
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
130
|
+
the conditions stated in this License.
|
|
131
|
+
|
|
132
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
133
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
134
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
135
|
+
this License, without any additional terms or conditions.
|
|
136
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
137
|
+
the terms of any separate license agreement you may have executed
|
|
138
|
+
with Licensor regarding such Contributions.
|
|
139
|
+
|
|
140
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
141
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
142
|
+
except as required for reasonable and customary use in describing the
|
|
143
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
144
|
+
|
|
145
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
146
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
147
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
148
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
149
|
+
implied, including, without limitation, any warranties or conditions
|
|
150
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
151
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
152
|
+
appropriateness of using or redistributing the Work and assume any
|
|
153
|
+
risks associated with Your exercise of permissions under this License.
|
|
154
|
+
|
|
155
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
156
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
157
|
+
unless required by applicable law (such as deliberate and grossly
|
|
158
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
159
|
+
liable to You for damages, including any direct, indirect, special,
|
|
160
|
+
incidental, or consequential damages of any character arising as a
|
|
161
|
+
result of this License or out of the use or inability to use the
|
|
162
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
163
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
164
|
+
other commercial damages or losses), even if such Contributor
|
|
165
|
+
has been advised of the possibility of such damages.
|
|
166
|
+
|
|
167
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
168
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
169
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
170
|
+
or other liability obligations and/or rights consistent with this
|
|
171
|
+
License. However, in accepting such obligations, You may act only
|
|
172
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
173
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
174
|
+
defend, and hold each Contributor harmless for any liability
|
|
175
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
176
|
+
of your accepting any such warranty or additional liability.
|
|
177
|
+
|
|
178
|
+
END OF TERMS AND CONDITIONS
|
|
179
|
+
|
|
180
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
181
|
+
|
|
182
|
+
To apply the Apache License to your work, attach the following
|
|
183
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
184
|
+
replaced with your own identifying information. (Don't include
|
|
185
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
186
|
+
comment syntax for the file format. We also recommend that a
|
|
187
|
+
file or class name and description of purpose be included on the
|
|
188
|
+
same "printed page" as the copyright notice for easier
|
|
189
|
+
identification within third-party archives.
|
|
190
|
+
|
|
191
|
+
Copyright [yyyy] [name of copyright owner]
|
|
192
|
+
|
|
193
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
194
|
+
you may not use this file except in compliance with the License.
|
|
195
|
+
You may obtain a copy of the License at
|
|
196
|
+
|
|
197
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
198
|
+
|
|
199
|
+
Unless required by applicable law or agreed to in writing, software
|
|
200
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
201
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
202
|
+
See the License for the specific language governing permissions and
|
|
203
|
+
limitations under the License.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
Copyright Contributors to Forge Standard Library
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any
|
|
4
|
+
person obtaining a copy of this software and associated
|
|
5
|
+
documentation files (the "Software"), to deal in the
|
|
6
|
+
Software without restriction, including without
|
|
7
|
+
limitation the rights to use, copy, modify, merge,
|
|
8
|
+
publish, distribute, sublicense, and/or sell copies of
|
|
9
|
+
the Software, and to permit persons to whom the Software
|
|
10
|
+
is furnished to do so, subject to the following
|
|
11
|
+
conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice
|
|
14
|
+
shall be included in all copies or substantial portions
|
|
15
|
+
of the Software.
|
|
16
|
+
|
|
17
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
|
|
18
|
+
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
|
|
19
|
+
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
|
|
20
|
+
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
|
|
21
|
+
SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
22
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
23
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
|
|
24
|
+
IN CONNECTION WITH THE SOFTWARE O THE USE OR OTHER
|
|
25
|
+
DEALINGS IN THE SOFTWARE.R
|
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
# Forge Standard Library • [](https://github.com/foundry-rs/forge-std/actions/workflows/ci.yml)
|
|
2
|
+
|
|
3
|
+
Forge Standard Library is a collection of helpful contracts and libraries for use with [Forge and Foundry](https://github.com/foundry-rs/foundry). It leverages Forge's cheatcodes to make writing tests easier and faster, while improving the UX of cheatcodes.
|
|
4
|
+
|
|
5
|
+
**Learn how to use Forge-Std with the [📖 Foundry Book (Forge-Std Guide)](https://getfoundry.sh/reference/forge-std/overview/).**
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
forge install foundry-rs/forge-std
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Contracts
|
|
14
|
+
|
|
15
|
+
### stdError
|
|
16
|
+
|
|
17
|
+
This is a helper contract for errors and reverts. In Forge, this contract is particularly helpful for the `expectRevert` cheatcode, as it provides all compiler built-in errors.
|
|
18
|
+
|
|
19
|
+
See the contract itself for all error codes.
|
|
20
|
+
|
|
21
|
+
#### Example usage
|
|
22
|
+
|
|
23
|
+
```solidity
|
|
24
|
+
|
|
25
|
+
import "forge-std/Test.sol";
|
|
26
|
+
|
|
27
|
+
contract TestContract is Test {
|
|
28
|
+
ErrorsTest test;
|
|
29
|
+
|
|
30
|
+
function setUp() public {
|
|
31
|
+
test = new ErrorsTest();
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function testExpectArithmetic() public {
|
|
35
|
+
vm.expectRevert(stdError.arithmeticError);
|
|
36
|
+
test.arithmeticError(10);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
contract ErrorsTest {
|
|
41
|
+
function arithmeticError(uint256 a) public {
|
|
42
|
+
a = a - 100;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### stdStorage
|
|
48
|
+
|
|
49
|
+
This is a rather large contract due to all of the overloading to make the UX decent. Primarily, it is a wrapper around the `record` and `accesses` cheatcodes. It can _always_ find and write the storage slot(s) associated with a particular variable without knowing the storage layout. The one _major_ caveat to this is while a slot can be found for packed storage variables, we can't write to that variable safely. If a user tries to write to a packed slot, the execution throws an error, unless it is uninitialized (`bytes32(0)`).
|
|
50
|
+
|
|
51
|
+
This works by recording all `SLOAD`s and `SSTORE`s during a function call. If there is a single slot read or written to, it immediately returns the slot. Otherwise, behind the scenes, we iterate through and check each one (assuming the user passed in a `depth` parameter). If the variable is a struct, you can pass in a `depth` parameter which is basically the field depth.
|
|
52
|
+
|
|
53
|
+
I.e.:
|
|
54
|
+
|
|
55
|
+
```solidity
|
|
56
|
+
struct T {
|
|
57
|
+
// depth 0
|
|
58
|
+
uint256 a;
|
|
59
|
+
// depth 1
|
|
60
|
+
uint256 b;
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
#### Example usage
|
|
65
|
+
|
|
66
|
+
```solidity
|
|
67
|
+
import "forge-std/Test.sol";
|
|
68
|
+
|
|
69
|
+
contract TestContract is Test {
|
|
70
|
+
using stdStorage for StdStorage;
|
|
71
|
+
|
|
72
|
+
Storage test;
|
|
73
|
+
|
|
74
|
+
function setUp() public {
|
|
75
|
+
test = new Storage();
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function testFindExists() public {
|
|
79
|
+
// Let's say we want to find the slot for the public
|
|
80
|
+
// variable `exists`. We just pass in the function selector
|
|
81
|
+
// to the `find` command
|
|
82
|
+
uint256 slot = stdstore.target(address(test)).sig("exists()").find();
|
|
83
|
+
assertEq(slot, 0);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function testWriteExists() public {
|
|
87
|
+
// Let's say we want to write to the slot for the public
|
|
88
|
+
// variable `exists`. We just pass in the function selector
|
|
89
|
+
// to the `checked_write` command
|
|
90
|
+
stdstore.target(address(test)).sig("exists()").checked_write(100);
|
|
91
|
+
assertEq(test.exists(), 100);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// It supports arbitrary storage layouts, like assembly based storage locations
|
|
95
|
+
function testFindHidden() public {
|
|
96
|
+
// `hidden` is a random hash of a bytes, iteration through slots would
|
|
97
|
+
// not find it. Our mechanism does
|
|
98
|
+
// Also, you can use the selector instead of a string
|
|
99
|
+
uint256 slot = stdstore.target(address(test)).sig(test.hidden.selector).find();
|
|
100
|
+
assertEq(slot, uint256(keccak256("my.random.var")));
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// If targeting a mapping, you have to pass in the keys necessary to perform the find
|
|
104
|
+
// i.e.:
|
|
105
|
+
function testFindMapping() public {
|
|
106
|
+
uint256 slot = stdstore
|
|
107
|
+
.target(address(test))
|
|
108
|
+
.sig(test.map_addr.selector)
|
|
109
|
+
.with_key(address(this))
|
|
110
|
+
.find();
|
|
111
|
+
// in the `Storage` constructor, we wrote that this address' value was 1 in the map
|
|
112
|
+
// so when we load the slot, we expect it to be 1
|
|
113
|
+
assertEq(uint(vm.load(address(test), bytes32(slot))), 1);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// If the target is a struct, you can specify the field depth:
|
|
117
|
+
function testFindStruct() public {
|
|
118
|
+
// NOTE: see the depth parameter - 0 means 0th field, 1 means 1st field, etc.
|
|
119
|
+
uint256 slot_for_a_field = stdstore
|
|
120
|
+
.target(address(test))
|
|
121
|
+
.sig(test.basicStruct.selector)
|
|
122
|
+
.depth(0)
|
|
123
|
+
.find();
|
|
124
|
+
|
|
125
|
+
uint256 slot_for_b_field = stdstore
|
|
126
|
+
.target(address(test))
|
|
127
|
+
.sig(test.basicStruct.selector)
|
|
128
|
+
.depth(1)
|
|
129
|
+
.find();
|
|
130
|
+
|
|
131
|
+
assertEq(uint(vm.load(address(test), bytes32(slot_for_a_field))), 1);
|
|
132
|
+
assertEq(uint(vm.load(address(test), bytes32(slot_for_b_field))), 2);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
// A complex storage contract
|
|
137
|
+
contract Storage {
|
|
138
|
+
struct UnpackedStruct {
|
|
139
|
+
uint256 a;
|
|
140
|
+
uint256 b;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
constructor() {
|
|
144
|
+
map_addr[msg.sender] = 1;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
uint256 public exists = 1;
|
|
148
|
+
mapping(address => uint256) public map_addr;
|
|
149
|
+
// mapping(address => Packed) public map_packed;
|
|
150
|
+
mapping(address => UnpackedStruct) public map_struct;
|
|
151
|
+
mapping(address => mapping(address => uint256)) public deep_map;
|
|
152
|
+
mapping(address => mapping(address => UnpackedStruct)) public deep_map_struct;
|
|
153
|
+
UnpackedStruct public basicStruct = UnpackedStruct({
|
|
154
|
+
a: 1,
|
|
155
|
+
b: 2
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
function hidden() public view returns (bytes32 t) {
|
|
159
|
+
// an extremely hidden storage slot
|
|
160
|
+
bytes32 slot = keccak256("my.random.var");
|
|
161
|
+
assembly {
|
|
162
|
+
t := sload(slot)
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
### stdCheats
|
|
169
|
+
|
|
170
|
+
This is a wrapper over miscellaneous cheatcodes that need wrappers to be more dev friendly. Currently there are only functions related to `prank`. In general, users may expect ETH to be put into an address on `prank`, but this is not the case for safety reasons. Explicitly this `hoax` function should only be used for addresses that have expected balances as it will get overwritten. If an address already has ETH, you should just use `prank`. If you want to change that balance explicitly, just use `deal`. If you want to do both, `hoax` is also right for you.
|
|
171
|
+
|
|
172
|
+
#### Example usage:
|
|
173
|
+
|
|
174
|
+
```solidity
|
|
175
|
+
|
|
176
|
+
// SPDX-License-Identifier: MIT OR Apache-2.0
|
|
177
|
+
pragma solidity ^0.8.0;
|
|
178
|
+
|
|
179
|
+
import "forge-std/Test.sol";
|
|
180
|
+
|
|
181
|
+
// Inherit the stdCheats
|
|
182
|
+
contract StdCheatsTest is Test {
|
|
183
|
+
Bar test;
|
|
184
|
+
function setUp() public {
|
|
185
|
+
test = new Bar();
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
function testHoax() public {
|
|
189
|
+
// we call `hoax`, which gives the target address
|
|
190
|
+
// eth and then calls `prank`
|
|
191
|
+
hoax(address(1337));
|
|
192
|
+
test.bar{value: 100}(address(1337));
|
|
193
|
+
|
|
194
|
+
// overloaded to allow you to specify how much eth to
|
|
195
|
+
// initialize the address with
|
|
196
|
+
hoax(address(1337), 1);
|
|
197
|
+
test.bar{value: 1}(address(1337));
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
function testStartHoax() public {
|
|
201
|
+
// we call `startHoax`, which gives the target address
|
|
202
|
+
// eth and then calls `startPrank`
|
|
203
|
+
//
|
|
204
|
+
// it is also overloaded so that you can specify an eth amount
|
|
205
|
+
startHoax(address(1337));
|
|
206
|
+
test.bar{value: 100}(address(1337));
|
|
207
|
+
test.bar{value: 100}(address(1337));
|
|
208
|
+
vm.stopPrank();
|
|
209
|
+
test.bar(address(this));
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
contract Bar {
|
|
214
|
+
function bar(address expectedSender) public payable {
|
|
215
|
+
require(msg.sender == expectedSender, "!prank");
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
### Std Assertions
|
|
221
|
+
|
|
222
|
+
Contains various assertions.
|
|
223
|
+
|
|
224
|
+
### `console.log`
|
|
225
|
+
|
|
226
|
+
Usage follows the same format as [Hardhat](https://hardhat.org/hardhat-network/reference/#console-log).
|
|
227
|
+
It's recommended to use `console2.sol` as shown below, as this will show the decoded logs in Forge traces.
|
|
228
|
+
|
|
229
|
+
```solidity
|
|
230
|
+
// import it indirectly via Test.sol
|
|
231
|
+
import "forge-std/Test.sol";
|
|
232
|
+
// or directly import it
|
|
233
|
+
import "forge-std/console2.sol";
|
|
234
|
+
...
|
|
235
|
+
console2.log(someValue);
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
If you need compatibility with Hardhat, you must use the standard `console.sol` instead.
|
|
239
|
+
Due to a bug in `console.sol`, logs that use `uint256` or `int256` types will not be properly decoded in Forge traces.
|
|
240
|
+
|
|
241
|
+
```solidity
|
|
242
|
+
// import it indirectly via Test.sol
|
|
243
|
+
import "forge-std/Test.sol";
|
|
244
|
+
// or directly import it
|
|
245
|
+
import "forge-std/console.sol";
|
|
246
|
+
...
|
|
247
|
+
console.log(someValue);
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
## Contributing
|
|
251
|
+
|
|
252
|
+
See our [contributing guidelines](./CONTRIBUTING.md).
|
|
253
|
+
|
|
254
|
+
## Getting Help
|
|
255
|
+
|
|
256
|
+
First, see if the answer to your question can be found in [book](https://getfoundry.sh/).
|
|
257
|
+
|
|
258
|
+
If the answer is not there:
|
|
259
|
+
|
|
260
|
+
- Join the [support Telegram](https://t.me/foundry_support) to get help, or
|
|
261
|
+
- Open a [discussion](https://github.com/foundry-rs/foundry/discussions/new/choose) with your question, or
|
|
262
|
+
- Open an issue with [the bug](https://github.com/foundry-rs/foundry/issues/new/choose)
|
|
263
|
+
|
|
264
|
+
If you want to contribute, or follow along with contributor discussion, you can use our [main telegram](https://t.me/foundry_rs) to chat with us about the development of Foundry!
|
|
265
|
+
|
|
266
|
+
## License
|
|
267
|
+
|
|
268
|
+
Forge Standard Library is offered under either [MIT](LICENSE-MIT) or [Apache 2.0](LICENSE-APACHE) license.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Release checklist
|
|
2
|
+
|
|
3
|
+
This checklist is meant to be used as a guide for the `forge-std` release process.
|
|
4
|
+
|
|
5
|
+
## Steps
|
|
6
|
+
|
|
7
|
+
- [ ] Update the version number in `package.json`
|
|
8
|
+
- [ ] Open and merge a PR with the version bump
|
|
9
|
+
- [ ] Tag the merged commit with the version number: `git tag v<X.Y.Z>`
|
|
10
|
+
- [ ] Push the tag to the repository: `git push --tags`
|
|
11
|
+
- [ ] Create a new GitHub release with the automatically generated changelog and with the name set to `v<X.Y.Z>`
|
|
12
|
+
- [ ] Add `## Featured Changes` section to the top of the release notes
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
[profile.default]
|
|
2
|
+
fs_permissions = [{ access = "read-write", path = "./" }]
|
|
3
|
+
optimizer = true
|
|
4
|
+
optimizer_runs = 200
|
|
5
|
+
|
|
6
|
+
# A list of solidity error codes to ignore.
|
|
7
|
+
# 3860 = init-code-size
|
|
8
|
+
ignored_error_codes = [3860]
|
|
9
|
+
|
|
10
|
+
[rpc_endpoints]
|
|
11
|
+
# The RPC URLs are modified versions of the default for testing initialization.
|
|
12
|
+
mainnet = "https://reth-ethereum.ithaca.xyz/rpc"
|
|
13
|
+
optimism_sepolia = "https://sepolia.optimism.io/" # Adds a trailing slash.
|
|
14
|
+
arbitrum_one_sepolia = "https://sepolia-rollup.arbitrum.io/rpc/" # Adds a trailing slash.
|
|
15
|
+
needs_undefined_env_var = "${UNDEFINED_RPC_URL_PLACEHOLDER}"
|
|
16
|
+
|
|
17
|
+
[lint]
|
|
18
|
+
lint_on_build = false
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "forge-std",
|
|
3
|
+
"version": "1.14.0",
|
|
4
|
+
"description": "Forge Standard Library is a collection of helpful contracts and libraries for use with Forge and Foundry.",
|
|
5
|
+
"homepage": "https://book.getfoundry.sh/forge/forge-std",
|
|
6
|
+
"bugs": "https://github.com/foundry-rs/forge-std/issues",
|
|
7
|
+
"license": "(Apache-2.0 OR MIT)",
|
|
8
|
+
"author": "Contributors to Forge Standard Library",
|
|
9
|
+
"files": [
|
|
10
|
+
"src/**/*"
|
|
11
|
+
],
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "https://github.com/foundry-rs/forge-std.git"
|
|
15
|
+
}
|
|
16
|
+
}
|