Skip to content

Commit

Permalink
chore(compiler): move interfaces and libraries to fpp
Browse files Browse the repository at this point in the history
  • Loading branch information
koloz193 committed Jun 7, 2024
1 parent 5385fe2 commit 6f5914b
Show file tree
Hide file tree
Showing 64 changed files with 111 additions and 63 deletions.
2 changes: 1 addition & 1 deletion l1-contracts/contracts/common/Config.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.24;
pragma solidity ^0.8.20;

/// @dev `keccak256("")`
bytes32 constant EMPTY_STRING_KECCAK = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
Expand Down
2 changes: 1 addition & 1 deletion l1-contracts/contracts/common/Dependencies.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.24;
pragma solidity ^0.8.20;

/* solhint-disable-next-line no-unused-import */
import {TransparentUpgradeableProxy} from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol";
Expand Down
2 changes: 1 addition & 1 deletion l1-contracts/contracts/common/L2ContractAddresses.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.24;
pragma solidity ^0.8.20;

/// @dev The formal address of the initial program of the system: the bootloader
address constant L2_BOOTLOADER_ADDRESS = address(0x8001);
Expand Down
2 changes: 1 addition & 1 deletion l1-contracts/contracts/common/Messaging.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.24;
pragma solidity ^0.8.20;

/// @dev The enum that represents the transaction execution status
/// @param Failure The transaction execution failed
Expand Down
2 changes: 1 addition & 1 deletion l1-contracts/contracts/common/ReentrancyGuard.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.24;
pragma solidity ^0.8.20;

// solhint-disable gas-custom-errors

Expand Down
48 changes: 48 additions & 0 deletions l1-contracts/contracts/common/libraries/SemVer.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.20;

/// @dev The number of bits dedicated to the "patch" portion of the protocol version.
/// This also defines the bit starting from which the "minor" part is located.
uint256 constant SEMVER_MINOR_OFFSET = 32;

/// @dev The number of bits dedicated to the "patch" and "minor" portions of the protocol version.
/// This also defines the bit starting from which the "major" part is located.
/// Note, that currently, only major version of "0" is supported.
uint256 constant SEMVER_MAJOR_OFFSET = 64;

/**
* @author Matter Labs
* @custom:security-contact [email protected]
* @notice The library for managing SemVer for the protocol version.
*/
library SemVer {
/// @notice Unpacks the SemVer version from a single uint256 into major, minor and patch components.
/// @param _packedProtocolVersion The packed protocol version.
/// @return major The major version.
/// @return minor The minor version.
/// @return patch The patch version.
function unpackSemVer(
uint96 _packedProtocolVersion
) internal pure returns (uint32 major, uint32 minor, uint32 patch) {
patch = uint32(_packedProtocolVersion);
minor = uint32(_packedProtocolVersion >> SEMVER_MINOR_OFFSET);
major = uint32(_packedProtocolVersion >> SEMVER_MAJOR_OFFSET);
}

/// @notice Packs the SemVer version from the major, minor and patch components into a single uint96.
/// @param _major The major version.
/// @param _minor The minor version.
/// @param _patch The patch version.
/// @return packedProtocolVersion The packed protocol version.
function packSemVer(
uint32 _major,
uint32 _minor,
uint32 _patch
) internal pure returns (uint96 packedProtocolVersion) {
packedProtocolVersion =
uint96(_patch) |
(uint96(_minor) << SEMVER_MINOR_OFFSET) |
(uint96(_major) << SEMVER_MAJOR_OFFSET);
}
}
2 changes: 1 addition & 1 deletion l1-contracts/contracts/governance/IGovernance.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.24;
pragma solidity ^0.8.20;

/// @title Governance contract interface
/// @author Matter Labs
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.24;
pragma solidity ^0.8.20;

import {Diamond} from "./libraries/Diamond.sol";
import {L2CanonicalTransaction} from "../common/Messaging.sol";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.24;
pragma solidity ^0.8.20;

import {IZkSyncHyperchainBase} from "../chain-interfaces/IZkSyncHyperchainBase.sol";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.24;
pragma solidity ^0.8.20;

import {IVerifier, VerifierParams} from "./IVerifier.sol";
import {FeeParams} from "../chain-deps/ZkSyncHyperchainStorage.sol";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.24;
pragma solidity ^0.8.20;

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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.24;
pragma solidity ^0.8.20;

import {PriorityOperation} from "../libraries/PriorityQueue.sol";
import {VerifierParams} from "../chain-interfaces/IVerifier.sol";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.24;
pragma solidity ^0.8.20;

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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.24;
pragma solidity ^0.8.20;

import {IZkSyncHyperchainBase} from "./IZkSyncHyperchainBase.sol";
import {L2CanonicalTransaction, L2Log, L2Message, TxStatus, BridgehubL2TransactionRequest} from "../../common/Messaging.sol";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.24;
pragma solidity ^0.8.20;

/// @title The interface of the L1 -> L2 transaction filterer.
/// @author Matter Labs
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.24;
pragma solidity ^0.8.20;

