diff --git a/contracts/package.json b/contracts/package.json index 7f54f0c1649..1e4da89843a 100644 --- a/contracts/package.json +++ b/contracts/package.json @@ -71,7 +71,7 @@ "moment": "^2.30.1", "prettier": "^3.3.3", "prettier-plugin-solidity": "^1.4.1", - "solhint": "^5.0.5", + "solhint": "^5.0.3", "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", diff --git a/contracts/pnpm-lock.yaml b/contracts/pnpm-lock.yaml index 3701a90ccbf..b1a0aa696e5 100644 --- a/contracts/pnpm-lock.yaml +++ b/contracts/pnpm-lock.yaml @@ -145,7 +145,7 @@ importers: specifier: ^1.4.1 version: 1.4.1(prettier@3.3.3) solhint: - specifier: ^5.0.5 + specifier: ^5.0.3 version: 5.0.5 solhint-plugin-chainlink-solidity: specifier: git+https://github.com/smartcontractkit/chainlink-solhint-rules.git#v1.2.1 diff --git a/contracts/src/v0.8/functions/v1_3_0_zksync/ZKSyncFunctionsRouter.sol b/contracts/src/v0.8/functions/v1_3_0_zksync/ZKSyncFunctionsRouter.sol index 1601e5e588d..dd23f669d12 100644 --- a/contracts/src/v0.8/functions/v1_3_0_zksync/ZKSyncFunctionsRouter.sol +++ b/contracts/src/v0.8/functions/v1_3_0_zksync/ZKSyncFunctionsRouter.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.24; +pragma solidity ^0.8.19; import {FunctionsRouter} from "../v1_0_0/FunctionsRouter.sol"; import {CallWithExactGasZKSync} from "../../shared/call/CallWithExactGasZKSync.sol"; @@ -42,7 +42,7 @@ contract ZKSyncFunctionsRouter is FunctionsRouter { ); // 3. Use our library to enforce an exact gas call - (bool success, uint256 gasUsed, bytes memory returnData) = CallWithExactGasZKSync._callWithExactGas( + (bool success, uint256 gasUsed, bytes memory returnData) = CallWithExactGasZKSync._callWithExactGasSafeReturnData( client, callbackGasLimit, encodedCallback, diff --git a/contracts/src/v0.8/shared/call/CallWithExactGasZKSync.sol b/contracts/src/v0.8/shared/call/CallWithExactGasZKSync.sol index b1e78f6ea93..8a4f0ee788b 100644 --- a/contracts/src/v0.8/shared/call/CallWithExactGasZKSync.sol +++ b/contracts/src/v0.8/shared/call/CallWithExactGasZKSync.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.24; +pragma solidity ^0.8.19; import {EfficientCall} from "@zksync/contracts/system-contracts/contracts/libraries/EfficientCall.sol"; import {ISystemContext} from "@zksync/contracts/gas-bound-caller/contracts/ISystemContext.sol"; @@ -33,7 +33,10 @@ library CallWithExactGasZKSync { /// @param _maxtotalgas the maximum amount of gas that can be spent by the call. /// @param _data The calldata for the call. /// @param _maxReturnBytes the maximum amount of bytes that can be returned by the call. - function _callWithExactGas( + /// @return success whether the call succeeded + /// @return retData the return data from the call, capped at maxReturnBytes bytes + /// @return gasUsed the gas used by the external call. Does not include the overhead of this function. + function _callWithExactGasSafeReturnData( address _to, uint256 _maxTotalGas, bytes calldata _data,