diff --git a/.gitignore b/.gitignore index 46bbcb2..2012e25 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,6 @@ docs/ # Local development dependencies dev/node_modules/ dev/.venv/ + +# pnpm cache +.pnpm-store/ diff --git a/.solhint.json b/.solhint.json new file mode 100644 index 0000000..898adb5 --- /dev/null +++ b/.solhint.json @@ -0,0 +1,8 @@ +{ + "extends": "solhint:recommended", + "rules": { + "compiler-version": ["error", "^0.8"], + "import-path-check": "off", + "use-natspec": "warn" + } +} diff --git a/.solhintignore b/.solhintignore new file mode 100644 index 0000000..c3af857 --- /dev/null +++ b/.solhintignore @@ -0,0 +1 @@ +lib/ diff --git a/README.md b/README.md index 117e8be..4af15fa 100644 --- a/README.md +++ b/README.md @@ -33,12 +33,14 @@ forge fmt ### Local tooling Solhint and Slither are pinned as local development dependencies under `dev/`. + The pnpm setup waits 7 days before installing newly released packages, matching CoW repos and giving more review time than a 2-day delay. + Install them with: ```shell pnpm --dir dev install --frozen-lockfile -python -m venv dev/.venv +python3 -m venv dev/.venv dev/.venv/bin/pip install -r dev/requirements.txt ``` @@ -49,6 +51,17 @@ dev/node_modules/.bin/solhint --version dev/.venv/bin/slither --version ``` +### Solhint + +Solhint uses the pinned local binary: + +```shell +dev/node_modules/.bin/solhint --max-warnings 0 '**/*.sol' +``` + +The root config applies to all Solidity files. +The `script/` and `test/` folders have a small override config for their own style. + ### Gas Snapshots ```shell diff --git a/dev/.npmrc b/dev/.npmrc new file mode 100644 index 0000000..0132880 --- /dev/null +++ b/dev/.npmrc @@ -0,0 +1 @@ +store-dir=.pnpm-store diff --git a/dev/package.json b/dev/package.json index 6fdee87..1b65729 100644 --- a/dev/package.json +++ b/dev/package.json @@ -6,6 +6,6 @@ "license": "UNLICENSED", "packageManager": "pnpm@10.33.2", "devDependencies": { - "solhint": "6.0.3" + "solhint": "6.2.1" } } diff --git a/dev/pnpm-lock.yaml b/dev/pnpm-lock.yaml index bc04a69..db51b4f 100644 --- a/dev/pnpm-lock.yaml +++ b/dev/pnpm-lock.yaml @@ -9,8 +9,8 @@ importers: .: devDependencies: solhint: - specifier: 6.0.3 - version: 6.0.3 + specifier: 6.2.1 + version: 6.2.1 packages: @@ -52,13 +52,10 @@ packages: '@types/http-cache-semantics@4.2.0': resolution: {integrity: sha512-L3LgimLHXtGkWikKnsPg0/VFx9OGZaC+eN1u4r+OB1XRqH3meBIAVC2zr1WdMH+RHmnRkqliQAOHNJ/E0j/e0Q==} - ajv-errors@1.0.1: - resolution: {integrity: sha512-DCRfO/4nQ+89p/RK43i8Ezd41EqdGIU4ld7nGF8OQ14oc/we5rEntLCUa7+jrn3nn83BosfwZA0wb4pon2o8iQ==} + ajv-errors@3.0.0: + resolution: {integrity: sha512-V3wD15YHfHz6y0KdhYFjyy9vWtEVALT9UrxfN3zqlI6dMioHnJrqOYfyPKol3oqrnCM9uwkcdCwkJ0WUcbLMTQ==} peerDependencies: - ajv: '>=5.0.0' - - ajv@6.15.0: - resolution: {integrity: sha512-fgFx7Hfoq60ytK2c7DhnF8jIvzYgOMxfugjLOSMHjLIPgenqa7S7oaagATUq99mV6IYvN2tRmC0wnTYX6iPbMw==} + ajv: ^8.0.1 ajv@8.20.0: resolution: {integrity: sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==} @@ -81,8 +78,9 @@ packages: resolution: {integrity: sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==} engines: {node: '>=8'} - balanced-match@1.0.2: - resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} + balanced-match@4.0.4: + resolution: {integrity: sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==} + engines: {node: 18 || 20 || >=22} better-ajv-errors@2.0.3: resolution: {integrity: sha512-t1vxUP+vYKsaYi/BbKo2K98nEAZmfi4sjwvmRT8aOPDzPJeAtLurfoIDazVkLILxO4K+Sw4YrLYnBQ46l6pePg==} @@ -90,8 +88,9 @@ packages: peerDependencies: ajv: 4.11.8 - 8 - brace-expansion@2.1.0: - resolution: {integrity: sha512-TN1kCZAgdgweJhWWpgKYrQaMNHcDULHkWwQIspdtjV4Y5aurRdZpjAqn6yX3FPqTA9ngHCc4hJxMAMgGfve85w==} + brace-expansion@5.0.5: + resolution: {integrity: sha512-VZznLgtwhn+Mact9tfiwx64fA9erHH/MCXEUfB/0bX/6Fz6ny5EGTXYltMocqg4xFAQZtnO3DHWWXi8RiuN7cQ==} + engines: {node: 18 || 20 || >=22} cacheable-lookup@7.0.0: resolution: {integrity: sha512-+qJyx4xiKra8mZrcwhjMRMUhD5NR1R8esPkzIYxX96JiecFoxAXFuz/GpR3+ev4PE1WamHip78wV0vcmPQtp8w==} @@ -156,9 +155,6 @@ packages: fast-diff@1.3.0: resolution: {integrity: sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==} - fast-json-stable-stringify@2.1.0: - resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==} - fast-uri@3.1.0: resolution: {integrity: sha512-iPeeDKJSWf4IEOasVVrknXpaBV0IApz/gp7S2bb7Z4Lljbl2MGJRqInZiUrQwV16cpzw/D3S5j5Julj/gT52AA==} @@ -166,17 +162,13 @@ packages: resolution: {integrity: sha512-yDYSgNMraqvnxiEXO4hi88+YZxaHC6QKzb5N84iRCTDeRO7ZALpir/lVmf/uXUhnwUr2O4HU8s/n6x+yNjQkHw==} engines: {node: '>= 14.17'} - fs.realpath@1.0.0: - resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} - get-stream@6.0.1: resolution: {integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==} engines: {node: '>=10'} - glob@8.1.0: - resolution: {integrity: sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==} - engines: {node: '>=12'} - deprecated: Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me + glob@13.0.6: + resolution: {integrity: sha512-Wjlyrolmm8uDpm/ogGyXZXb1Z+Ca2B8NbJwqBVg0axK9GbBeoS7yGV6vjXnYdGm6X53iehEuxxbyiKp8QmN4Vw==} + engines: {node: 18 || 20 || >=22} got@12.6.1: resolution: {integrity: sha512-mThBblvlAF1d4O5oqyvN+ZxLAYwIJK7bpMxgYqPD9okW0C3qm5FFn7k811QrcuEBwaogR3ngOFoCfs6mRv7teQ==} @@ -204,13 +196,6 @@ packages: resolution: {integrity: sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==} engines: {node: '>=6'} - inflight@1.0.6: - resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} - deprecated: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful. - - inherits@2.0.4: - resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} - ini@1.3.8: resolution: {integrity: sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==} @@ -234,9 +219,6 @@ packages: json-parse-even-better-errors@2.3.1: resolution: {integrity: sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==} - json-schema-traverse@0.4.1: - resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==} - json-schema-traverse@1.0.0: resolution: {integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==} @@ -268,6 +250,10 @@ packages: resolution: {integrity: sha512-ozCC6gdQ+glXOQsveKD0YsDy8DSQFjDTz4zyzEHNV5+JP5D62LmfDZ6o1cycFx9ouG940M5dE8C8CTewdj2YWQ==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + lru-cache@11.3.5: + resolution: {integrity: sha512-NxVFwLAnrd9i7KUBxC4DrUhmgjzOs+1Qm50D3oF1/oL+r1NpZ4gA7xvG0/zJ8evR7zIKn4vLf7qTNduWFtCrRw==} + engines: {node: 20 || >=22} + mimic-response@3.1.0: resolution: {integrity: sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==} engines: {node: '>=10'} @@ -276,20 +262,21 @@ packages: resolution: {integrity: sha512-e5ISH9xMYU0DzrT+jl8q2ze9D6eWBto+I8CNpe+VI+K2J/F/k3PdkdTdz4wvGVH4NTpo+NRYTVIuMQEMMcsLqg==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - minimatch@5.1.9: - resolution: {integrity: sha512-7o1wEA2RyMP7Iu7GNba9vc0RWWGACJOCZBJX2GJWip0ikV+wcOsgVuY9uE8CPiyQhkGFSlhuSkZPavN7u1c2Fw==} - engines: {node: '>=10'} + minimatch@10.2.5: + resolution: {integrity: sha512-MULkVLfKGYDFYejP07QOurDLLQpcjk7Fw+7jXS2R2czRQzR56yHRveU5NDJEOviH+hETZKSkIk5c+T23GjFUMg==} + engines: {node: 18 || 20 || >=22} minimist@1.2.8: resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==} + minipass@7.1.3: + resolution: {integrity: sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==} + engines: {node: '>=16 || 14 >=14.17'} + normalize-url@8.1.1: resolution: {integrity: sha512-JYc0DPlpGWB40kH5g07gGTrYuMqV653k3uBKY6uITPWds3M0ov3GaWGp9lbE3Bzngx8+XkfzgvASb9vk9JDFXQ==} engines: {node: '>=14.16'} - once@1.4.0: - resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} - p-cancelable@3.0.0: resolution: {integrity: sha512-mlVgR3PGuzlo0MmTdk4cXqXWlwQDLnONTAg6sm62XkMJEiRxN3GL3SffkYvqwonbkJBcrI7Uvv5Zh9yjvn2iUw==} engines: {node: '>=12.20'} @@ -306,6 +293,10 @@ packages: resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==} engines: {node: '>=8'} + path-scurry@2.0.2: + resolution: {integrity: sha512-3O/iVVsJAPsOnpwWIeD+d6z/7PmqApyQePUtCndjatj/9I5LylHvt5qluFaBT3I5h3r1ejfR056c+FCv+NnNXg==} + engines: {node: 18 || 20 || >=22} + path-type@4.0.0: resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==} engines: {node: '>=8'} @@ -317,18 +308,14 @@ packages: resolution: {integrity: sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==} engines: {node: '>=4'} - prettier@2.8.8: - resolution: {integrity: sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==} - engines: {node: '>=10.13.0'} + prettier@3.8.3: + resolution: {integrity: sha512-7igPTM53cGHMW8xWuVTydi2KO233VFiTNyF5hLJqpilHfmn8C8gPf+PS7dUT64YcXFbiMGZxS9pCSxL/Dxm/Jw==} + engines: {node: '>=14'} hasBin: true proto-list@1.2.4: resolution: {integrity: sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==} - punycode@2.3.1: - resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} - engines: {node: '>=6'} - quick-lru@5.1.1: resolution: {integrity: sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==} engines: {node: '>=10'} @@ -369,8 +356,9 @@ packages: resolution: {integrity: sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==} engines: {node: '>=10'} - solhint@6.0.3: - resolution: {integrity: sha512-LYiy1bN8X9eUsti13mbS4fY6ILVxhP6VoOgqbHxCsHl5VPnxOWf7U1V9ZvgizxdInKBMW82D1FNJO+daAcWHbA==} + solhint@6.2.1: + resolution: {integrity: sha512-+VHSa84CRjm2s+KZWYxIDnI+NokcLsZHOSpRtg5nBFmnVfh6RPmPaFd5TN922Cfrm2i85kNoQtLiapALe26b5w==} + engines: {node: '>=20'} hasBin: true string-width@4.2.3: @@ -396,12 +384,6 @@ packages: text-table@0.2.0: resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==} - uri-js@4.4.1: - resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} - - wrappy@1.0.2: - resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} - snapshots: '@babel/code-frame@7.29.0': @@ -436,16 +418,9 @@ snapshots: '@types/http-cache-semantics@4.2.0': {} - ajv-errors@1.0.1(ajv@6.15.0): + ajv-errors@3.0.0(ajv@8.20.0): dependencies: - ajv: 6.15.0 - - ajv@6.15.0: - dependencies: - fast-deep-equal: 3.1.3 - fast-json-stable-stringify: 2.1.0 - json-schema-traverse: 0.4.1 - uri-js: 4.4.1 + ajv: 8.20.0 ajv@8.20.0: dependencies: @@ -466,20 +441,20 @@ snapshots: astral-regex@2.0.0: {} - balanced-match@1.0.2: {} + balanced-match@4.0.4: {} - better-ajv-errors@2.0.3(ajv@6.15.0): + better-ajv-errors@2.0.3(ajv@8.20.0): dependencies: '@babel/code-frame': 7.29.0 '@humanwhocodes/momoa': 2.0.4 - ajv: 6.15.0 + ajv: 8.20.0 chalk: 4.1.2 jsonpointer: 5.0.1 leven: 3.1.0 - brace-expansion@2.1.0: + brace-expansion@5.0.5: dependencies: - balanced-match: 1.0.2 + balanced-match: 4.0.4 cacheable-lookup@7.0.0: {} @@ -538,23 +513,17 @@ snapshots: fast-diff@1.3.0: {} - fast-json-stable-stringify@2.1.0: {} - fast-uri@3.1.0: {} form-data-encoder@2.1.4: {} - fs.realpath@1.0.0: {} - get-stream@6.0.1: {} - glob@8.1.0: + glob@13.0.6: dependencies: - fs.realpath: 1.0.0 - inflight: 1.0.6 - inherits: 2.0.4 - minimatch: 5.1.9 - once: 1.4.0 + minimatch: 10.2.5 + minipass: 7.1.3 + path-scurry: 2.0.2 got@12.6.1: dependencies: @@ -588,13 +557,6 @@ snapshots: parent-module: 1.0.1 resolve-from: 4.0.0 - inflight@1.0.6: - dependencies: - once: 1.4.0 - wrappy: 1.0.2 - - inherits@2.0.4: {} - ini@1.3.8: {} is-arrayish@0.2.1: {} @@ -611,8 +573,6 @@ snapshots: json-parse-even-better-errors@2.3.1: {} - json-schema-traverse@0.4.1: {} - json-schema-traverse@1.0.0: {} jsonpointer@5.0.1: {} @@ -635,21 +595,21 @@ snapshots: lowercase-keys@3.0.0: {} + lru-cache@11.3.5: {} + mimic-response@3.1.0: {} mimic-response@4.0.0: {} - minimatch@5.1.9: + minimatch@10.2.5: dependencies: - brace-expansion: 2.1.0 + brace-expansion: 5.0.5 minimist@1.2.8: {} - normalize-url@8.1.1: {} + minipass@7.1.3: {} - once@1.4.0: - dependencies: - wrappy: 1.0.2 + normalize-url@8.1.1: {} p-cancelable@3.0.0: {} @@ -671,19 +631,22 @@ snapshots: json-parse-even-better-errors: 2.3.1 lines-and-columns: 1.2.4 + path-scurry@2.0.2: + dependencies: + lru-cache: 11.3.5 + minipass: 7.1.3 + path-type@4.0.0: {} picocolors@1.1.1: {} pluralize@8.0.0: {} - prettier@2.8.8: + prettier@3.8.3: optional: true proto-list@1.2.4: {} - punycode@2.3.1: {} - quick-lru@5.1.1: {} rc@1.2.8: @@ -719,18 +682,18 @@ snapshots: astral-regex: 2.0.0 is-fullwidth-code-point: 3.0.0 - solhint@6.0.3: + solhint@6.2.1: dependencies: '@solidity-parser/parser': 0.20.2 - ajv: 6.15.0 - ajv-errors: 1.0.1(ajv@6.15.0) + ajv: 8.20.0 + ajv-errors: 3.0.0(ajv@8.20.0) ast-parents: 0.0.1 - better-ajv-errors: 2.0.3(ajv@6.15.0) + better-ajv-errors: 2.0.3(ajv@8.20.0) chalk: 4.1.2 commander: 10.0.1 cosmiconfig: 8.3.6 fast-diff: 1.3.0 - glob: 8.1.0 + glob: 13.0.6 ignore: 5.3.2 js-yaml: 4.1.1 latest-version: 7.0.0 @@ -740,7 +703,7 @@ snapshots: table: 6.9.0 text-table: 0.2.0 optionalDependencies: - prettier: 2.8.8 + prettier: 3.8.3 transitivePeerDependencies: - typescript @@ -769,9 +732,3 @@ snapshots: strip-ansi: 6.0.1 text-table@0.2.0: {} - - uri-js@4.4.1: - dependencies: - punycode: 2.3.1 - - wrappy@1.0.2: {} diff --git a/script/.solhint.json b/script/.solhint.json new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/script/.solhint.json @@ -0,0 +1 @@ +{} diff --git a/script/Counter.s.sol b/script/Counter.s.sol index 7c3df20..75d5dce 100644 --- a/script/Counter.s.sol +++ b/script/Counter.s.sol @@ -4,16 +4,17 @@ pragma solidity ^0.8; import {Counter} from "../src/Counter.sol"; import {Script} from "forge-std/Script.sol"; +/// @title CounterScript +/// @author CoW DAO Developers +/// @notice Script to deploy the Counter contract contract CounterScript is Script { + /// @notice The deployed Counter contract Counter public counter; - function setUp() public {} - + /// @notice Run the script function run() public { vm.startBroadcast(); - counter = new Counter(); - vm.stopBroadcast(); } } diff --git a/src/Counter.sol b/src/Counter.sol index 28ed0cd..91a364d 100644 --- a/src/Counter.sol +++ b/src/Counter.sol @@ -1,14 +1,21 @@ // SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8; +/// @title Counter +/// @author CoW DAO developers +/// @notice Simple counter contract used by the template. contract Counter { + /// @notice The stored counter value. uint256 public number; + /// @notice Set the counter to a new value. + /// @param newNumber The value to store. function setNumber(uint256 newNumber) public { number = newNumber; } + /// @notice Increase the counter by one. function increment() public { - number++; + ++number; } } diff --git a/test/.solhint.json b/test/.solhint.json new file mode 100644 index 0000000..f02cc02 --- /dev/null +++ b/test/.solhint.json @@ -0,0 +1,6 @@ +{ + "rules": { + "func-name-mixedcase": "off", + "use-natspec": "off" + } +}