/// @notice Part of the configuration parameters of ZKP circuits
struct VerifierParams {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.24;
pragma solidity ^0.8.20;

import {IAdmin} from "./IAdmin.sol";
import {IExecutor} from "./IExecutor.sol";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.24;
pragma solidity ^0.8.20;

/// @title The interface of the zkSync contract, responsible for the main zkSync logic.
/// @author Matter Labs
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.24;
pragma solidity ^0.8.20;

// solhint-disable gas-custom-errors

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.24;
pragma solidity ^0.8.20;

/// @notice Library for storage of packed unsigned integers.
/// @author Matter Labs
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.24;
pragma solidity ^0.8.20;

// solhint-disable gas-custom-errors

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.24;
pragma solidity ^0.8.20;

// solhint-disable gas-custom-errors

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.24;
pragma solidity ^0.8.20;

// solhint-disable gas-custom-errors

Expand Down
2 changes: 1 addition & 1 deletion l1-contracts/contracts/vendor/AddressAliasHelper.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* limitations under the License.
*/

pragma solidity 0.8.24;
pragma solidity ^0.8.20;

library AddressAliasHelper {
uint160 private constant offset = uint160(0x1111000000000000000000000000000000001111);
Expand Down
2 changes: 1 addition & 1 deletion l2-contracts/contracts/Dependencies.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.20;
pragma solidity ^0.8.20;

/* solhint-disable-next-line no-unused-import */
import {TransparentUpgradeableProxy} from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol";
Expand Down
2 changes: 1 addition & 1 deletion l2-contracts/contracts/L2ContractErrors.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.20;
pragma solidity ^0.8.20;

error InvalidCaller(address);
error InvalidInput();
Expand Down
2 changes: 1 addition & 1 deletion l2-contracts/contracts/L2ContractHelper.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.20;
pragma solidity ^0.8.20;

/**
* @author Matter Labs
Expand Down
2 changes: 1 addition & 1 deletion l2-contracts/contracts/SystemContractsCaller.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// solhint-disable one-contract-per-file

pragma solidity 0.8.20;
pragma solidity ^0.8.20;

import {MSG_VALUE_SYSTEM_CONTRACT} from "./L2ContractHelper.sol";

Expand Down
2 changes: 1 addition & 1 deletion l2-contracts/contracts/TestnetPaymaster.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.20;
pragma solidity ^0.8.20;

import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.20;
pragma solidity ^0.8.20;

/// @author Matter Labs
// note we use the IL1ERC20Bridge only to send L1<>L2 messages,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.20;
pragma solidity ^0.8.20;

/// @title L1 Bridge contract interface
/// @author Matter Labs
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.20;
pragma solidity ^0.8.20;

/// @author Matter Labs
interface IL2SharedBridge {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.20;
pragma solidity ^0.8.20;

interface IL2StandardToken {
event BridgeInitialize(address indexed l1Token, string name, string symbol, uint8 decimals);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.20;
pragma solidity ^0.8.20;

interface IL2WrappedBaseToken {
event Initialize(string name, string symbol, uint8 decimals);
Expand Down
2 changes: 1 addition & 1 deletion l2-contracts/contracts/interfaces/IPaymaster.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.20;
pragma solidity ^0.8.20;

import {Transaction} from "../L2ContractHelper.sol";

Expand Down
2 changes: 1 addition & 1 deletion l2-contracts/contracts/interfaces/IPaymasterFlow.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.20;
pragma solidity ^0.8.20;

/**
* @author Matter Labs
Expand Down
2 changes: 1 addition & 1 deletion l2-contracts/contracts/vendor/AddressAliasHelper.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* limitations under the License.
*/

pragma solidity 0.8.20;
pragma solidity ^0.8.20;

library AddressAliasHelper {
uint160 internal constant offset = uint160(0x1111000000000000000000000000000000001111);
Expand Down
2 changes: 1 addition & 1 deletion system-contracts/contracts/Constants.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.20;
pragma solidity ^0.8.20;

import {IAccountCodeStorage} from "./interfaces/IAccountCodeStorage.sol";
import {INonceHolder} from "./interfaces/INonceHolder.sol";
Expand Down
2 changes: 1 addition & 1 deletion system-contracts/contracts/interfaces/IAccount.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.20;
pragma solidity ^0.8.20;

import {Transaction} from "../libraries/TransactionHelper.sol";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.20;
pragma solidity ^0.8.20;

interface IAccountCodeStorage {
function storeAccountConstructingCodeHash(address _address, bytes32 _hash) external;
Expand Down
2 changes: 1 addition & 1 deletion system-contracts/contracts/interfaces/IBaseToken.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.20;
pragma solidity ^0.8.20;

interface IBaseToken {
function balanceOf(uint256) external view returns (uint256);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.20;
pragma solidity ^0.8.20;

import {Transaction} from "../libraries/TransactionHelper.sol";

Expand Down
2 changes: 1 addition & 1 deletion system-contracts/contracts/interfaces/IComplexUpgrader.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.20;
pragma solidity ^0.8.20;

/**
* @author Matter Labs
Expand Down
2 changes: 1 addition & 1 deletion system-contracts/contracts/interfaces/ICompressor.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.20;
pragma solidity ^0.8.20;

// The bitmask by applying which to the compressed state diff metadata we retrieve its operation.
uint8 constant OPERATION_BITMASK = 7;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.20;
pragma solidity ^0.8.20;

interface IContractDeployer {
/// @notice Defines the version of the account abstraction protocol
Expand Down
Loading

0 comments on commit 6f5914b

Please sign in to comment.