Skip to content

Commit

Permalink
Fix all solhint issues (#13185)
Browse files Browse the repository at this point in the history
* bump versions

* fix vrf

* fix shared

* fix operatorforwarder

* fix llo-feeds

* fix l2ep

* fix interfaces

* fix functions

* fix automation

* changeset
  • Loading branch information
RensR authored May 15, 2024
1 parent 0ea99be commit 286e6af
Show file tree
Hide file tree
Showing 56 changed files with 110 additions and 55 deletions.
5 changes: 5 additions & 0 deletions contracts/.changeset/fuzzy-bags-watch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@chainlink/contracts": patch
---

fix solhint issues
2 changes: 2 additions & 0 deletions contracts/.solhintignore
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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"
}
}
74 changes: 37 additions & 37 deletions contracts/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Loading

0 comments on commit 286e6af

Please sign in to comment.