From 286e6af42357dc08acc23659ac6d486dff458478 Mon Sep 17 00:00:00 2001 From: Rens Rooimans Date: Wed, 15 May 2024 21:24:25 +0200 Subject: [PATCH] Fix all solhint issues (#13185) * bump versions * fix vrf * fix shared * fix operatorforwarder * fix llo-feeds * fix l2ep * fix interfaces * fix functions * fix automation * changeset --- contracts/.changeset/fuzzy-bags-watch.md | 5 ++ contracts/.solhintignore | 2 + contracts/package.json | 8 +- contracts/pnpm-lock.yaml | 74 +++++++++---------- .../dev/v2_3/AutomationRegistrar2_3.sol | 1 + .../dev/v2_3/AutomationRegistryBase2_3.sol | 4 + .../dev/v2_3/AutomationRegistryLogicB2_3.sol | 2 + .../AutomationCompatibleInterface.sol | 1 + .../interfaces/IAutomationV21PlusCommon.sol | 2 + .../MigratableKeeperRegistryInterfaceV2.sol | 4 +- .../StreamsLookupCompatibleInterface.sol | 1 + .../interfaces/UpkeepTranscoderInterface.sol | 6 +- .../UpkeepTranscoderInterfaceV2.sol | 2 +- .../v0.8/automation/test/StructFactory.sol | 7 -- .../automation/v2_2/AutomationRegistry2_2.sol | 1 + .../v2_2/AutomationRegistryBase2_2.sol | 3 + .../functions/dev/v1_X/FunctionsRouter.sol | 1 + .../dev/v1_X/mocks/FunctionsV1EventsMock.sol | 2 + .../v0.8/functions/dev/v1_X/ocr/OCR2Base.sol | 1 + .../v0.8/functions/v1_1_0/ocr/OCR2Base.sol | 1 + .../v0.8/functions/v1_3_0/ocr/OCR2Base.sol | 1 + .../interfaces/ChainlinkRequestInterface.sol | 1 + .../src/v0.8/interfaces/ENSInterface.sol | 1 + .../v0.8/interfaces/FeedRegistryInterface.sol | 1 + .../src/v0.8/interfaces/FlagsInterface.sol | 1 + .../src/v0.8/interfaces/OperatorInterface.sol | 1 + .../src/v0.8/interfaces/OracleInterface.sol | 1 + .../src/v0.8/interfaces/PoRAddressList.sol | 1 + .../src/v0.8/interfaces/PointerInterface.sol | 1 + .../ArbitrumSequencerUptimeFeedInterface.sol | 1 + .../CrossDomainOwnableInterface.sol | 1 + .../interfaces/DelegateForwarderInterface.sol | 1 + .../l2ep/dev/interfaces/FlagsInterface.sol | 1 + .../dev/interfaces/ForwarderInterface.sol | 1 + .../OptimismSequencerUptimeFeedInterface.sol | 1 + .../ScrollSequencerUptimeFeedInterface.sol | 1 + .../v0.8/llo-feeds/dev/ChannelConfigStore.sol | 1 + .../test/testhelpers/Callback.sol | 1 + .../test/testhelpers/Consumer.sol | 1 + .../MaliciousMultiWordConsumer.sol | 2 + .../test/testhelpers/MockReceiver.sol | 1 + .../test/testhelpers/MultiWordConsumer.sol | 1 + contracts/src/v0.8/shared/ocr2/OCR2Base.sol | 1 + .../shared/test/helpers/ChainReaderTester.sol | 1 + .../src/v0.8/vrf/BatchBlockhashStore.sol | 1 + .../src/v0.8/vrf/BatchVRFCoordinatorV2.sol | 1 + contracts/src/v0.8/vrf/VRFV2Wrapper.sol | 1 + .../src/v0.8/vrf/dev/VRFCoordinatorV2_5.sol | 1 + .../VRFCoordinatorV2PlusUpgradedVersion.sol | 1 + .../VRFCoordinatorV2Plus_V2Example.sol | 1 + .../VRFV2PlusSingleConsumerExample.sol | 1 + .../VRFV2PlusWrapperConsumerExample.sol | 1 + .../VRFV2PlusWrapperLoadTestConsumer.sol | 1 + .../interfaces/BlockhashStoreInterface.sol | 1 + .../interfaces/VRFCoordinatorV2Interface.sol | 1 + .../vrf/interfaces/VRFV2WrapperInterface.sol | 1 + 56 files changed, 110 insertions(+), 55 deletions(-) create mode 100644 contracts/.changeset/fuzzy-bags-watch.md delete mode 100644 contracts/src/v0.8/automation/test/StructFactory.sol diff --git a/contracts/.changeset/fuzzy-bags-watch.md b/contracts/.changeset/fuzzy-bags-watch.md new file mode 100644 index 00000000000..31e164df424 --- /dev/null +++ b/contracts/.changeset/fuzzy-bags-watch.md @@ -0,0 +1,5 @@ +--- +"@chainlink/contracts": patch +--- + +fix solhint issues diff --git a/contracts/.solhintignore b/contracts/.solhintignore index 7d0d5f40b29..ed395d93657 100644 --- a/contracts/.solhintignore +++ b/contracts/.solhintignore @@ -21,6 +21,8 @@ ./src/v0.8/automation/libraries/internal/Cron.sol ./src/v0.8/automation/AutomationForwarder.sol ./src/v0.8/automation/AutomationForwarderLogic.sol +./src/v0.8/automation/interfaces/v2_2/IAutomationRegistryMaster.sol +./src/v0.8/automation/dev/interfaces/v2_3/IAutomationRegistryMaster2_3.sol # Ignore tests / test helpers (for now) diff --git a/contracts/package.json b/contracts/package.json index 58204489ebe..306f8284b5c 100644 --- a/contracts/package.json +++ b/contracts/package.json @@ -18,7 +18,7 @@ "prepublishOnly": "pnpm compile && ./scripts/prepublish_generate_abi_folder", "publish-beta": "pnpm publish --tag beta", "publish-prod": "pnpm publish --tag latest", - "solhint": "solhint --max-warnings 69 \"./src/v0.8/**/*.sol\"" + "solhint": "solhint --max-warnings 0 \"./src/v0.8/**/*.sol\"" }, "files": [ "src/v0.8", @@ -48,7 +48,7 @@ "@types/debug": "^4.1.12", "@types/deep-equal-in-any-order": "^1.0.3", "@types/mocha": "^10.0.6", - "@types/node": "^20.12.10", + "@types/node": "^20.12.11", "@typescript-eslint/eslint-plugin": "^6.21.0", "@typescript-eslint/parser": "^6.21.0", "abi-to-sol": "^0.6.6", @@ -66,7 +66,7 @@ "moment": "^2.30.1", "prettier": "^3.2.5", "prettier-plugin-solidity": "^1.3.1", - "solhint": "^4.5.4", + "solhint": "^5.0.1", "solhint-plugin-chainlink-solidity": "git+https://github.com/smartcontractkit/chainlink-solhint-rules.git#v1.2.1", "solhint-plugin-prettier": "^0.1.0", "ts-node": "^10.9.2", @@ -80,6 +80,6 @@ "@openzeppelin/contracts": "4.9.3", "@openzeppelin/contracts-upgradeable": "4.9.3", "@scroll-tech/contracts": "0.1.0", - "semver": "^7.6.1" + "semver": "^7.6.2" } } diff --git a/contracts/pnpm-lock.yaml b/contracts/pnpm-lock.yaml index 13e7b29b96e..51a4ad6a4ca 100644 --- a/contracts/pnpm-lock.yaml +++ b/contracts/pnpm-lock.yaml @@ -27,8 +27,8 @@ dependencies: specifier: 0.1.0 version: 0.1.0 semver: - specifier: ^7.6.1 - version: 7.6.1 + specifier: ^7.6.2 + version: 7.6.2 devDependencies: '@ethereum-waffle/mock-contract': @@ -80,8 +80,8 @@ devDependencies: specifier: ^10.0.6 version: 10.0.6 '@types/node': - specifier: ^20.12.10 - version: 20.12.10 + specifier: ^20.12.11 + version: 20.12.11 '@typescript-eslint/eslint-plugin': specifier: ^6.21.0 version: 6.21.0(@typescript-eslint/parser@6.21.0)(eslint@8.57.0)(typescript@5.4.5) @@ -134,8 +134,8 @@ devDependencies: specifier: ^1.3.1 version: 1.3.1(prettier@3.2.5) solhint: - specifier: ^4.5.4 - version: 4.5.4 + specifier: ^5.0.1 + version: 5.0.1 solhint-plugin-chainlink-solidity: specifier: git+https://github.com/smartcontractkit/chainlink-solhint-rules.git#v1.2.1 version: github.com/smartcontractkit/chainlink-solhint-rules/1b4c0c2663fcd983589d4f33a2e73908624ed43c @@ -144,7 +144,7 @@ devDependencies: version: 0.1.0(prettier-plugin-solidity@1.3.1)(prettier@3.2.5) ts-node: specifier: ^10.9.2 - version: 10.9.2(@types/node@20.12.10)(typescript@5.4.5) + version: 10.9.2(@types/node@20.12.11)(typescript@5.4.5) typechain: specifier: ^8.2.1 version: 8.3.2(typescript@5.4.5) @@ -198,7 +198,7 @@ packages: outdent: 0.5.0 prettier: 2.8.8 resolve-from: 5.0.0 - semver: 7.6.1 + semver: 7.6.2 dev: false /@changesets/assemble-release-plan@5.2.4: @@ -209,7 +209,7 @@ packages: '@changesets/get-dependents-graph': 1.3.6 '@changesets/types': 5.2.1 '@manypkg/get-packages': 1.1.3 - semver: 7.6.1 + semver: 7.6.2 dev: false /@changesets/changelog-git@0.1.14: @@ -261,7 +261,7 @@ packages: p-limit: 2.3.0 preferred-pm: 3.1.3 resolve-from: 5.0.0 - semver: 7.6.1 + semver: 7.6.2 spawndamnit: 2.0.0 term-size: 2.2.1 tty-table: 4.2.3 @@ -292,7 +292,7 @@ packages: '@manypkg/get-packages': 1.1.3 chalk: 2.4.2 fs-extra: 7.0.1 - semver: 7.6.1 + semver: 7.6.2 dev: false /@changesets/get-github-info@0.5.2: @@ -1444,13 +1444,13 @@ packages: /@types/bn.js@4.11.6: resolution: {integrity: sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg==} dependencies: - '@types/node': 20.12.10 + '@types/node': 20.12.11 dev: true /@types/bn.js@5.1.1: resolution: {integrity: sha512-qNrYbZqMx0uJAfKnKclPh+dTwK33KfLHYqtyODwd5HnXOjnkhc4qgn3BrK6RWyGZm5+sIFE7Q7Vz6QQtJB7w7g==} dependencies: - '@types/node': 20.12.10 + '@types/node': 20.12.11 dev: true /@types/cacheable-request@6.0.2: @@ -1458,14 +1458,14 @@ packages: dependencies: '@types/http-cache-semantics': 4.0.1 '@types/keyv': 3.1.4 - '@types/node': 20.12.10 + '@types/node': 20.12.11 '@types/responselike': 1.0.0 dev: true /@types/cbor@5.0.1: resolution: {integrity: sha512-zVqJy2KzusZPLOgyGJDnOIbu3DxIGGqxYbEwtEEe4Z+la8jwIhOyb+GMrlHafs5tvKruwf8f8qOYP6zTvse/pw==} dependencies: - '@types/node': 20.12.10 + '@types/node': 20.12.11 dev: true /@types/chai-as-promised@7.1.8: @@ -1505,7 +1505,7 @@ packages: /@types/keyv@3.1.4: resolution: {integrity: sha512-BQ5aZNSCpj7D6K2ksrRCTmKRLEpnPvWDiLPfoGyhZ++8YtiK9d/3DBKPJgry359X/P1PfruyYwvnvwFjuEiEIg==} dependencies: - '@types/node': 20.12.10 + '@types/node': 20.12.11 dev: true /@types/lru-cache@5.1.1: @@ -1528,8 +1528,8 @@ packages: resolution: {integrity: sha512-7xHmXm/QJ7cbK2laF+YYD7gb5MggHIIQwqyjin3bpEGiSuvScMQ5JZZXPvRipi1MwckTQbJZROMns/JxdnIL1Q==} dev: false - /@types/node@20.12.10: - resolution: {integrity: sha512-Eem5pH9pmWBHoGAT8Dr5fdc5rYA+4NAovdM4EktRPVAAiJhmWWfQrA0cFhAbOsQdSfIHjAud6YdkbL69+zSKjw==} + /@types/node@20.12.11: + resolution: {integrity: sha512-vDg9PZ/zi+Nqp6boSOT7plNuthRugEKixDv5sFTIpkE89MmNtEArAShI4mxuX2+UrLEe9pxC1vm2cjm9YlWbJw==} dependencies: undici-types: 5.26.5 dev: true @@ -1541,7 +1541,7 @@ packages: /@types/pbkdf2@3.1.0: resolution: {integrity: sha512-Cf63Rv7jCQ0LaL8tNXmEyqTHuIJxRdlS5vMh1mj5voN4+QFhVZnlZruezqpWYDiJ8UTzhP0VmeLXCmBk66YrMQ==} dependencies: - '@types/node': 20.12.10 + '@types/node': 20.12.11 dev: true /@types/prettier@2.7.1: @@ -1551,20 +1551,20 @@ packages: /@types/readable-stream@2.3.15: resolution: {integrity: sha512-oM5JSKQCcICF1wvGgmecmHldZ48OZamtMxcGGVICOJA8o8cahXC1zEVAif8iwoc5j8etxFaRFnf095+CDsuoFQ==} dependencies: - '@types/node': 20.12.10 + '@types/node': 20.12.11 safe-buffer: 5.1.2 dev: true /@types/responselike@1.0.0: resolution: {integrity: sha512-85Y2BjiufFzaMIlvJDvTTB8Fxl2xfLo4HgmHzVBz08w4wDePCTjYw66PdrolO0kzli3yam/YCgRufyo1DdQVTA==} dependencies: - '@types/node': 20.12.10 + '@types/node': 20.12.11 dev: true /@types/secp256k1@4.0.3: resolution: {integrity: sha512-Da66lEIFeIz9ltsdMZcpQvmrmmoqrfju8pm1BH8WbYjZSwUgCwXLb9C+9XYogwBITnbsSaMdVPb2ekf7TV+03w==} dependencies: - '@types/node': 20.12.10 + '@types/node': 20.12.11 dev: true /@types/semver@7.5.0: @@ -1592,7 +1592,7 @@ packages: graphemer: 1.4.0 ignore: 5.2.4 natural-compare: 1.4.0 - semver: 7.6.1 + semver: 7.6.2 ts-api-utils: 1.0.3(typescript@5.4.5) typescript: 5.4.5 transitivePeerDependencies: @@ -1668,7 +1668,7 @@ packages: globby: 11.1.0 is-glob: 4.0.3 minimatch: 9.0.3 - semver: 7.6.1 + semver: 7.6.2 ts-api-utils: 1.0.3(typescript@5.4.5) typescript: 5.4.5 transitivePeerDependencies: @@ -1688,7 +1688,7 @@ packages: '@typescript-eslint/types': 6.21.0 '@typescript-eslint/typescript-estree': 6.21.0(typescript@5.4.5) eslint: 8.57.0 - semver: 7.6.1 + semver: 7.6.2 transitivePeerDependencies: - supports-color - typescript @@ -1715,7 +1715,7 @@ packages: ajv: 6.12.6 better-ajv-errors: 0.8.2(ajv@6.12.6) neodoc: 2.0.2 - semver: 7.6.1 + semver: 7.6.2 source-map-support: 0.5.21 optionalDependencies: prettier: 2.8.8 @@ -3445,7 +3445,7 @@ packages: solc: 0.7.3(debug@4.3.4) source-map-support: 0.5.21 stacktrace-parser: 0.1.10 - ts-node: 10.9.2(@types/node@20.12.10)(typescript@5.4.5) + ts-node: 10.9.2(@types/node@20.12.11)(typescript@5.4.5) tsort: 0.0.1 typescript: 5.4.5 undici: 5.28.4 @@ -4466,7 +4466,7 @@ packages: got: 12.1.0 registry-auth-token: 5.0.2 registry-url: 6.0.1 - semver: 7.6.1 + semver: 7.6.2 dev: true /param-case@2.1.1: @@ -4600,7 +4600,7 @@ packages: dependencies: '@solidity-parser/parser': 0.17.0 prettier: 2.8.8 - semver: 7.6.1 + semver: 7.6.2 solidity-comments-extractor: 0.0.8 dev: true optional: true @@ -4613,7 +4613,7 @@ packages: dependencies: '@solidity-parser/parser': 0.17.0 prettier: 3.2.5 - semver: 7.6.1 + semver: 7.6.2 solidity-comments-extractor: 0.0.8 dev: true @@ -4917,8 +4917,8 @@ packages: hasBin: true dev: true - /semver@7.6.1: - resolution: {integrity: sha512-f/vbBsu+fOiYt+lmwZV0rVwJScl46HppnOA1ZvIuBWKOTlllpyJ3bfVax76/OrhCH38dyxoDIA8K7uB963IYgA==} + /semver@7.6.2: + resolution: {integrity: sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==} engines: {node: '>=10'} hasBin: true @@ -5076,8 +5076,8 @@ packages: prettier-plugin-solidity: 1.3.1(prettier@3.2.5) dev: true - /solhint@4.5.4: - resolution: {integrity: sha512-Cu1XiJXub2q1eCr9kkJ9VPv1sGcmj3V7Zb76B0CoezDOB9bu3DxKIFFH7ggCl9fWpEPD6xBmRLfZrYijkVmujQ==} + /solhint@5.0.1: + resolution: {integrity: sha512-QeQLS9HGCnIiibt+xiOa/+MuP7BWz9N7C5+Mj9pLHshdkNhuo3AzCpWmjfWVZBUuwIUO3YyCRVIcYLR3YOKGfg==} hasBin: true dependencies: '@solidity-parser/parser': 0.18.0 @@ -5094,7 +5094,7 @@ packages: latest-version: 7.0.0 lodash: 4.17.21 pluralize: 8.0.0 - semver: 7.6.1 + semver: 7.6.2 strip-ansi: 6.0.1 table: 6.8.1 text-table: 0.2.0 @@ -5488,7 +5488,7 @@ packages: typescript: 5.4.5 dev: true - /ts-node@10.9.2(@types/node@20.12.10)(typescript@5.4.5): + /ts-node@10.9.2(@types/node@20.12.11)(typescript@5.4.5): resolution: {integrity: sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==} hasBin: true peerDependencies: @@ -5507,7 +5507,7 @@ packages: '@tsconfig/node12': 1.0.11 '@tsconfig/node14': 1.0.3 '@tsconfig/node16': 1.0.3 - '@types/node': 20.12.10 + '@types/node': 20.12.11 acorn: 8.10.0 acorn-walk: 8.2.0 arg: 4.1.3 diff --git a/contracts/src/v0.8/automation/dev/v2_3/AutomationRegistrar2_3.sol b/contracts/src/v0.8/automation/dev/v2_3/AutomationRegistrar2_3.sol index 8d4bf17ce91..4476ac690a2 100644 --- a/contracts/src/v0.8/automation/dev/v2_3/AutomationRegistrar2_3.sol +++ b/contracts/src/v0.8/automation/dev/v2_3/AutomationRegistrar2_3.sol @@ -68,6 +68,7 @@ contract AutomationRegistrar2_3 is TypeAndVersionInterface, ConfirmedOwner, IERC * @member autoApproveType the auto approval setting (see enum) * @member autoApproveMaxAllowed the max number of upkeeps that can be auto approved of this type */ + // solhint-disable-next-line gas-struct-packing struct InitialTriggerConfig { uint8 triggerType; AutoApproveType autoApproveType; diff --git a/contracts/src/v0.8/automation/dev/v2_3/AutomationRegistryBase2_3.sol b/contracts/src/v0.8/automation/dev/v2_3/AutomationRegistryBase2_3.sol index 2dbc406b0e1..d2e34303df5 100644 --- a/contracts/src/v0.8/automation/dev/v2_3/AutomationRegistryBase2_3.sol +++ b/contracts/src/v0.8/automation/dev/v2_3/AutomationRegistryBase2_3.sol @@ -20,6 +20,7 @@ import {IWrappedNative} from "../interfaces/v2_3/IWrappedNative.sol"; * AutomationRegistry and AutomationRegistryLogic * @dev all errors, events, and internal functions should live here */ +// solhint-disable-next-line max-states-count abstract contract AutomationRegistryBase2_3 is ConfirmedOwner { using Address for address; using EnumerableSet for EnumerableSet.UintSet; @@ -376,6 +377,7 @@ abstract contract AutomationRegistryBase2_3 is ConfirmedOwner { * @notice the billing config of a token * @dev this is a storage struct */ + // solhint-disable-next-line gas-struct-packing struct BillingConfig { uint32 gasFeePPB; uint24 flatFeeMilliCents; // min fee is $0.00001, max fee is $167 @@ -438,6 +440,7 @@ abstract contract AutomationRegistryBase2_3 is ConfirmedOwner { * @member gasReimbursementInJuels the amount to reimburse a node for gas spent * @member premiumInJuels the premium paid to NOPs, shared between all nodes */ + // solhint-disable-next-line gas-struct-packing struct PaymentReceipt { uint96 gasChargeInBillingToken; uint96 premiumInBillingToken; @@ -1066,6 +1069,7 @@ abstract contract AutomationRegistryBase2_3 is ConfirmedOwner { * @notice only allows a pre-configured address to initiate offchain read */ function _preventExecution() internal view { + // solhint-disable-next-line avoid-tx-origin if (tx.origin != i_allowedReadOnlyAddress) { revert OnlySimulatedBackend(); } diff --git a/contracts/src/v0.8/automation/dev/v2_3/AutomationRegistryLogicB2_3.sol b/contracts/src/v0.8/automation/dev/v2_3/AutomationRegistryLogicB2_3.sol index dbdc563d9ba..29f253f8ce3 100644 --- a/contracts/src/v0.8/automation/dev/v2_3/AutomationRegistryLogicB2_3.sol +++ b/contracts/src/v0.8/automation/dev/v2_3/AutomationRegistryLogicB2_3.sol @@ -95,6 +95,7 @@ contract AutomationRegistryLogicB2_3 is AutomationRegistryBase2_3, Chainable { bytes memory callData = _checkPayload(id, triggerType, triggerData); gasUsed = gasleft(); + // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory result) = upkeep.forwarder.getTarget().call{gas: s_storage.checkGasLimit}(callData); gasUsed = gasUsed - gasleft(); @@ -196,6 +197,7 @@ contract AutomationRegistryLogicB2_3 is AutomationRegistryBase2_3, Chainable { Upkeep memory upkeep = s_upkeep[id]; gasUsed = gasleft(); + // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory result) = upkeep.forwarder.getTarget().call{gas: s_storage.checkGasLimit}(payload); gasUsed = gasUsed - gasleft(); if (!success) { diff --git a/contracts/src/v0.8/automation/interfaces/AutomationCompatibleInterface.sol b/contracts/src/v0.8/automation/interfaces/AutomationCompatibleInterface.sol index a60e3f91543..ae920822c35 100644 --- a/contracts/src/v0.8/automation/interfaces/AutomationCompatibleInterface.sol +++ b/contracts/src/v0.8/automation/interfaces/AutomationCompatibleInterface.sol @@ -1,6 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; +// solhint-disable-next-line interface-starts-with-i interface AutomationCompatibleInterface { /** * @notice method that is simulated by the keepers to see if any work actually diff --git a/contracts/src/v0.8/automation/interfaces/IAutomationV21PlusCommon.sol b/contracts/src/v0.8/automation/interfaces/IAutomationV21PlusCommon.sol index 2ce2db60e1f..6e3d0d72f79 100644 --- a/contracts/src/v0.8/automation/interfaces/IAutomationV21PlusCommon.sol +++ b/contracts/src/v0.8/automation/interfaces/IAutomationV21PlusCommon.sol @@ -141,6 +141,7 @@ interface IAutomationV21PlusCommon { * @member latestEpoch for which a report was transmitted * @member paused freeze on execution scoped to the entire registry */ + // solhint-disable-next-line gas-struct-packing struct StateLegacy { uint32 nonce; uint96 ownerLinkBalance; @@ -178,6 +179,7 @@ interface IAutomationV21PlusCommon { * @member registrars addresses of the registrar contracts * @member upkeepPrivilegeManager address which can set privilege for upkeeps */ + // solhint-disable-next-line gas-struct-packing struct OnchainConfigLegacy { uint32 paymentPremiumPPB; uint32 flatFeeMicroLink; // min 0.000001 LINK, max 4294 LINK diff --git a/contracts/src/v0.8/automation/interfaces/MigratableKeeperRegistryInterfaceV2.sol b/contracts/src/v0.8/automation/interfaces/MigratableKeeperRegistryInterfaceV2.sol index 17ca3673dc2..d6dcc03dd28 100644 --- a/contracts/src/v0.8/automation/interfaces/MigratableKeeperRegistryInterfaceV2.sol +++ b/contracts/src/v0.8/automation/interfaces/MigratableKeeperRegistryInterfaceV2.sol @@ -1,9 +1,7 @@ // SPDX-License-Identifier: MIT - pragma solidity ^0.8.0; -import "../UpkeepFormat.sol"; - +// solhint-disable-next-line interface-starts-with-i interface MigratableKeeperRegistryInterfaceV2 { /** * @notice Migrates upkeeps from one registry to another, including LINK and upkeep params. diff --git a/contracts/src/v0.8/automation/interfaces/StreamsLookupCompatibleInterface.sol b/contracts/src/v0.8/automation/interfaces/StreamsLookupCompatibleInterface.sol index b6ab3123f87..ed873a0ee53 100644 --- a/contracts/src/v0.8/automation/interfaces/StreamsLookupCompatibleInterface.sol +++ b/contracts/src/v0.8/automation/interfaces/StreamsLookupCompatibleInterface.sol @@ -1,6 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; +// solhint-disable-next-line interface-starts-with-i interface StreamsLookupCompatibleInterface { error StreamsLookup(string feedParamKey, string[] feeds, string timeParamKey, uint256 time, bytes extraData); diff --git a/contracts/src/v0.8/automation/interfaces/UpkeepTranscoderInterface.sol b/contracts/src/v0.8/automation/interfaces/UpkeepTranscoderInterface.sol index aa0c3c6a7f0..59d2bb4a4fa 100644 --- a/contracts/src/v0.8/automation/interfaces/UpkeepTranscoderInterface.sol +++ b/contracts/src/v0.8/automation/interfaces/UpkeepTranscoderInterface.sol @@ -1,9 +1,9 @@ // SPDX-License-Identifier: MIT - -import "../UpkeepFormat.sol"; - pragma solidity ^0.8.0; +import {UpkeepFormat} from "../UpkeepFormat.sol"; + +// solhint-disable-next-line interface-starts-with-i interface UpkeepTranscoderInterface { function transcodeUpkeeps( UpkeepFormat fromVersion, diff --git a/contracts/src/v0.8/automation/interfaces/UpkeepTranscoderInterfaceV2.sol b/contracts/src/v0.8/automation/interfaces/UpkeepTranscoderInterfaceV2.sol index e02d0f670a7..95dc3072365 100644 --- a/contracts/src/v0.8/automation/interfaces/UpkeepTranscoderInterfaceV2.sol +++ b/contracts/src/v0.8/automation/interfaces/UpkeepTranscoderInterfaceV2.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT - pragma solidity ^0.8.0; +// solhint-disable-next-line interface-starts-with-i interface UpkeepTranscoderInterfaceV2 { function transcodeUpkeeps( uint8 fromVersion, diff --git a/contracts/src/v0.8/automation/test/StructFactory.sol b/contracts/src/v0.8/automation/test/StructFactory.sol deleted file mode 100644 index 9317244a31e..00000000000 --- a/contracts/src/v0.8/automation/test/StructFactory.sol +++ /dev/null @@ -1,7 +0,0 @@ -// SPDX-License-Identifier: BUSL-1.1 -pragma solidity ^0.8.0; - -contract StructFactory { - address internal OWNER; - address internal constant STRANGER = address(999); -} diff --git a/contracts/src/v0.8/automation/v2_2/AutomationRegistry2_2.sol b/contracts/src/v0.8/automation/v2_2/AutomationRegistry2_2.sol index 8add9568d26..f0c703679ca 100644 --- a/contracts/src/v0.8/automation/v2_2/AutomationRegistry2_2.sol +++ b/contracts/src/v0.8/automation/v2_2/AutomationRegistry2_2.sol @@ -60,6 +60,7 @@ contract AutomationRegistry2_2 is AutomationRegistryBase2_2, OCR2Abstract, Chain /** * @notice holds the variables used in the transmit function, necessary to avoid stack too deep errors */ + // solhint-disable-next-line gas-struct-packing struct TransmitVars { uint16 numUpkeepsPassedChecks; uint256 totalCalldataWeight; diff --git a/contracts/src/v0.8/automation/v2_2/AutomationRegistryBase2_2.sol b/contracts/src/v0.8/automation/v2_2/AutomationRegistryBase2_2.sol index de91cd13542..6903f55212a 100644 --- a/contracts/src/v0.8/automation/v2_2/AutomationRegistryBase2_2.sol +++ b/contracts/src/v0.8/automation/v2_2/AutomationRegistryBase2_2.sol @@ -18,6 +18,7 @@ import {IChainModule} from "../interfaces/IChainModule.sol"; * AutomationRegistry and AutomationRegistryLogic * @dev all errors, events, and internal functions should live here */ +// solhint-disable-next-line max-states-count abstract contract AutomationRegistryBase2_2 is ConfirmedOwner { using Address for address; using EnumerableSet for EnumerableSet.UintSet; @@ -207,6 +208,7 @@ abstract contract AutomationRegistryBase2_2 is ConfirmedOwner { * @member reorgProtectionEnabled if this registry enables re-org protection checks * @member chainModule the chain specific module */ + // solhint-disable-next-line gas-struct-packing struct OnchainConfig { uint32 paymentPremiumPPB; uint32 flatFeeMicroLink; // min 0.000001 LINK, max 4294 LINK @@ -851,6 +853,7 @@ abstract contract AutomationRegistryBase2_2 is ConfirmedOwner { * @notice only allows a pre-configured address to initiate offchain read */ function _preventExecution() internal view { + // solhint-disable-next-line avoid-tx-origin if (tx.origin != i_allowedReadOnlyAddress) { revert OnlySimulatedBackend(); } diff --git a/contracts/src/v0.8/functions/dev/v1_X/FunctionsRouter.sol b/contracts/src/v0.8/functions/dev/v1_X/FunctionsRouter.sol index 5cdb119354a..ec1ccbdda15 100644 --- a/contracts/src/v0.8/functions/dev/v1_X/FunctionsRouter.sol +++ b/contracts/src/v0.8/functions/dev/v1_X/FunctionsRouter.sol @@ -84,6 +84,7 @@ contract FunctionsRouter is IFunctionsRouter, FunctionsSubscriptions, Pausable, // ================================================================ // | Configuration state | // ================================================================ + // solhint-disable-next-line gas-struct-packing struct Config { uint16 maxConsumersPerSubscription; // ═════════╗ Maximum number of consumers which can be added to a single subscription. This bound ensures we are able to loop over all subscription consumers as needed, without exceeding gas limits. Should a user require more consumers, they can use multiple subscriptions. uint72 adminFee; // ║ Flat fee (in Juels of LINK) that will be paid to the Router owner for operation of the network diff --git a/contracts/src/v0.8/functions/dev/v1_X/mocks/FunctionsV1EventsMock.sol b/contracts/src/v0.8/functions/dev/v1_X/mocks/FunctionsV1EventsMock.sol index 68b51f89019..ac040ad47a7 100644 --- a/contracts/src/v0.8/functions/dev/v1_X/mocks/FunctionsV1EventsMock.sol +++ b/contracts/src/v0.8/functions/dev/v1_X/mocks/FunctionsV1EventsMock.sol @@ -3,6 +3,7 @@ pragma solidity ^0.8.19; contract FunctionsV1EventsMock { + // solhint-disable-next-line gas-struct-packing struct Config { uint16 maxConsumersPerSubscription; uint72 adminFee; @@ -10,6 +11,7 @@ contract FunctionsV1EventsMock { uint16 gasForCallExactCheck; uint32[] maxCallbackGasLimits; } + event ConfigUpdated(Config param1); event ContractProposed( bytes32 proposedContractSetId, diff --git a/contracts/src/v0.8/functions/dev/v1_X/ocr/OCR2Base.sol b/contracts/src/v0.8/functions/dev/v1_X/ocr/OCR2Base.sol index 02ea5cf3721..4d159594b6d 100644 --- a/contracts/src/v0.8/functions/dev/v1_X/ocr/OCR2Base.sol +++ b/contracts/src/v0.8/functions/dev/v1_X/ocr/OCR2Base.sol @@ -84,6 +84,7 @@ abstract contract OCR2Base is ConfirmedOwner, OCR2Abstract { _; } + // solhint-disable-next-line gas-struct-packing struct SetConfigArgs { address[] signers; address[] transmitters; diff --git a/contracts/src/v0.8/functions/v1_1_0/ocr/OCR2Base.sol b/contracts/src/v0.8/functions/v1_1_0/ocr/OCR2Base.sol index ea1d45ffd46..5bee4360054 100644 --- a/contracts/src/v0.8/functions/v1_1_0/ocr/OCR2Base.sol +++ b/contracts/src/v0.8/functions/v1_1_0/ocr/OCR2Base.sol @@ -76,6 +76,7 @@ abstract contract OCR2Base is ConfirmedOwner, OCR2Abstract { _; } + // solhint-disable-next-line gas-struct-packing struct SetConfigArgs { address[] signers; address[] transmitters; diff --git a/contracts/src/v0.8/functions/v1_3_0/ocr/OCR2Base.sol b/contracts/src/v0.8/functions/v1_3_0/ocr/OCR2Base.sol index 310107f2446..caa9c301a33 100644 --- a/contracts/src/v0.8/functions/v1_3_0/ocr/OCR2Base.sol +++ b/contracts/src/v0.8/functions/v1_3_0/ocr/OCR2Base.sol @@ -84,6 +84,7 @@ abstract contract OCR2Base is ConfirmedOwner, OCR2Abstract { _; } + // solhint-disable-next-line gas-struct-packing struct SetConfigArgs { address[] signers; address[] transmitters; diff --git a/contracts/src/v0.8/interfaces/ChainlinkRequestInterface.sol b/contracts/src/v0.8/interfaces/ChainlinkRequestInterface.sol index 62e443fd6dc..5ee9cbb077d 100644 --- a/contracts/src/v0.8/interfaces/ChainlinkRequestInterface.sol +++ b/contracts/src/v0.8/interfaces/ChainlinkRequestInterface.sol @@ -1,6 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; +// solhint-disable-next-line interface-starts-with-i interface ChainlinkRequestInterface { function oracleRequest( address sender, diff --git a/contracts/src/v0.8/interfaces/ENSInterface.sol b/contracts/src/v0.8/interfaces/ENSInterface.sol index 8e7fb581d00..2592b693ad0 100644 --- a/contracts/src/v0.8/interfaces/ENSInterface.sol +++ b/contracts/src/v0.8/interfaces/ENSInterface.sol @@ -1,6 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; +// solhint-disable-next-line interface-starts-with-i interface ENSInterface { // Logged when the owner of a node assigns a new owner to a subnode. event NewOwner(bytes32 indexed node, bytes32 indexed label, address owner); diff --git a/contracts/src/v0.8/interfaces/FeedRegistryInterface.sol b/contracts/src/v0.8/interfaces/FeedRegistryInterface.sol index f3272174ae2..6e353a79263 100644 --- a/contracts/src/v0.8/interfaces/FeedRegistryInterface.sol +++ b/contracts/src/v0.8/interfaces/FeedRegistryInterface.sol @@ -4,6 +4,7 @@ pragma abicoder v2; import {AggregatorV2V3Interface} from "../shared/interfaces/AggregatorV2V3Interface.sol"; +// solhint-disable-next-line interface-starts-with-i interface FeedRegistryInterface { struct Phase { uint16 phaseId; diff --git a/contracts/src/v0.8/interfaces/FlagsInterface.sol b/contracts/src/v0.8/interfaces/FlagsInterface.sol index 9d172c789f0..beb2b581e3f 100644 --- a/contracts/src/v0.8/interfaces/FlagsInterface.sol +++ b/contracts/src/v0.8/interfaces/FlagsInterface.sol @@ -1,6 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; +// solhint-disable-next-line interface-starts-with-i interface FlagsInterface { function getFlag(address) external view returns (bool); diff --git a/contracts/src/v0.8/interfaces/OperatorInterface.sol b/contracts/src/v0.8/interfaces/OperatorInterface.sol index 4114cce16d3..b457a50172d 100644 --- a/contracts/src/v0.8/interfaces/OperatorInterface.sol +++ b/contracts/src/v0.8/interfaces/OperatorInterface.sol @@ -4,6 +4,7 @@ pragma solidity ^0.8.0; import {OracleInterface} from "./OracleInterface.sol"; import {ChainlinkRequestInterface} from "./ChainlinkRequestInterface.sol"; +// solhint-disable-next-line interface-starts-with-i interface OperatorInterface is OracleInterface, ChainlinkRequestInterface { function operatorRequest( address sender, diff --git a/contracts/src/v0.8/interfaces/OracleInterface.sol b/contracts/src/v0.8/interfaces/OracleInterface.sol index 40365822e10..6e7aa29e312 100644 --- a/contracts/src/v0.8/interfaces/OracleInterface.sol +++ b/contracts/src/v0.8/interfaces/OracleInterface.sol @@ -1,6 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; +// solhint-disable-next-line interface-starts-with-i interface OracleInterface { function fulfillOracleRequest( bytes32 requestId, diff --git a/contracts/src/v0.8/interfaces/PoRAddressList.sol b/contracts/src/v0.8/interfaces/PoRAddressList.sol index 717c76dbbcf..af06e29a456 100644 --- a/contracts/src/v0.8/interfaces/PoRAddressList.sol +++ b/contracts/src/v0.8/interfaces/PoRAddressList.sol @@ -9,6 +9,7 @@ pragma solidity ^0.8.0; * This makes it possible to store addresses in optimized data types and convert them to human-readable strings * in `getPoRAddressList()`. */ +// solhint-disable-next-line interface-starts-with-i interface PoRAddressList { /// @notice Get total number of addresses in the list. function getPoRAddressListLength() external view returns (uint256); diff --git a/contracts/src/v0.8/interfaces/PointerInterface.sol b/contracts/src/v0.8/interfaces/PointerInterface.sol index ca2b82af56a..ca0b1de8f74 100644 --- a/contracts/src/v0.8/interfaces/PointerInterface.sol +++ b/contracts/src/v0.8/interfaces/PointerInterface.sol @@ -1,6 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; +// solhint-disable-next-line interface-starts-with-i interface PointerInterface { function getAddress() external view returns (address); } diff --git a/contracts/src/v0.8/l2ep/dev/interfaces/ArbitrumSequencerUptimeFeedInterface.sol b/contracts/src/v0.8/l2ep/dev/interfaces/ArbitrumSequencerUptimeFeedInterface.sol index 6943b9fbb91..57b507bae8d 100644 --- a/contracts/src/v0.8/l2ep/dev/interfaces/ArbitrumSequencerUptimeFeedInterface.sol +++ b/contracts/src/v0.8/l2ep/dev/interfaces/ArbitrumSequencerUptimeFeedInterface.sol @@ -1,6 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; +// solhint-disable-next-line interface-starts-with-i interface ArbitrumSequencerUptimeFeedInterface { function updateStatus(bool status, uint64 timestamp) external; } diff --git a/contracts/src/v0.8/l2ep/dev/interfaces/CrossDomainOwnableInterface.sol b/contracts/src/v0.8/l2ep/dev/interfaces/CrossDomainOwnableInterface.sol index a4cc6a9f451..ddcfded9ca2 100644 --- a/contracts/src/v0.8/l2ep/dev/interfaces/CrossDomainOwnableInterface.sol +++ b/contracts/src/v0.8/l2ep/dev/interfaces/CrossDomainOwnableInterface.sol @@ -2,6 +2,7 @@ pragma solidity ^0.8.0; /// @title CrossDomainOwnableInterface - A contract with helpers for cross-domain contract ownership +// solhint-disable-next-line interface-starts-with-i interface CrossDomainOwnableInterface { event L1OwnershipTransferRequested(address indexed from, address indexed to); diff --git a/contracts/src/v0.8/l2ep/dev/interfaces/DelegateForwarderInterface.sol b/contracts/src/v0.8/l2ep/dev/interfaces/DelegateForwarderInterface.sol index 792e83edc5d..498dee586c8 100644 --- a/contracts/src/v0.8/l2ep/dev/interfaces/DelegateForwarderInterface.sol +++ b/contracts/src/v0.8/l2ep/dev/interfaces/DelegateForwarderInterface.sol @@ -2,6 +2,7 @@ pragma solidity ^0.8.0; /// @title DelegateForwarderInterface - forwards a delegatecall to a target, under some conditions +// solhint-disable-next-line interface-starts-with-i interface DelegateForwarderInterface { /** * @notice forward delegatecalls the `target` with `data` diff --git a/contracts/src/v0.8/l2ep/dev/interfaces/FlagsInterface.sol b/contracts/src/v0.8/l2ep/dev/interfaces/FlagsInterface.sol index b5fd70bd8c4..b6491a9d601 100644 --- a/contracts/src/v0.8/l2ep/dev/interfaces/FlagsInterface.sol +++ b/contracts/src/v0.8/l2ep/dev/interfaces/FlagsInterface.sol @@ -1,6 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.6; +// solhint-disable-next-line interface-starts-with-i interface FlagsInterface { function getFlag(address) external view returns (bool); diff --git a/contracts/src/v0.8/l2ep/dev/interfaces/ForwarderInterface.sol b/contracts/src/v0.8/l2ep/dev/interfaces/ForwarderInterface.sol index a3c29e5f786..a6db32b9231 100644 --- a/contracts/src/v0.8/l2ep/dev/interfaces/ForwarderInterface.sol +++ b/contracts/src/v0.8/l2ep/dev/interfaces/ForwarderInterface.sol @@ -2,6 +2,7 @@ pragma solidity ^0.8.0; /// @title ForwarderInterface - forwards a call to a target, under some conditions +// solhint-disable-next-line interface-starts-with-i interface ForwarderInterface { /** * @notice forward calls the `target` with `data` diff --git a/contracts/src/v0.8/l2ep/dev/interfaces/OptimismSequencerUptimeFeedInterface.sol b/contracts/src/v0.8/l2ep/dev/interfaces/OptimismSequencerUptimeFeedInterface.sol index 281966b7999..a08a1b26204 100644 --- a/contracts/src/v0.8/l2ep/dev/interfaces/OptimismSequencerUptimeFeedInterface.sol +++ b/contracts/src/v0.8/l2ep/dev/interfaces/OptimismSequencerUptimeFeedInterface.sol @@ -1,6 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; +// solhint-disable-next-line interface-starts-with-i interface OptimismSequencerUptimeFeedInterface { function updateStatus(bool status, uint64 timestamp) external; } diff --git a/contracts/src/v0.8/l2ep/dev/interfaces/ScrollSequencerUptimeFeedInterface.sol b/contracts/src/v0.8/l2ep/dev/interfaces/ScrollSequencerUptimeFeedInterface.sol index f0f716d6f02..89327fbc3a1 100644 --- a/contracts/src/v0.8/l2ep/dev/interfaces/ScrollSequencerUptimeFeedInterface.sol +++ b/contracts/src/v0.8/l2ep/dev/interfaces/ScrollSequencerUptimeFeedInterface.sol @@ -1,6 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.19; +// solhint-disable-next-line interface-starts-with-i interface ScrollSequencerUptimeFeedInterface { function updateStatus(bool status, uint64 timestamp) external; } diff --git a/contracts/src/v0.8/llo-feeds/dev/ChannelConfigStore.sol b/contracts/src/v0.8/llo-feeds/dev/ChannelConfigStore.sol index ca24b775398..6c6a5ec9b3e 100644 --- a/contracts/src/v0.8/llo-feeds/dev/ChannelConfigStore.sol +++ b/contracts/src/v0.8/llo-feeds/dev/ChannelConfigStore.sol @@ -87,6 +87,7 @@ contract ChannelConfigStore is ConfirmedOwner, IChannelConfigStore, TypeAndVersi } function getChannelDefinitions(uint32 channelId) external view returns (ChannelDefinition memory) { + // solhint-disable-next-line avoid-tx-origin if (msg.sender != tx.origin) { revert OnlyCallableByEOA(); } diff --git a/contracts/src/v0.8/operatorforwarder/test/testhelpers/Callback.sol b/contracts/src/v0.8/operatorforwarder/test/testhelpers/Callback.sol index 9dccfed428a..3d725714c02 100644 --- a/contracts/src/v0.8/operatorforwarder/test/testhelpers/Callback.sol +++ b/contracts/src/v0.8/operatorforwarder/test/testhelpers/Callback.sol @@ -11,6 +11,7 @@ contract Callback { // Callback function for oracle request fulfillment function callback(bytes32) public { + // solhint-disable-next-line gas-custom-errors require(msg.sender == s_operator, "Only Operator can call this function"); s_callbacksReceived += 1; } diff --git a/contracts/src/v0.8/operatorforwarder/test/testhelpers/Consumer.sol b/contracts/src/v0.8/operatorforwarder/test/testhelpers/Consumer.sol index 82709d3def8..3ec32dd6a29 100644 --- a/contracts/src/v0.8/operatorforwarder/test/testhelpers/Consumer.sol +++ b/contracts/src/v0.8/operatorforwarder/test/testhelpers/Consumer.sol @@ -41,6 +41,7 @@ contract Consumer is ChainlinkClient { function withdrawLink() public { LinkTokenInterface _link = LinkTokenInterface(_chainlinkTokenAddress()); + // solhint-disable-next-line gas-custom-errors require(_link.transfer(msg.sender, _link.balanceOf(address(this))), "Unable to transfer"); } diff --git a/contracts/src/v0.8/operatorforwarder/test/testhelpers/MaliciousMultiWordConsumer.sol b/contracts/src/v0.8/operatorforwarder/test/testhelpers/MaliciousMultiWordConsumer.sol index d9d14cb3d43..6e5881524f5 100644 --- a/contracts/src/v0.8/operatorforwarder/test/testhelpers/MaliciousMultiWordConsumer.sol +++ b/contracts/src/v0.8/operatorforwarder/test/testhelpers/MaliciousMultiWordConsumer.sol @@ -35,12 +35,14 @@ contract MaliciousMultiWordConsumer is ChainlinkClient { function stealEthCall(bytes32 _requestId, bytes memory) public recordChainlinkFulfillment(_requestId) { (bool success, ) = address(this).call{value: 100}(""); // solhint-disable-line avoid-call-value + // solhint-disable-next-line gas-custom-errors require(success, "Call failed"); } function stealEthSend(bytes32 _requestId, bytes memory) public recordChainlinkFulfillment(_requestId) { // solhint-disable-next-line check-send-result bool success = payable(address(this)).send(100); // solhint-disable-line multiple-sends + // solhint-disable-next-line gas-custom-errors require(success, "Send failed"); } diff --git a/contracts/src/v0.8/operatorforwarder/test/testhelpers/MockReceiver.sol b/contracts/src/v0.8/operatorforwarder/test/testhelpers/MockReceiver.sol index 4e825b4505f..38a0c3d9269 100644 --- a/contracts/src/v0.8/operatorforwarder/test/testhelpers/MockReceiver.sol +++ b/contracts/src/v0.8/operatorforwarder/test/testhelpers/MockReceiver.sol @@ -9,6 +9,7 @@ contract MockReceiver { } function revertMessage() public pure { + // solhint-disable-next-line gas-custom-errors revert("test revert message"); } diff --git a/contracts/src/v0.8/operatorforwarder/test/testhelpers/MultiWordConsumer.sol b/contracts/src/v0.8/operatorforwarder/test/testhelpers/MultiWordConsumer.sol index fe249831fef..b3fdfcb813a 100644 --- a/contracts/src/v0.8/operatorforwarder/test/testhelpers/MultiWordConsumer.sol +++ b/contracts/src/v0.8/operatorforwarder/test/testhelpers/MultiWordConsumer.sol @@ -86,6 +86,7 @@ contract MultiWordConsumer is ChainlinkClient { function withdrawLink() public { LinkTokenInterface _link = LinkTokenInterface(_chainlinkTokenAddress()); + // solhint-disable-next-line gas-custom-errors require(_link.transfer(msg.sender, _link.balanceOf(address(this))), "Unable to transfer"); } diff --git a/contracts/src/v0.8/shared/ocr2/OCR2Base.sol b/contracts/src/v0.8/shared/ocr2/OCR2Base.sol index 7884d4814f2..7a90f2abf93 100644 --- a/contracts/src/v0.8/shared/ocr2/OCR2Base.sol +++ b/contracts/src/v0.8/shared/ocr2/OCR2Base.sol @@ -79,6 +79,7 @@ abstract contract OCR2Base is OwnerIsCreator, OCR2Abstract { _; } + // solhint-disable-next-line gas-struct-packing struct SetConfigArgs { address[] signers; address[] transmitters; diff --git a/contracts/src/v0.8/shared/test/helpers/ChainReaderTester.sol b/contracts/src/v0.8/shared/test/helpers/ChainReaderTester.sol index 2cc0c44c451..32969acad70 100644 --- a/contracts/src/v0.8/shared/test/helpers/ChainReaderTester.sol +++ b/contracts/src/v0.8/shared/test/helpers/ChainReaderTester.sol @@ -1,6 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; +// solhint-disable-next-line gas-struct-packing struct TestStruct { int32 Field; string DifferentField; diff --git a/contracts/src/v0.8/vrf/BatchBlockhashStore.sol b/contracts/src/v0.8/vrf/BatchBlockhashStore.sol index 1cbf2aa0093..cf29f148a54 100644 --- a/contracts/src/v0.8/vrf/BatchBlockhashStore.sol +++ b/contracts/src/v0.8/vrf/BatchBlockhashStore.sol @@ -80,6 +80,7 @@ contract BatchBlockhashStore { } } +// solhint-disable-next-line interface-starts-with-i interface BlockhashStore { function storeVerifyHeader(uint256 n, bytes memory header) external; diff --git a/contracts/src/v0.8/vrf/BatchVRFCoordinatorV2.sol b/contracts/src/v0.8/vrf/BatchVRFCoordinatorV2.sol index 2cb6948a9e3..b9230f66ee9 100644 --- a/contracts/src/v0.8/vrf/BatchVRFCoordinatorV2.sol +++ b/contracts/src/v0.8/vrf/BatchVRFCoordinatorV2.sol @@ -59,6 +59,7 @@ contract BatchVRFCoordinatorV2 { } } +// solhint-disable-next-line interface-starts-with-i interface VRFCoordinatorV2 { function fulfillRandomWords( VRFTypes.Proof memory proof, diff --git a/contracts/src/v0.8/vrf/VRFV2Wrapper.sol b/contracts/src/v0.8/vrf/VRFV2Wrapper.sol index ae0e3cc8206..a656ef071f1 100644 --- a/contracts/src/v0.8/vrf/VRFV2Wrapper.sol +++ b/contracts/src/v0.8/vrf/VRFV2Wrapper.sol @@ -419,6 +419,7 @@ contract VRFV2Wrapper is ConfirmedOwner, TypeAndVersionInterface, VRFConsumerBas } } +// solhint-disable-next-line interface-starts-with-i interface ExtendedVRFCoordinatorV2Interface is VRFCoordinatorV2Interface { function getConfig() external diff --git a/contracts/src/v0.8/vrf/dev/VRFCoordinatorV2_5.sol b/contracts/src/v0.8/vrf/dev/VRFCoordinatorV2_5.sol index c070c7d1e17..bde8267e30f 100644 --- a/contracts/src/v0.8/vrf/dev/VRFCoordinatorV2_5.sol +++ b/contracts/src/v0.8/vrf/dev/VRFCoordinatorV2_5.sol @@ -691,6 +691,7 @@ contract VRFCoordinatorV2_5 is VRF, SubscriptionAPI, IVRFCoordinatorV2Plus { error CoordinatorAlreadyRegistered(address coordinatorAddress); /// @dev encapsulates data to be migrated from current coordinator + // solhint-disable-next-line gas-struct-packing struct V1MigrationData { uint8 fromVersion; uint256 subId; diff --git a/contracts/src/v0.8/vrf/dev/testhelpers/VRFCoordinatorV2PlusUpgradedVersion.sol b/contracts/src/v0.8/vrf/dev/testhelpers/VRFCoordinatorV2PlusUpgradedVersion.sol index c88d7dec397..53f499305e5 100644 --- a/contracts/src/v0.8/vrf/dev/testhelpers/VRFCoordinatorV2PlusUpgradedVersion.sol +++ b/contracts/src/v0.8/vrf/dev/testhelpers/VRFCoordinatorV2PlusUpgradedVersion.sol @@ -685,6 +685,7 @@ contract VRFCoordinatorV2PlusUpgradedVersion is error CoordinatorAlreadyRegistered(address coordinatorAddress); /// @dev encapsulates data to be migrated from current coordinator + // solhint-disable-next-line gas-struct-packing struct V1MigrationData { uint8 fromVersion; uint256 subId; diff --git a/contracts/src/v0.8/vrf/dev/testhelpers/VRFCoordinatorV2Plus_V2Example.sol b/contracts/src/v0.8/vrf/dev/testhelpers/VRFCoordinatorV2Plus_V2Example.sol index 0204be807f5..1a2ed50e6f0 100644 --- a/contracts/src/v0.8/vrf/dev/testhelpers/VRFCoordinatorV2Plus_V2Example.sol +++ b/contracts/src/v0.8/vrf/dev/testhelpers/VRFCoordinatorV2Plus_V2Example.sol @@ -78,6 +78,7 @@ contract VRFCoordinatorV2Plus_V2Example is IVRFCoordinatorV2PlusMigration { error InvalidNativeBalance(uint256 transferredValue, uint96 expectedValue); /// @dev encapsulates data migrated over from previous coordinator + // solhint-disable-next-line gas-struct-packing struct V1MigrationData { uint8 fromVersion; uint256 subId; diff --git a/contracts/src/v0.8/vrf/dev/testhelpers/VRFV2PlusSingleConsumerExample.sol b/contracts/src/v0.8/vrf/dev/testhelpers/VRFV2PlusSingleConsumerExample.sol index 4d8b6de4a43..2ae45db9c48 100644 --- a/contracts/src/v0.8/vrf/dev/testhelpers/VRFV2PlusSingleConsumerExample.sol +++ b/contracts/src/v0.8/vrf/dev/testhelpers/VRFV2PlusSingleConsumerExample.sol @@ -11,6 +11,7 @@ contract VRFV2PlusSingleConsumerExample is VRFConsumerBaseV2Plus { // solhint-disable-next-line chainlink-solidity/prefix-storage-variables-with-s-underscore LinkTokenInterface internal LINKTOKEN; + // solhint-disable-next-line gas-struct-packing struct RequestConfig { uint256 subId; uint32 callbackGasLimit; diff --git a/contracts/src/v0.8/vrf/dev/testhelpers/VRFV2PlusWrapperConsumerExample.sol b/contracts/src/v0.8/vrf/dev/testhelpers/VRFV2PlusWrapperConsumerExample.sol index 62e6ed2da1e..9510b1ba0ea 100644 --- a/contracts/src/v0.8/vrf/dev/testhelpers/VRFV2PlusWrapperConsumerExample.sol +++ b/contracts/src/v0.8/vrf/dev/testhelpers/VRFV2PlusWrapperConsumerExample.sol @@ -9,6 +9,7 @@ contract VRFV2PlusWrapperConsumerExample is VRFV2PlusWrapperConsumerBase, Confir event WrappedRequestFulfilled(uint256 requestId, uint256[] randomWords, uint256 payment); event WrapperRequestMade(uint256 indexed requestId, uint256 paid); + // solhint-disable-next-line gas-struct-packing struct RequestStatus { uint256 paid; bool fulfilled; diff --git a/contracts/src/v0.8/vrf/dev/testhelpers/VRFV2PlusWrapperLoadTestConsumer.sol b/contracts/src/v0.8/vrf/dev/testhelpers/VRFV2PlusWrapperLoadTestConsumer.sol index 1389aee5f37..c4c968e5a18 100644 --- a/contracts/src/v0.8/vrf/dev/testhelpers/VRFV2PlusWrapperLoadTestConsumer.sol +++ b/contracts/src/v0.8/vrf/dev/testhelpers/VRFV2PlusWrapperLoadTestConsumer.sol @@ -20,6 +20,7 @@ contract VRFV2PlusWrapperLoadTestConsumer is VRFV2PlusWrapperConsumerBase, Confi event WrappedRequestFulfilled(uint256 requestId, uint256[] randomWords, uint256 payment); event WrapperRequestMade(uint256 indexed requestId, uint256 paid); + // solhint-disable-next-line gas-struct-packing struct RequestStatus { uint256 paid; bool fulfilled; diff --git a/contracts/src/v0.8/vrf/interfaces/BlockhashStoreInterface.sol b/contracts/src/v0.8/vrf/interfaces/BlockhashStoreInterface.sol index 81775570cef..6a42b5b9644 100644 --- a/contracts/src/v0.8/vrf/interfaces/BlockhashStoreInterface.sol +++ b/contracts/src/v0.8/vrf/interfaces/BlockhashStoreInterface.sol @@ -1,6 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; +// solhint-disable-next-line interface-starts-with-i interface BlockhashStoreInterface { function getBlockhash(uint256 number) external view returns (bytes32); } diff --git a/contracts/src/v0.8/vrf/interfaces/VRFCoordinatorV2Interface.sol b/contracts/src/v0.8/vrf/interfaces/VRFCoordinatorV2Interface.sol index fdb76dc6661..3cb9934d5c7 100644 --- a/contracts/src/v0.8/vrf/interfaces/VRFCoordinatorV2Interface.sol +++ b/contracts/src/v0.8/vrf/interfaces/VRFCoordinatorV2Interface.sol @@ -1,6 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; +// solhint-disable-next-line interface-starts-with-i interface VRFCoordinatorV2Interface { /** * @notice Get configuration relevant for making requests diff --git a/contracts/src/v0.8/vrf/interfaces/VRFV2WrapperInterface.sol b/contracts/src/v0.8/vrf/interfaces/VRFV2WrapperInterface.sol index 71dbfb6b478..daac1586681 100644 --- a/contracts/src/v0.8/vrf/interfaces/VRFV2WrapperInterface.sol +++ b/contracts/src/v0.8/vrf/interfaces/VRFV2WrapperInterface.sol @@ -1,6 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; +// solhint-disable-next-line interface-starts-with-i interface VRFV2WrapperInterface { /** * @return the request ID of the most recent VRF V2 request made by this wrapper. This should only