Skip to content

Commit

Permalink
[Feat] L1 contracts bump to solidity 0.8.28 (#656)
Browse files Browse the repository at this point in the history
* working hardhat compile

* bump solhint version

* bump hardhat version

* remove 0.8.26 refs

* remove solhint join discord cli message

* update upgrades-core dependency

* silence openzeppelin-upgrades error for test fixtures

* fix floating version for integrationtesttrue

* remove 0.8.26
  • Loading branch information
kyzooghost authored Feb 6, 2025
1 parent 4d85082 commit aa64956
Show file tree
Hide file tree
Showing 36 changed files with 172 additions and 154 deletions.
18 changes: 6 additions & 12 deletions contracts/hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const config: HardhatUserConfig = {
// NB: double check the autoupdate shell script version complies to the latest solidity version if you add a new one.
compilers: [
{
version: "0.8.26",
version: "0.8.28",
settings: {
viaIR: useViaIR,
optimizer: {
Expand All @@ -47,6 +47,11 @@ const config: HardhatUserConfig = {
evmVersion: "cancun",
},
},
/**
* Maintain for Mimc contract
* src/libraries/Mimc.sol (0.8.25)
* src/libraries/SparseMerkleProof.sol (0.8.25)
*/
{
version: "0.8.25",
settings: {
Expand All @@ -58,17 +63,6 @@ const config: HardhatUserConfig = {
evmVersion: "cancun",
},
},
{
version: "0.8.24",
settings: {
viaIR: useViaIR,
optimizer: {
enabled: true,
runs: 10_000,
},
evmVersion: "cancun",
},
},
{
version: "0.8.19",
settings: {
Expand Down
8 changes: 4 additions & 4 deletions contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"balance": "ts-node scripts/balanceOf.ts",
"prettier": "prettier -c '**/*.{js,ts,sol}'",
"prettier:fix": "prettier -w '**/*.{js,ts,sol}'",
"lint:sol": "solhint 'contracts/**/*.sol'",
"lint:sol:fix": "solhint --fix --noPrompt 'contracts/**/*.sol'",
"lint:sol": "solhint -f stylish 'src/**/*.sol'",
"lint:sol:fix": "solhint --fix --noPrompt -f stylish 'src/**/*.sol'",
"lint:ts": "npx eslint '**/*.{js,ts}'",
"lint:ts:fix": "npx eslint --fix '**/*.{js,ts}'",
"lint": "pnpm run lint:sol && npm run lint:ts && npm run prettier",
Expand Down Expand Up @@ -44,13 +44,13 @@
"dotenv": "16.4.5",
"edit-json-file": "1.8.0",
"ethers": "6.12.0",
"hardhat": "2.22.17",
"hardhat": "2.22.18",
"hardhat-deploy": "0.12.4",
"hardhat-storage-layout": "0.1.7",
"hardhat-tracer": "2.8.2",
"node-gyp": "10.1.0",
"prettier-plugin-solidity": "1.3.1",
"solhint": "4.5.4",
"solhint": "5.0.5",
"yargs": "17.7.2"
},
"dependencies": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0
pragma solidity 0.8.26;
pragma solidity 0.8.28;

import { IPlonkVerifier } from "../../verifiers/interfaces/IPlonkVerifier.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/src/_testing/mocks/base/RevertingVerifier.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0
pragma solidity ^0.8.26;
pragma solidity 0.8.28;

import { IPlonkVerifier } from "../../../verifiers/interfaces/IPlonkVerifier.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/src/_testing/mocks/base/TestClaimingCaller.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0
pragma solidity 0.8.26;
pragma solidity 0.8.28;

import { IMessageService } from "../../../messaging/interfaces/IMessageService.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/src/_testing/mocks/base/TestL1RevertContract.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: AGPL-3.0

pragma solidity 0.8.26;
pragma solidity 0.8.28;

contract TestL1RevertContract {
function errorWithMessage() external pure {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: AGPL-3.0

pragma solidity 0.8.19;
pragma solidity ^0.8.19;

contract TestReceivingContract {
fallback() external payable {}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity >=0.8.19 <=0.8.26;
pragma solidity 0.8.28;

import { IMessageService } from "../../../messaging/interfaces/IMessageService.sol";
import { IGenericErrors } from "../../../interfaces/IGenericErrors.sol";
Expand Down
1 change: 1 addition & 0 deletions contracts/src/_testing/mocks/bridging/TestTokenBridge.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ pragma solidity 0.8.19;

import { TokenBridge } from "../../../bridging/token/TokenBridge.sol";

/// @custom:oz-upgrades-unsafe-allow missing-initializer
contract TestTokenBridge is TokenBridge {
function testReturnDataToString(bytes memory _data) public pure returns (string memory) {
return _returnDataToString(_data);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.0;
pragma solidity ^0.8.19;

import { ReentrancyContract } from "./ReentrancyContract.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/src/_testing/unit/TestExternalCalls.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: AGPL-3.0

pragma solidity 0.8.26;
pragma solidity 0.8.28;

interface ITestExternalCalls {
function revertWithError() external pure;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0
pragma solidity 0.8.26;
pragma solidity 0.8.28;

import { EfficientLeftRightKeccak } from "../../../libraries/EfficientLeftRightKeccak.sol";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0
pragma solidity 0.8.26;
pragma solidity 0.8.28;

import { L1MessageManager } from "../../../messaging/l1/L1MessageManager.sol";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0
pragma solidity 0.8.26;
pragma solidity 0.8.28;

import { L1MessageService } from "../../../messaging/l1/L1MessageService.sol";
import { TestSetPauseTypeRoles } from "../security/TestSetPauseTypeRoles.sol";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0
pragma solidity 0.8.26;
pragma solidity 0.8.28;

import { L1MessageService } from "../../../messaging/l1/L1MessageService.sol";
import { IL1MessageService } from "../../../messaging/l1/interfaces/IL1MessageService.sol";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ pragma solidity 0.8.19;

import { L2MessageService } from "../../../messaging/l2/L2MessageService.sol";

/// @custom:oz-upgrades-unsafe-allow missing-initializer
contract TestL2MessageService is L2MessageService {
address public originalSender;
bool private reentryDone;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0
pragma solidity >=0.8.19 <=0.8.26;
pragma solidity 0.8.28;

import { MessageServiceBase } from "../../../messaging/MessageServiceBase.sol";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0
pragma solidity 0.8.26;
pragma solidity 0.8.28;

import { SparseMerkleTreeVerifier } from "../../../messaging/libraries/SparseMerkleTreeVerifier.sol";
import { EfficientLeftRightKeccak } from "../../../libraries/EfficientLeftRightKeccak.sol";
Expand Down
3 changes: 2 additions & 1 deletion contracts/src/_testing/unit/rollup/TestLineaRollup.sol
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
// SPDX-License-Identifier: AGPL-3.0
pragma solidity 0.8.26;
pragma solidity 0.8.28;

import { LineaRollup } from "../../../rollup/LineaRollup.sol";

/// @custom:oz-upgrades-unsafe-allow missing-initializer
contract TestLineaRollup is LineaRollup {
function addRollingHash(uint256 _messageNumber, bytes32 _messageHash) external {
_addRollingHash(_messageNumber, _messageHash);
Expand Down
2 changes: 1 addition & 1 deletion contracts/src/_testing/unit/security/TestPauseManager.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0
pragma solidity >=0.8.19 <=0.8.26;
pragma solidity 0.8.19;

import { PauseManager } from "../../../security/pausing/PauseManager.sol";
import { TestSetPauseTypeRoles } from "./TestSetPauseTypeRoles.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/src/_testing/unit/security/TestRateLimiter.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0
pragma solidity >=0.8.19 <=0.8.26;
pragma solidity 0.8.19;

import { Initializable } from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import { RateLimiter } from "../../../security/limiting/RateLimiter.sol";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// SPDX-License-Identifier: AGPL-3.0
pragma solidity >=0.8.19 <=0.8.26;
pragma solidity ^0.8.19;

import { PauseManager } from "../../../security/pausing/PauseManager.sol";

contract TestSetPauseTypeRoles is PauseManager {
abstract contract TestSetPauseTypeRoles is PauseManager {
function initializePauseTypesAndPermissions(
PauseTypeRole[] calldata _pauseTypeRoles,
PauseTypeRole[] calldata _unpauseTypeRoles
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

// Code generated by gnark DO NOT EDIT

pragma solidity 0.8.26;
pragma solidity 0.8.28;

contract TestPlonkVerifierForDataAggregation {
uint256 private constant R_MOD = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
Expand Down
2 changes: 1 addition & 1 deletion contracts/src/governance/TimeLock.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0
pragma solidity >=0.8.19 <=0.8.26;
pragma solidity 0.8.19;

import { TimelockController } from "@openzeppelin/contracts/governance/TimelockController.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/src/proxies/CallForwardingProxy.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0
pragma solidity 0.8.26;
pragma solidity 0.8.28;

/**
* @title Contract to forward calls to an underlying contract.
Expand Down
2 changes: 1 addition & 1 deletion contracts/src/recovery/RecoverFunds.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0
pragma solidity 0.8.26;
pragma solidity 0.8.28;

import { AccessControlUpgradeable } from "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol";
import { IGenericErrors } from "../interfaces/IGenericErrors.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/src/rollup/LineaRollup.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0
pragma solidity 0.8.26;
pragma solidity 0.8.28;

import { AccessControlUpgradeable } from "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol";
import { L1MessageService } from "../messaging/l1/L1MessageService.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/src/verifiers/PlonkVerifierDev.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

// Code generated by gnark DO NOT EDIT

pragma solidity 0.8.26;
pragma solidity 0.8.28;

contract PlonkVerifierDev {
uint256 private constant R_MOD = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

// Code generated by gnark DO NOT EDIT

pragma solidity 0.8.26;
pragma solidity 0.8.28;

contract PlonkVerifierForDataAggregation {
uint256 private constant R_MOD = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

// Code generated by gnark DO NOT EDIT

pragma solidity 0.8.26;
pragma solidity 0.8.28;

contract PlonkVerifierForMultiTypeDataAggregation {
uint256 private constant R_MOD = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
Expand Down
2 changes: 1 addition & 1 deletion contracts/src/verifiers/PlonkVerifierSepoliaFull.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

// Code generated by gnark DO NOT EDIT

pragma solidity 0.8.26;
pragma solidity 0.8.28;

contract PlonkVerifierSepoliaFull {
uint256 private constant R_MOD = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
Expand Down
2 changes: 1 addition & 1 deletion contracts/test/foundry/ExampleFoundryTest.t.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.26;
pragma solidity 0.8.28;

import "forge-std/Test.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/test/foundry/LineaRollup.t.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0
pragma solidity 0.8.26;
pragma solidity 0.8.28;

import "forge-std/Test.sol";
import "../../contracts/LineaRollup.sol";
Expand Down
2 changes: 1 addition & 1 deletion e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"license": "ISC",
"devDependencies": {
"@jest/globals": "29.7.0",
"@openzeppelin/upgrades-core": "1.33.1",
"@openzeppelin/upgrades-core": "1.42.1",
"@typechain/ethers-v6": "0.5.1",
"@types/jest": "29.5.13",
"async-mutex": "^0.5.0",
Expand Down
Loading

0 comments on commit aa64956

Please sign in to comment.