diff --git a/packages/protocol/contracts/L1/ProofVerifier.sol b/packages/protocol/contracts/L1/ProofVerifier.sol index 621e114e557..9323cc34c51 100644 --- a/packages/protocol/contracts/L1/ProofVerifier.sol +++ b/packages/protocol/contracts/L1/ProofVerifier.sol @@ -4,7 +4,7 @@ // | |/ _` | | / / _ \ | |__/ _` | '_ (_-< // |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -pragma solidity ^0.8.9; +pragma solidity ^0.8.18; import "../common/EssentialContract.sol"; import "../libs/LibZKP.sol"; diff --git a/packages/protocol/contracts/L1/TaikoData.sol b/packages/protocol/contracts/L1/TaikoData.sol index 63cc52ff3ec..41886b9bcea 100644 --- a/packages/protocol/contracts/L1/TaikoData.sol +++ b/packages/protocol/contracts/L1/TaikoData.sol @@ -4,7 +4,7 @@ // | |/ _` | | / / _ \ | |__/ _` | '_ (_-< // |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -pragma solidity ^0.8.9; +pragma solidity ^0.8.18; /// @author dantaik library TaikoData { diff --git a/packages/protocol/contracts/L1/TaikoEvents.sol b/packages/protocol/contracts/L1/TaikoEvents.sol index 8d5b08979ca..88c52d1f3ba 100644 --- a/packages/protocol/contracts/L1/TaikoEvents.sol +++ b/packages/protocol/contracts/L1/TaikoEvents.sol @@ -4,7 +4,7 @@ // | |/ _` | | / / _ \ | |__/ _` | '_ (_-< // |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -pragma solidity ^0.8.9; +pragma solidity ^0.8.18; import "./TaikoData.sol"; diff --git a/packages/protocol/contracts/L1/TaikoL1.sol b/packages/protocol/contracts/L1/TaikoL1.sol index d8220682b9c..7d9ddf55b7a 100644 --- a/packages/protocol/contracts/L1/TaikoL1.sol +++ b/packages/protocol/contracts/L1/TaikoL1.sol @@ -4,7 +4,7 @@ // | |/ _` | | / / _ \ | |__/ _` | '_ (_-< // |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -pragma solidity ^0.8.9; +pragma solidity ^0.8.18; import "../common/EssentialContract.sol"; import "../common/IHeaderSync.sol"; diff --git a/packages/protocol/contracts/L1/TkoToken.sol b/packages/protocol/contracts/L1/TkoToken.sol index 7c733f83656..78e5eeba5a9 100644 --- a/packages/protocol/contracts/L1/TkoToken.sol +++ b/packages/protocol/contracts/L1/TkoToken.sol @@ -4,7 +4,7 @@ // | |/ _` | | / / _ \ | |__/ _` | '_ (_-< // |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -pragma solidity ^0.8.9; +pragma solidity ^0.8.18; import "@openzeppelin/contracts-upgradeable/utils/math/SafeCastUpgradeable.sol"; diff --git a/packages/protocol/contracts/L1/libs/LibProposing.sol b/packages/protocol/contracts/L1/libs/LibProposing.sol index 389762c1263..48d382c2495 100644 --- a/packages/protocol/contracts/L1/libs/LibProposing.sol +++ b/packages/protocol/contracts/L1/libs/LibProposing.sol @@ -4,7 +4,7 @@ // | |/ _` | | / / _ \ | |__/ _` | '_ (_-< // |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -pragma solidity ^0.8.9; +pragma solidity ^0.8.18; import "../../libs/LibTxDecoder.sol"; import "../TkoToken.sol"; diff --git a/packages/protocol/contracts/L1/libs/LibProving.sol b/packages/protocol/contracts/L1/libs/LibProving.sol index 77f5617e78c..b6f102313f2 100644 --- a/packages/protocol/contracts/L1/libs/LibProving.sol +++ b/packages/protocol/contracts/L1/libs/LibProving.sol @@ -4,7 +4,7 @@ // | |/ _` | | / / _ \ | |__/ _` | '_ (_-< // |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -pragma solidity ^0.8.9; +pragma solidity ^0.8.18; import {IProofVerifier} from "../ProofVerifier.sol"; import "../../common/AddressResolver.sol"; diff --git a/packages/protocol/contracts/L1/libs/LibUtils.sol b/packages/protocol/contracts/L1/libs/LibUtils.sol index 52a76ffcc3b..a5d8749093d 100644 --- a/packages/protocol/contracts/L1/libs/LibUtils.sol +++ b/packages/protocol/contracts/L1/libs/LibUtils.sol @@ -4,7 +4,7 @@ // | |/ _` | | / / _ \ | |__/ _` | '_ (_-< // |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -pragma solidity ^0.8.9; +pragma solidity ^0.8.18; import "@openzeppelin/contracts-upgradeable/utils/math/SafeCastUpgradeable.sol"; diff --git a/packages/protocol/contracts/L1/libs/LibVerifying.sol b/packages/protocol/contracts/L1/libs/LibVerifying.sol index ad5b1ad21ae..31b9be8f2b1 100644 --- a/packages/protocol/contracts/L1/libs/LibVerifying.sol +++ b/packages/protocol/contracts/L1/libs/LibVerifying.sol @@ -4,7 +4,7 @@ // | |/ _` | | / / _ \ | |__/ _` | '_ (_-< // |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -pragma solidity ^0.8.9; +pragma solidity ^0.8.18; import "../../common/AddressResolver.sol"; import "../TkoToken.sol"; diff --git a/packages/protocol/contracts/L2/TaikoL2.sol b/packages/protocol/contracts/L2/TaikoL2.sol index 4a184b86d69..ff65e98b70a 100644 --- a/packages/protocol/contracts/L2/TaikoL2.sol +++ b/packages/protocol/contracts/L2/TaikoL2.sol @@ -4,7 +4,7 @@ // | |/ _` | | / / _ \ | |__/ _` | '_ (_-< // |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -pragma solidity ^0.8.9; +pragma solidity ^0.8.18; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; diff --git a/packages/protocol/contracts/bridge/Bridge.sol b/packages/protocol/contracts/bridge/Bridge.sol index 5d515579ee5..7de933dc339 100644 --- a/packages/protocol/contracts/bridge/Bridge.sol +++ b/packages/protocol/contracts/bridge/Bridge.sol @@ -4,7 +4,7 @@ // | |/ _` | | / / _ \ | |__/ _` | '_ (_-< // |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -pragma solidity ^0.8.9; +pragma solidity ^0.8.18; import "../common/EssentialContract.sol"; import "./IBridge.sol"; diff --git a/packages/protocol/contracts/bridge/BridgedERC20.sol b/packages/protocol/contracts/bridge/BridgedERC20.sol index b2cfb831723..0dd9935cf3d 100644 --- a/packages/protocol/contracts/bridge/BridgedERC20.sol +++ b/packages/protocol/contracts/bridge/BridgedERC20.sol @@ -4,7 +4,7 @@ // | |/ _` | | / / _ \ | |__/ _` | '_ (_-< // |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -pragma solidity ^0.8.9; +pragma solidity ^0.8.18; import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; // solhint-disable-next-line max-line-length diff --git a/packages/protocol/contracts/bridge/EtherVault.sol b/packages/protocol/contracts/bridge/EtherVault.sol index 275ce8d301a..b7613e2c25a 100644 --- a/packages/protocol/contracts/bridge/EtherVault.sol +++ b/packages/protocol/contracts/bridge/EtherVault.sol @@ -4,7 +4,7 @@ // | |/ _` | | / / _ \ | |__/ _` | '_ (_-< // |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -pragma solidity ^0.8.9; +pragma solidity ^0.8.18; // solhint-disable-next-line max-line-length import "@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol"; diff --git a/packages/protocol/contracts/bridge/IBridge.sol b/packages/protocol/contracts/bridge/IBridge.sol index 200cf55497b..ea066414245 100644 --- a/packages/protocol/contracts/bridge/IBridge.sol +++ b/packages/protocol/contracts/bridge/IBridge.sol @@ -4,7 +4,7 @@ // | |/ _` | | / / _ \ | |__/ _` | '_ (_-< // |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -pragma solidity ^0.8.9; +pragma solidity ^0.8.18; /** * Bridge interface. diff --git a/packages/protocol/contracts/bridge/TokenVault.sol b/packages/protocol/contracts/bridge/TokenVault.sol index 3b2adf9116a..828144d0ae1 100644 --- a/packages/protocol/contracts/bridge/TokenVault.sol +++ b/packages/protocol/contracts/bridge/TokenVault.sol @@ -4,7 +4,7 @@ // | |/ _` | | / / _ \ | |__/ _` | '_ (_-< // |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -pragma solidity ^0.8.9; +pragma solidity ^0.8.18; // solhint-disable-next-line max-line-length import "@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol"; diff --git a/packages/protocol/contracts/bridge/libs/LibBridgeData.sol b/packages/protocol/contracts/bridge/libs/LibBridgeData.sol index ff7160de6be..e030e5c7c43 100644 --- a/packages/protocol/contracts/bridge/libs/LibBridgeData.sol +++ b/packages/protocol/contracts/bridge/libs/LibBridgeData.sol @@ -4,7 +4,7 @@ // | |/ _` | | / / _ \ | |__/ _` | '_ (_-< // |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -pragma solidity ^0.8.9; +pragma solidity ^0.8.18; import "../../common/AddressResolver.sol"; import "../../libs/LibAddress.sol"; diff --git a/packages/protocol/contracts/bridge/libs/LibBridgeInvoke.sol b/packages/protocol/contracts/bridge/libs/LibBridgeInvoke.sol index b6d198ca18e..8df2e0b2ffd 100644 --- a/packages/protocol/contracts/bridge/libs/LibBridgeInvoke.sol +++ b/packages/protocol/contracts/bridge/libs/LibBridgeInvoke.sol @@ -4,7 +4,7 @@ // | |/ _` | | / / _ \ | |__/ _` | '_ (_-< // |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -pragma solidity ^0.8.9; +pragma solidity ^0.8.18; import "./LibBridgeData.sol"; diff --git a/packages/protocol/contracts/bridge/libs/LibBridgeProcess.sol b/packages/protocol/contracts/bridge/libs/LibBridgeProcess.sol index 9b149ba891d..12a9a730c5d 100644 --- a/packages/protocol/contracts/bridge/libs/LibBridgeProcess.sol +++ b/packages/protocol/contracts/bridge/libs/LibBridgeProcess.sol @@ -4,7 +4,7 @@ // | |/ _` | | / / _ \ | |__/ _` | '_ (_-< // |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -pragma solidity ^0.8.9; +pragma solidity ^0.8.18; import "../../signal/ISignalService.sol"; import "../EtherVault.sol"; diff --git a/packages/protocol/contracts/bridge/libs/LibBridgeRelease.sol b/packages/protocol/contracts/bridge/libs/LibBridgeRelease.sol index c7d7025315a..5882caa94d2 100644 --- a/packages/protocol/contracts/bridge/libs/LibBridgeRelease.sol +++ b/packages/protocol/contracts/bridge/libs/LibBridgeRelease.sol @@ -4,7 +4,7 @@ // | |/ _` | | / / _ \ | |__/ _` | '_ (_-< // |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -pragma solidity ^0.8.9; +pragma solidity ^0.8.18; import "../EtherVault.sol"; import "./LibBridgeData.sol"; diff --git a/packages/protocol/contracts/bridge/libs/LibBridgeRetry.sol b/packages/protocol/contracts/bridge/libs/LibBridgeRetry.sol index 58a0a12d562..ccb79ebef54 100644 --- a/packages/protocol/contracts/bridge/libs/LibBridgeRetry.sol +++ b/packages/protocol/contracts/bridge/libs/LibBridgeRetry.sol @@ -4,7 +4,7 @@ // | |/ _` | | / / _ \ | |__/ _` | '_ (_-< // |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -pragma solidity ^0.8.9; +pragma solidity ^0.8.18; import "../EtherVault.sol"; import "./LibBridgeInvoke.sol"; diff --git a/packages/protocol/contracts/bridge/libs/LibBridgeSend.sol b/packages/protocol/contracts/bridge/libs/LibBridgeSend.sol index 7d5f8449e7b..f86fc9f11fd 100644 --- a/packages/protocol/contracts/bridge/libs/LibBridgeSend.sol +++ b/packages/protocol/contracts/bridge/libs/LibBridgeSend.sol @@ -4,7 +4,7 @@ // | |/ _` | | / / _ \ | |__/ _` | '_ (_-< // |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -pragma solidity ^0.8.9; +pragma solidity ^0.8.18; import "../../signal/ISignalService.sol"; import "./LibBridgeData.sol"; diff --git a/packages/protocol/contracts/bridge/libs/LibBridgeStatus.sol b/packages/protocol/contracts/bridge/libs/LibBridgeStatus.sol index f93e435c5a2..30d269ebd2f 100644 --- a/packages/protocol/contracts/bridge/libs/LibBridgeStatus.sol +++ b/packages/protocol/contracts/bridge/libs/LibBridgeStatus.sol @@ -4,7 +4,7 @@ // | |/ _` | | / / _ \ | |__/ _` | '_ (_-< // |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -pragma solidity ^0.8.9; +pragma solidity ^0.8.18; import "../../common/IHeaderSync.sol"; import "../../libs/LibBlockHeader.sol"; diff --git a/packages/protocol/contracts/common/AddressResolver.sol b/packages/protocol/contracts/common/AddressResolver.sol index f3ef4a24fe6..a00a1e0e7fc 100644 --- a/packages/protocol/contracts/common/AddressResolver.sol +++ b/packages/protocol/contracts/common/AddressResolver.sol @@ -4,7 +4,7 @@ // | |/ _` | | / / _ \ | |__/ _` | '_ (_-< // |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -pragma solidity ^0.8.9; +pragma solidity ^0.8.18; import "@openzeppelin/contracts/utils/Strings.sol"; import "./IAddressManager.sol"; diff --git a/packages/protocol/contracts/common/EssentialContract.sol b/packages/protocol/contracts/common/EssentialContract.sol index 7973fc04385..cfd783f8082 100644 --- a/packages/protocol/contracts/common/EssentialContract.sol +++ b/packages/protocol/contracts/common/EssentialContract.sol @@ -4,7 +4,7 @@ // | |/ _` | | / / _ \ | |__/ _` | '_ (_-< // |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -pragma solidity ^0.8.9; +pragma solidity ^0.8.18; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; // solhint-disable-next-line max-line-length diff --git a/packages/protocol/contracts/common/IAddressManager.sol b/packages/protocol/contracts/common/IAddressManager.sol index 77cec20ade0..a5c6ab046df 100644 --- a/packages/protocol/contracts/common/IAddressManager.sol +++ b/packages/protocol/contracts/common/IAddressManager.sol @@ -4,7 +4,7 @@ // | |/ _` | | / / _ \ | |__/ _` | '_ (_-< // |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -pragma solidity ^0.8.9; +pragma solidity ^0.8.18; /** * @author dantaik diff --git a/packages/protocol/contracts/common/IHeaderSync.sol b/packages/protocol/contracts/common/IHeaderSync.sol index 586d27046c4..8f64a77408e 100644 --- a/packages/protocol/contracts/common/IHeaderSync.sol +++ b/packages/protocol/contracts/common/IHeaderSync.sol @@ -4,7 +4,7 @@ // | |/ _` | | / / _ \ | |__/ _` | '_ (_-< // |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -pragma solidity ^0.8.9; +pragma solidity ^0.8.18; /** * Interface implemented by both the TaikoL1 and TaikoL2 contracts. It exposes diff --git a/packages/protocol/contracts/common/IMintableERC20.sol b/packages/protocol/contracts/common/IMintableERC20.sol index 047679fb96c..aeb48d98206 100644 --- a/packages/protocol/contracts/common/IMintableERC20.sol +++ b/packages/protocol/contracts/common/IMintableERC20.sol @@ -4,7 +4,7 @@ // | |/ _` | | / / _ \ | |__/ _` | '_ (_-< // |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -pragma solidity ^0.8.9; +pragma solidity ^0.8.18; import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; diff --git a/packages/protocol/contracts/libs/Lib1559Math.sol b/packages/protocol/contracts/libs/Lib1559Math.sol index 63661f28110..06746912a71 100644 --- a/packages/protocol/contracts/libs/Lib1559Math.sol +++ b/packages/protocol/contracts/libs/Lib1559Math.sol @@ -4,7 +4,7 @@ // | |/ _` | | / / _ \ | |__/ _` | '_ (_-< // |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -pragma solidity ^0.8.9; +pragma solidity ^0.8.18; /** * @author dantaik diff --git a/packages/protocol/contracts/libs/LibAddress.sol b/packages/protocol/contracts/libs/LibAddress.sol index 3606c9ec23f..61391c50a10 100644 --- a/packages/protocol/contracts/libs/LibAddress.sol +++ b/packages/protocol/contracts/libs/LibAddress.sol @@ -4,7 +4,7 @@ // | |/ _` | | / / _ \ | |__/ _` | '_ (_-< // |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -pragma solidity ^0.8.9; +pragma solidity ^0.8.18; /** * This library offers address-related methods. diff --git a/packages/protocol/contracts/libs/LibAnchorSignature.sol b/packages/protocol/contracts/libs/LibAnchorSignature.sol index 4bb36e83ec6..69962ac0101 100644 --- a/packages/protocol/contracts/libs/LibAnchorSignature.sol +++ b/packages/protocol/contracts/libs/LibAnchorSignature.sol @@ -4,7 +4,7 @@ // | |/ _` | | / / _ \ | |__/ _` | '_ (_-< // |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -pragma solidity ^0.8.9; +pragma solidity ^0.8.18; import "./LibUint512Math.sol"; diff --git a/packages/protocol/contracts/libs/LibBlockHeader.sol b/packages/protocol/contracts/libs/LibBlockHeader.sol index 9873eb540fc..30ebe075de9 100644 --- a/packages/protocol/contracts/libs/LibBlockHeader.sol +++ b/packages/protocol/contracts/libs/LibBlockHeader.sol @@ -4,7 +4,7 @@ // | |/ _` | | / / _ \ | |__/ _` | '_ (_-< // |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -pragma solidity ^0.8.9; +pragma solidity ^0.8.18; import "../thirdparty/LibRLPWriter.sol"; diff --git a/packages/protocol/contracts/libs/LibInvalidTxList.sol b/packages/protocol/contracts/libs/LibInvalidTxList.sol index 6354f4c9942..99f6e50cd64 100644 --- a/packages/protocol/contracts/libs/LibInvalidTxList.sol +++ b/packages/protocol/contracts/libs/LibInvalidTxList.sol @@ -4,7 +4,7 @@ // | |/ _` | | / / _ \ | |__/ _` | '_ (_-< // |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -pragma solidity ^0.8.9; +pragma solidity ^0.8.18; import "../L1/TaikoData.sol"; import "../libs/LibTxDecoder.sol"; diff --git a/packages/protocol/contracts/libs/LibMath.sol b/packages/protocol/contracts/libs/LibMath.sol index 1793c2f2da1..f1bcc74b66e 100644 --- a/packages/protocol/contracts/libs/LibMath.sol +++ b/packages/protocol/contracts/libs/LibMath.sol @@ -4,7 +4,7 @@ // | |/ _` | | / / _ \ | |__/ _` | '_ (_-< // |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -pragma solidity ^0.8.9; +pragma solidity ^0.8.18; /** * @author dantaik diff --git a/packages/protocol/contracts/libs/LibReceiptDecoder.sol b/packages/protocol/contracts/libs/LibReceiptDecoder.sol index 5f939619ece..d14e9197379 100644 --- a/packages/protocol/contracts/libs/LibReceiptDecoder.sol +++ b/packages/protocol/contracts/libs/LibReceiptDecoder.sol @@ -4,7 +4,7 @@ // | |/ _` | | / / _ \ | |__/ _` | '_ (_-< // |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -pragma solidity ^0.8.9; +pragma solidity ^0.8.18; import "../thirdparty/LibBytesUtils.sol"; import "../thirdparty/LibRLPReader.sol"; diff --git a/packages/protocol/contracts/libs/LibSharedConfig.sol b/packages/protocol/contracts/libs/LibSharedConfig.sol index 1a38a3dac22..bfde1b6d260 100644 --- a/packages/protocol/contracts/libs/LibSharedConfig.sol +++ b/packages/protocol/contracts/libs/LibSharedConfig.sol @@ -4,7 +4,7 @@ // | |/ _` | | / / _ \ | |__/ _` | '_ (_-< // |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -pragma solidity ^0.8.9; +pragma solidity ^0.8.18; import "../L1/TaikoData.sol"; diff --git a/packages/protocol/contracts/libs/LibTrieProof.sol b/packages/protocol/contracts/libs/LibTrieProof.sol index 1b832ea4379..5d7e6a12f0e 100644 --- a/packages/protocol/contracts/libs/LibTrieProof.sol +++ b/packages/protocol/contracts/libs/LibTrieProof.sol @@ -4,7 +4,7 @@ // | |/ _` | | / / _ \ | |__/ _` | '_ (_-< // |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -pragma solidity ^0.8.9; +pragma solidity ^0.8.18; import "../thirdparty/LibRLPReader.sol"; import "../thirdparty/LibRLPWriter.sol"; diff --git a/packages/protocol/contracts/libs/LibTxDecoder.sol b/packages/protocol/contracts/libs/LibTxDecoder.sol index 953dddf399c..edbd1973146 100644 --- a/packages/protocol/contracts/libs/LibTxDecoder.sol +++ b/packages/protocol/contracts/libs/LibTxDecoder.sol @@ -4,7 +4,7 @@ // | |/ _` | | / / _ \ | |__/ _` | '_ (_-< // |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -pragma solidity ^0.8.9; +pragma solidity ^0.8.18; import "../thirdparty/LibBytesUtils.sol"; import "../thirdparty/LibRLPReader.sol"; diff --git a/packages/protocol/contracts/libs/LibTxUtils.sol b/packages/protocol/contracts/libs/LibTxUtils.sol index 840106f490b..c7ef36419a2 100644 --- a/packages/protocol/contracts/libs/LibTxUtils.sol +++ b/packages/protocol/contracts/libs/LibTxUtils.sol @@ -4,7 +4,7 @@ // | |/ _` | | / / _ \ | |__/ _` | '_ (_-< // |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -pragma solidity ^0.8.9; +pragma solidity ^0.8.18; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; diff --git a/packages/protocol/contracts/libs/LibUint512Math.sol b/packages/protocol/contracts/libs/LibUint512Math.sol index 11fc66dfd25..16facea87b1 100644 --- a/packages/protocol/contracts/libs/LibUint512Math.sol +++ b/packages/protocol/contracts/libs/LibUint512Math.sol @@ -23,7 +23,7 @@ // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -pragma solidity ^0.8.9; +pragma solidity ^0.8.18; library LibUint512Math { /** diff --git a/packages/protocol/contracts/libs/LibZKP.sol b/packages/protocol/contracts/libs/LibZKP.sol index e30bdd51fcb..113356bef1d 100644 --- a/packages/protocol/contracts/libs/LibZKP.sol +++ b/packages/protocol/contracts/libs/LibZKP.sol @@ -4,7 +4,7 @@ // | |/ _` | | / / _ \ | |__/ _` | '_ (_-< // |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -pragma solidity ^0.8.9; +pragma solidity ^0.8.18; library LibZKP { /********************* diff --git a/packages/protocol/contracts/signal/ISignalService.sol b/packages/protocol/contracts/signal/ISignalService.sol index c5d2bf01df9..cf4c18ff215 100644 --- a/packages/protocol/contracts/signal/ISignalService.sol +++ b/packages/protocol/contracts/signal/ISignalService.sol @@ -4,7 +4,7 @@ // | |/ _` | | / / _ \ | |__/ _` | '_ (_-< // |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -pragma solidity ^0.8.9; +pragma solidity ^0.8.18; interface ISignalService { /** diff --git a/packages/protocol/contracts/signal/SignalService.sol b/packages/protocol/contracts/signal/SignalService.sol index 61920fe0fe9..d0dd7fdd0ea 100644 --- a/packages/protocol/contracts/signal/SignalService.sol +++ b/packages/protocol/contracts/signal/SignalService.sol @@ -4,7 +4,7 @@ // | |/ _` | | / / _ \ | |__/ _` | '_ (_-< // |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -pragma solidity ^0.8.9; +pragma solidity ^0.8.18; import "../common/EssentialContract.sol"; import "../common/IHeaderSync.sol"; diff --git a/packages/protocol/contracts/test/L1/TestTaikoL1.sol b/packages/protocol/contracts/test/L1/TestTaikoL1.sol index c6b28ef0c07..3d9a9b61c7a 100644 --- a/packages/protocol/contracts/test/L1/TestTaikoL1.sol +++ b/packages/protocol/contracts/test/L1/TestTaikoL1.sol @@ -4,7 +4,7 @@ // | |/ _` | | / / _ \ | |__/ _` | '_ (_-< // |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -pragma solidity ^0.8.9; +pragma solidity ^0.8.18; import {IProofVerifier} from "../../L1/ProofVerifier.sol"; import "../../L1/TaikoL1.sol"; diff --git a/packages/protocol/contracts/test/L1/TestTaikoL1EnableTokenomics.sol b/packages/protocol/contracts/test/L1/TestTaikoL1EnableTokenomics.sol index 6a593e7b4fa..c8fd3f04fce 100644 --- a/packages/protocol/contracts/test/L1/TestTaikoL1EnableTokenomics.sol +++ b/packages/protocol/contracts/test/L1/TestTaikoL1EnableTokenomics.sol @@ -4,7 +4,7 @@ // | |/ _` | | / / _ \ | |__/ _` | '_ (_-< // |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -pragma solidity ^0.8.9; +pragma solidity ^0.8.18; import {IProofVerifier} from "../../L1/ProofVerifier.sol"; import "../../L1/TaikoL1.sol"; diff --git a/packages/protocol/contracts/test/L1/TestTaikoL2.sol b/packages/protocol/contracts/test/L1/TestTaikoL2.sol index 91642bbe58b..ae786c018e1 100644 --- a/packages/protocol/contracts/test/L1/TestTaikoL2.sol +++ b/packages/protocol/contracts/test/L1/TestTaikoL2.sol @@ -4,7 +4,7 @@ // | |/ _` | | / / _ \ | |__/ _` | '_ (_-< // |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -pragma solidity ^0.8.9; +pragma solidity ^0.8.18; import "../../L2/TaikoL2.sol"; diff --git a/packages/protocol/contracts/test/L1/TestTaikoL2EnablePublicInputsCheck.sol b/packages/protocol/contracts/test/L1/TestTaikoL2EnablePublicInputsCheck.sol index dc5ff33b5f4..7f479f97bbc 100644 --- a/packages/protocol/contracts/test/L1/TestTaikoL2EnablePublicInputsCheck.sol +++ b/packages/protocol/contracts/test/L1/TestTaikoL2EnablePublicInputsCheck.sol @@ -4,7 +4,7 @@ // | |/ _` | | / / _ \ | |__/ _` | '_ (_-< // |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -pragma solidity ^0.8.9; +pragma solidity ^0.8.18; import "../../L2/TaikoL2.sol"; diff --git a/packages/protocol/contracts/test/bridge/BullToken.sol b/packages/protocol/contracts/test/bridge/BullToken.sol index 86d2d0e82cc..7b8e59d8615 100644 --- a/packages/protocol/contracts/test/bridge/BullToken.sol +++ b/packages/protocol/contracts/test/bridge/BullToken.sol @@ -4,7 +4,7 @@ // | |/ _` | | / / _ \ | |__/ _` | '_ (_-< // |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -pragma solidity ^0.8.9; +pragma solidity ^0.8.18; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; diff --git a/packages/protocol/contracts/test/bridge/TestHeaderSync.sol b/packages/protocol/contracts/test/bridge/TestHeaderSync.sol index 2afe3692b17..de1ae478463 100644 --- a/packages/protocol/contracts/test/bridge/TestHeaderSync.sol +++ b/packages/protocol/contracts/test/bridge/TestHeaderSync.sol @@ -4,7 +4,7 @@ // | |/ _` | | / / _ \ | |__/ _` | '_ (_-< // |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -pragma solidity ^0.8.9; +pragma solidity ^0.8.18; import "../../common/IHeaderSync.sol"; diff --git a/packages/protocol/contracts/test/bridge/libs/TestBadReceiver.sol b/packages/protocol/contracts/test/bridge/libs/TestBadReceiver.sol index 69c811fa069..3deadd43611 100644 --- a/packages/protocol/contracts/test/bridge/libs/TestBadReceiver.sol +++ b/packages/protocol/contracts/test/bridge/libs/TestBadReceiver.sol @@ -4,7 +4,7 @@ // | |/ _` | | / / _ \ | |__/ _` | '_ (_-< // |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -pragma solidity ^0.8.9; +pragma solidity ^0.8.18; // TODO(roger): Merge this file into TestReceiver.sol. contract TestBadReceiver { diff --git a/packages/protocol/contracts/test/bridge/libs/TestLibBridgeData.sol b/packages/protocol/contracts/test/bridge/libs/TestLibBridgeData.sol index 1b4f551c141..638ede8e6c3 100644 --- a/packages/protocol/contracts/test/bridge/libs/TestLibBridgeData.sol +++ b/packages/protocol/contracts/test/bridge/libs/TestLibBridgeData.sol @@ -4,7 +4,7 @@ // | |/ _` | | / / _ \ | |__/ _` | '_ (_-< // |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -pragma solidity ^0.8.9; +pragma solidity ^0.8.18; import "../../../bridge/libs/LibBridgeData.sol"; import "../../../bridge/libs/LibBridgeStatus.sol"; diff --git a/packages/protocol/contracts/test/bridge/libs/TestLibBridgeInvoke.sol b/packages/protocol/contracts/test/bridge/libs/TestLibBridgeInvoke.sol index c3c47e4dae2..a3c9bca01af 100644 --- a/packages/protocol/contracts/test/bridge/libs/TestLibBridgeInvoke.sol +++ b/packages/protocol/contracts/test/bridge/libs/TestLibBridgeInvoke.sol @@ -4,7 +4,7 @@ // | |/ _` | | / / _ \ | |__/ _` | '_ (_-< // |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -pragma solidity ^0.8.9; +pragma solidity ^0.8.18; import "../../../bridge/libs/LibBridgeInvoke.sol"; diff --git a/packages/protocol/contracts/test/bridge/libs/TestLibBridgeProcess.sol b/packages/protocol/contracts/test/bridge/libs/TestLibBridgeProcess.sol index 7c35d35f4bb..d5a3b4ca5fe 100644 --- a/packages/protocol/contracts/test/bridge/libs/TestLibBridgeProcess.sol +++ b/packages/protocol/contracts/test/bridge/libs/TestLibBridgeProcess.sol @@ -4,7 +4,7 @@ // | |/ _` | | / / _ \ | |__/ _` | '_ (_-< // |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -pragma solidity ^0.8.9; +pragma solidity ^0.8.18; import "../../../common/EssentialContract.sol"; import "../../../bridge/libs/LibBridgeProcess.sol"; diff --git a/packages/protocol/contracts/test/bridge/libs/TestLibBridgeRetry.sol b/packages/protocol/contracts/test/bridge/libs/TestLibBridgeRetry.sol index d1ae2667ce9..9c72e9c2b0f 100644 --- a/packages/protocol/contracts/test/bridge/libs/TestLibBridgeRetry.sol +++ b/packages/protocol/contracts/test/bridge/libs/TestLibBridgeRetry.sol @@ -4,7 +4,7 @@ // | |/ _` | | / / _ \ | |__/ _` | '_ (_-< // |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -pragma solidity ^0.8.9; +pragma solidity ^0.8.18; import "../../../common/EssentialContract.sol"; import "../../../bridge/libs/LibBridgeData.sol"; diff --git a/packages/protocol/contracts/test/bridge/libs/TestLibBridgeSend.sol b/packages/protocol/contracts/test/bridge/libs/TestLibBridgeSend.sol index ac6f028ddef..053c45ab273 100644 --- a/packages/protocol/contracts/test/bridge/libs/TestLibBridgeSend.sol +++ b/packages/protocol/contracts/test/bridge/libs/TestLibBridgeSend.sol @@ -4,7 +4,7 @@ // | |/ _` | | / / _ \ | |__/ _` | '_ (_-< // |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -pragma solidity ^0.8.9; +pragma solidity ^0.8.18; import "../../../common/EssentialContract.sol"; import "../../../bridge/libs/LibBridgeSend.sol"; diff --git a/packages/protocol/contracts/test/bridge/libs/TestReceiver.sol b/packages/protocol/contracts/test/bridge/libs/TestReceiver.sol index ebc844885ab..94e1bc519c4 100644 --- a/packages/protocol/contracts/test/bridge/libs/TestReceiver.sol +++ b/packages/protocol/contracts/test/bridge/libs/TestReceiver.sol @@ -4,7 +4,7 @@ // | |/ _` | | / / _ \ | |__/ _` | '_ (_-< // |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -pragma solidity ^0.8.9; +pragma solidity ^0.8.18; import "hardhat/console.sol"; diff --git a/packages/protocol/contracts/test/libs/TestLib1559Math.sol b/packages/protocol/contracts/test/libs/TestLib1559Math.sol index 1697131247a..9019662b7a6 100644 --- a/packages/protocol/contracts/test/libs/TestLib1559Math.sol +++ b/packages/protocol/contracts/test/libs/TestLib1559Math.sol @@ -4,7 +4,7 @@ // | |/ _` | | / / _ \ | |__/ _` | '_ (_-< // |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -pragma solidity ^0.8.9; +pragma solidity ^0.8.18; import "../../libs/Lib1559Math.sol"; diff --git a/packages/protocol/contracts/test/libs/TestLibAnchorSignature.sol b/packages/protocol/contracts/test/libs/TestLibAnchorSignature.sol index 7f73b039f6a..38b4c4af914 100644 --- a/packages/protocol/contracts/test/libs/TestLibAnchorSignature.sol +++ b/packages/protocol/contracts/test/libs/TestLibAnchorSignature.sol @@ -4,7 +4,7 @@ // | |/ _` | | / / _ \ | |__/ _` | '_ (_-< // |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -pragma solidity ^0.8.9; +pragma solidity ^0.8.18; import "../../libs/LibAnchorSignature.sol"; diff --git a/packages/protocol/contracts/test/libs/TestLibBlockHeader.sol b/packages/protocol/contracts/test/libs/TestLibBlockHeader.sol index 15e8e641841..6b02fa325bc 100644 --- a/packages/protocol/contracts/test/libs/TestLibBlockHeader.sol +++ b/packages/protocol/contracts/test/libs/TestLibBlockHeader.sol @@ -4,7 +4,7 @@ // | |/ _` | | / / _ \ | |__/ _` | '_ (_-< // |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -pragma solidity ^0.8.9; +pragma solidity ^0.8.18; import "../../libs/LibBlockHeader.sol"; diff --git a/packages/protocol/contracts/test/libs/TestLibProving.sol b/packages/protocol/contracts/test/libs/TestLibProving.sol index ff5c2d8aae4..5234bd49b15 100644 --- a/packages/protocol/contracts/test/libs/TestLibProving.sol +++ b/packages/protocol/contracts/test/libs/TestLibProving.sol @@ -12,7 +12,7 @@ // @dev we need to update this when we update LibProving.sol -pragma solidity ^0.8.9; +pragma solidity ^0.8.18; import "../../L1/libs/LibProving.sol"; import "../../common/AddressResolver.sol"; diff --git a/packages/protocol/contracts/test/libs/TestLibReceiptDecoder.sol b/packages/protocol/contracts/test/libs/TestLibReceiptDecoder.sol index 0e889ae9d91..03b0d2ad6ea 100644 --- a/packages/protocol/contracts/test/libs/TestLibReceiptDecoder.sol +++ b/packages/protocol/contracts/test/libs/TestLibReceiptDecoder.sol @@ -4,7 +4,7 @@ // | |/ _` | | / / _ \ | |__/ _` | '_ (_-< // |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -pragma solidity ^0.8.9; +pragma solidity ^0.8.18; import "../../libs/LibReceiptDecoder.sol"; diff --git a/packages/protocol/contracts/test/libs/TestLibTrieProof.sol b/packages/protocol/contracts/test/libs/TestLibTrieProof.sol index a5bf2bf5a45..5328929bbef 100644 --- a/packages/protocol/contracts/test/libs/TestLibTrieProof.sol +++ b/packages/protocol/contracts/test/libs/TestLibTrieProof.sol @@ -4,7 +4,7 @@ // | |/ _` | | / / _ \ | |__/ _` | '_ (_-< // |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -pragma solidity ^0.8.9; +pragma solidity ^0.8.18; import "../../libs/LibTrieProof.sol"; diff --git a/packages/protocol/contracts/test/libs/TestLibTxUtils.sol b/packages/protocol/contracts/test/libs/TestLibTxUtils.sol index 1c88e8318fa..b34f8362d76 100644 --- a/packages/protocol/contracts/test/libs/TestLibTxUtils.sol +++ b/packages/protocol/contracts/test/libs/TestLibTxUtils.sol @@ -4,7 +4,7 @@ // | |/ _` | | / / _ \ | |__/ _` | '_ (_-< // |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -pragma solidity ^0.8.9; +pragma solidity ^0.8.18; import "../../libs/LibTxUtils.sol"; diff --git a/packages/protocol/contracts/test/thirdparty/TestERC20.sol b/packages/protocol/contracts/test/thirdparty/TestERC20.sol index 79da5f86d74..fa36ca8781b 100644 --- a/packages/protocol/contracts/test/thirdparty/TestERC20.sol +++ b/packages/protocol/contracts/test/thirdparty/TestERC20.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.9; +pragma solidity ^0.8.18; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; diff --git a/packages/protocol/contracts/test/thirdparty/TestLibBlockHeaderDecoder.sol b/packages/protocol/contracts/test/thirdparty/TestLibBlockHeaderDecoder.sol index defb1a8ec28..5e01167ac3e 100644 --- a/packages/protocol/contracts/test/thirdparty/TestLibBlockHeaderDecoder.sol +++ b/packages/protocol/contracts/test/thirdparty/TestLibBlockHeaderDecoder.sol @@ -4,7 +4,7 @@ // | |/ _` | | / / _ \ | |__/ _` | '_ (_-< // |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -pragma solidity ^0.8.9; +pragma solidity ^0.8.18; import "../../thirdparty/LibBlockHeaderDecoder.sol"; diff --git a/packages/protocol/contracts/test/thirdparty/TestLibMerkleTrie.sol b/packages/protocol/contracts/test/thirdparty/TestLibMerkleTrie.sol index 23f8671908f..8a98bbc7b25 100644 --- a/packages/protocol/contracts/test/thirdparty/TestLibMerkleTrie.sol +++ b/packages/protocol/contracts/test/thirdparty/TestLibMerkleTrie.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.9; +pragma solidity ^0.8.18; /* Library Imports */ import {LibMerkleTrie} from "../../thirdparty/LibMerkleTrie.sol"; diff --git a/packages/protocol/contracts/test/thirdparty/TestLibRLPReader.sol b/packages/protocol/contracts/test/thirdparty/TestLibRLPReader.sol index 1a69b2dbbcb..9b665fba2f7 100644 --- a/packages/protocol/contracts/test/thirdparty/TestLibRLPReader.sol +++ b/packages/protocol/contracts/test/thirdparty/TestLibRLPReader.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.9; +pragma solidity ^0.8.18; import {LibRLPReader} from "../../thirdparty/LibRLPReader.sol"; diff --git a/packages/protocol/contracts/test/thirdparty/TestLibRLPWriter.sol b/packages/protocol/contracts/test/thirdparty/TestLibRLPWriter.sol index 2671c700a4f..6b4832eb764 100644 --- a/packages/protocol/contracts/test/thirdparty/TestLibRLPWriter.sol +++ b/packages/protocol/contracts/test/thirdparty/TestLibRLPWriter.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.9; +pragma solidity ^0.8.18; import {LibRLPWriter} from "../../thirdparty/LibRLPWriter.sol"; diff --git a/packages/protocol/contracts/test/thirdparty/TestLibSecureMerkleTrie.sol b/packages/protocol/contracts/test/thirdparty/TestLibSecureMerkleTrie.sol index 6c899ffc861..b88e97dd466 100644 --- a/packages/protocol/contracts/test/thirdparty/TestLibSecureMerkleTrie.sol +++ b/packages/protocol/contracts/test/thirdparty/TestLibSecureMerkleTrie.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.9; +pragma solidity ^0.8.18; /* Library Imports */ import {LibSecureMerkleTrie} from "../../thirdparty/LibSecureMerkleTrie.sol"; diff --git a/packages/protocol/contracts/test/thirdparty/TestMessageSender.sol b/packages/protocol/contracts/test/thirdparty/TestMessageSender.sol index f91591f1697..8835dfa9dc5 100644 --- a/packages/protocol/contracts/test/thirdparty/TestMessageSender.sol +++ b/packages/protocol/contracts/test/thirdparty/TestMessageSender.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.9; +pragma solidity ^0.8.18; import "../../bridge/IBridge.sol"; diff --git a/packages/protocol/contracts/test/thirdparty/TestTKOToken.sol b/packages/protocol/contracts/test/thirdparty/TestTKOToken.sol index 4a913152cfd..59796e5b189 100644 --- a/packages/protocol/contracts/test/thirdparty/TestTKOToken.sol +++ b/packages/protocol/contracts/test/thirdparty/TestTKOToken.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.9; +pragma solidity ^0.8.18; import "../../L1/TkoToken.sol"; contract TestTkoToken is TkoToken { diff --git a/packages/protocol/contracts/thirdparty/AddressManager.sol b/packages/protocol/contracts/thirdparty/AddressManager.sol index 115bdb4d188..2e17ca83458 100644 --- a/packages/protocol/contracts/thirdparty/AddressManager.sol +++ b/packages/protocol/contracts/thirdparty/AddressManager.sol @@ -29,7 +29,7 @@ // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -pragma solidity ^0.8.9; +pragma solidity ^0.8.18; /* External Imports */ import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; diff --git a/packages/protocol/contracts/thirdparty/LibBlockHeaderDecoder.sol b/packages/protocol/contracts/thirdparty/LibBlockHeaderDecoder.sol index ccbf989952e..17215c4b28d 100644 --- a/packages/protocol/contracts/thirdparty/LibBlockHeaderDecoder.sol +++ b/packages/protocol/contracts/thirdparty/LibBlockHeaderDecoder.sol @@ -2,7 +2,7 @@ // Taken from https://github.com/privacy-scaling-explorations/zkevm-chain/blob/master/contracts/ZkEvmL2MessageDeliverer.sol#L23 // NOTE: No MIT license provided at the time, only SPDX-License-Identifier -pragma solidity ^0.8.9; +pragma solidity ^0.8.18; /** * @title LibBlockHeaderDecoder @@ -16,203 +16,219 @@ library LibBlockHeaderDecoder { /// @return _timestamp The timestamp /// @return _transactionsRoot The transactionsRoot /// @return _receiptsRoot The receiptsRoot - function decodeBlockHeader (bytes calldata blockHeader, bytes32 blockHash, bool postEIP1559) - public - pure - returns ( - bytes32 _stateRoot, - uint256 _timestamp, - bytes32 _transactionsRoot, - bytes32 _receiptsRoot - ) { - uint256 numFields = postEIP1559? 16:15; - assembly { - // TODO: use templating techniques and DRY code (with PatriciaValidator). - - // function Error(string) - function revertWith (msg) { - mstore(0, shl(224, 0x08c379a0)) - mstore(4, 32) - mstore(68, msg) - let msgLen - for {} msg {} { - msg := shl(8, msg) - msgLen := add(msgLen, 1) + function decodeBlockHeader( + bytes calldata blockHeader, + bytes32 blockHash, + bool postEIP1559 + ) + public + pure + returns ( + bytes32 _stateRoot, + uint256 _timestamp, + bytes32 _transactionsRoot, + bytes32 _receiptsRoot + ) + { + uint256 numFields = postEIP1559 ? 16 : 15; + assembly { + // TODO: use templating techniques and DRY code (with PatriciaValidator). + + // function Error(string) + function revertWith(msg) { + mstore(0, shl(224, 0x08c379a0)) + mstore(4, 32) + mstore(68, msg) + let msgLen + for { + + } msg { + + } { + msg := shl(8, msg) + msgLen := add(msgLen, 1) + } + mstore(36, msgLen) + revert(0, 100) + } + + // loads and aligns a value from calldata + // given the `len|offset` stored at `memPtr` + function loadValue(memPtr) -> value, len { + let tmp := mload(memPtr) + // assuming 0xffffff is sufficient for storing calldata offset + let offset := and(tmp, 0xffffff) + len := shr(128, tmp) + + if gt(len, 31) { + // special case - truncating the value is intended. + // this matches the behavior in `derivePath` that truncates to 256 bits. + offset := add(offset, sub(len, 32)) + value := calldataload(offset) + leave + } + + // everything else is + // < 32 bytes - align the value + let bits := mul(sub(32, len), 8) + value := calldataload(offset) + value := shr(bits, value) + } + + // returns the `len` of the whole RLP list at `ptr` + // and the offset for the first value inside the list. + function decodeListLength(ptr) -> len, startOffset { + let firstByte := byte(0, calldataload(ptr)) + + // SHORT LIST + // 0 - 55 bytes + // 0xc0 - 0xf7 + if lt(firstByte, 0xf8) { + len := sub(firstByte, 0xbf) + startOffset := add(ptr, 1) + leave + } + + // LONG LIST + // 0xf8 - 0xff + // > 55 bytes + { + let lenOf := sub(firstByte, 0xf7) + + // load the extended length + startOffset := add(ptr, 1) + let extendedLen := calldataload(startOffset) + let bits := sub(256, mul(lenOf, 8)) + extendedLen := shr(bits, extendedLen) + + len := add(extendedLen, lenOf) + len := add(len, 1) + startOffset := add(startOffset, lenOf) + leave + } + } + + // returns the calldata offset of the value and the length in bytes + // for the RLP encoded data item at `ptr`. + // used in `decodeFlat` + function decodeValue(ptr) -> dataLen, valueOffset, isData { + let firstByte := byte(0, calldataload(ptr)) + + // SINGLE BYTE + // 0x00 - 0x7f + if lt(firstByte, 0x80) { + dataLen := 1 + valueOffset := ptr + isData := 1 + leave + } + + // DATA ITEM + // 0 - 55 bytes long + // 0x80 - 0xb7 + if lt(firstByte, 0xb8) { + dataLen := sub(firstByte, 0x80) + valueOffset := add(ptr, 1) + isData := 1 + leave + } + + // LONG DATA ITEM + // > 55 bytes + // 0xb8 - 0xbf + if lt(firstByte, 0xc0) { + // the extended length is ignored + dataLen := sub(firstByte, 0xb7) + + // load the extended length + valueOffset := add(ptr, 1) + let extendedLen := calldataload(valueOffset) + let bits := sub(256, mul(dataLen, 8)) + valueOffset := add(ptr, dataLen) + dataLen := shr(bits, extendedLen) + leave + } + + // everything else is unexpected + revertWith("RLP") + } + + // decodes all RLP encoded data and stores their DATA items + // [length, calldata offset] in a continous memory region. + // Expects that the RLP starts with a list that defines the length + // of the whole RLP region. + function decodeFlat(_ptr) -> ptr, memStart, nItems, hash { + ptr := _ptr + + // load free memory ptr + // doesn't update the ptr and leaves the memory region dirty + memStart := mload(64) + + let payloadLen, startOffset := decodeListLength(ptr) + // reuse memStart region and hash + calldatacopy(memStart, ptr, payloadLen) + hash := keccak256(memStart, payloadLen) + + let memPtr := memStart + let ptrStop := add(ptr, payloadLen) + ptr := startOffset + + // decode until the end of the list + for { + + } lt(ptr, ptrStop) { + + } { + let len, valuePtr, isData := decodeValue(ptr) + ptr := add(len, valuePtr) + + if isData { + // store the length of the data and the calldata offset + let tmp := or(shl(128, len), valuePtr) + mstore(memPtr, tmp) + memPtr := add(memPtr, 32) + } + } + + nItems := div(sub(memPtr, memStart), 32) + } + + // expecting 16 individual items from the block header + let calldataPtr, memStart, nItems, hash := decodeFlat( + blockHeader.offset + ) + + // boundary check + if iszero( + eq(calldataPtr, add(blockHeader.offset, blockHeader.length)) + ) { + revertWith("BOUNDS") + } + if iszero(eq(hash, blockHash)) { + revertWith("HASH") + } + + // Depends on if EIP1559 is enabled, check the item size to be 15 or 16. + if iszero(eq(nItems, numFields)) { + revertWith("ITEMS") + } + + // at position 11 should be the timestamp + let len + _timestamp, len := loadValue(add(memStart, mul(32, 11))) + // sstore(originTimestamp.slot, value) + + // at position 3 should be the stateRoot + _stateRoot, len := loadValue(add(memStart, mul(32, 3))) + // sstore(originStateRoot.slot, value) + + // at position 4 should be transactionsRoot + _transactionsRoot, len := loadValue(add(memStart, mul(32, 4))) + // sstore(originTransactionsRoot.slot, value) + + // at position 5 should be receiptsRoot + _receiptsRoot, len := loadValue(add(memStart, mul(32, 5))) + // sstore(originReceiptsRoot.slot, value) } - mstore(36, msgLen) - revert(0, 100) - } - - // loads and aligns a value from calldata - // given the `len|offset` stored at `memPtr` - function loadValue (memPtr) -> value, len { - let tmp := mload(memPtr) - // assuming 0xffffff is sufficient for storing calldata offset - let offset := and(tmp, 0xffffff) - len := shr(128, tmp) - - if gt(len, 31) { - // special case - truncating the value is intended. - // this matches the behavior in `derivePath` that truncates to 256 bits. - offset := add(offset, sub(len, 32)) - value := calldataload(offset) - leave - } - - // everything else is - // < 32 bytes - align the value - let bits := mul( sub(32, len), 8) - value := calldataload(offset) - value := shr(bits, value) - } - - // returns the `len` of the whole RLP list at `ptr` - // and the offset for the first value inside the list. - function decodeListLength (ptr) -> len, startOffset { - let firstByte := byte(0, calldataload(ptr)) - - // SHORT LIST - // 0 - 55 bytes - // 0xc0 - 0xf7 - if lt(firstByte, 0xf8) { - len := sub(firstByte, 0xbf) - startOffset := add(ptr, 1) - leave - } - - // LONG LIST - // 0xf8 - 0xff - // > 55 bytes - { - let lenOf := sub(firstByte, 0xf7) - - // load the extended length - startOffset := add(ptr, 1) - let extendedLen := calldataload(startOffset) - let bits := sub(256, mul(lenOf, 8)) - extendedLen := shr(bits, extendedLen) - - len := add(extendedLen, lenOf) - len := add(len, 1) - startOffset := add(startOffset, lenOf) - leave - } - } - - // returns the calldata offset of the value and the length in bytes - // for the RLP encoded data item at `ptr`. - // used in `decodeFlat` - function decodeValue (ptr) -> dataLen, valueOffset, isData { - let firstByte := byte(0, calldataload(ptr)) - - // SINGLE BYTE - // 0x00 - 0x7f - if lt(firstByte, 0x80) { - dataLen := 1 - valueOffset := ptr - isData := 1 - leave - } - - // DATA ITEM - // 0 - 55 bytes long - // 0x80 - 0xb7 - if lt(firstByte, 0xb8) { - dataLen := sub(firstByte, 0x80) - valueOffset := add(ptr, 1) - isData := 1 - leave - } - - // LONG DATA ITEM - // > 55 bytes - // 0xb8 - 0xbf - if lt(firstByte, 0xc0) { - // the extended length is ignored - dataLen := sub(firstByte, 0xb7) - - // load the extended length - valueOffset := add(ptr, 1) - let extendedLen := calldataload(valueOffset) - let bits := sub(256, mul(dataLen, 8)) - valueOffset := add(ptr, dataLen) - dataLen := shr(bits, extendedLen) - leave - } - - // everything else is unexpected - revertWith('RLP') - } - - // decodes all RLP encoded data and stores their DATA items - // [length, calldata offset] in a continous memory region. - // Expects that the RLP starts with a list that defines the length - // of the whole RLP region. - function decodeFlat (_ptr) -> ptr, memStart, nItems, hash { - ptr := _ptr - - // load free memory ptr - // doesn't update the ptr and leaves the memory region dirty - memStart := mload(64) - - let payloadLen, startOffset := decodeListLength(ptr) - // reuse memStart region and hash - calldatacopy(memStart, ptr, payloadLen) - hash := keccak256(memStart, payloadLen) - - let memPtr := memStart - let ptrStop := add(ptr, payloadLen) - ptr := startOffset - - // decode until the end of the list - for {} lt(ptr, ptrStop) {} { - let len, valuePtr, isData := decodeValue(ptr) - ptr := add(len, valuePtr) - - if isData { - // store the length of the data and the calldata offset - let tmp := or(shl(128, len), valuePtr) - mstore(memPtr, tmp) - memPtr := add(memPtr, 32) - } - } - - nItems := div( sub(memPtr, memStart), 32 ) - } - - // expecting 16 individual items from the block header - let calldataPtr, memStart, nItems, hash := decodeFlat(blockHeader.offset) - - // boundary check - if iszero( eq(calldataPtr, add(blockHeader.offset, blockHeader.length)) ) { - revertWith('BOUNDS') - } - if iszero( eq(hash, blockHash) ) { - revertWith('HASH') - } - - // Depends on if EIP1559 is enabled, check the item size to be 15 or 16. - if iszero( eq(nItems, numFields) ) { - revertWith('ITEMS') - } - - // at position 11 should be the timestamp - let len - _timestamp, len := loadValue(add(memStart, mul(32, 11))) - // sstore(originTimestamp.slot, value) - - // at position 3 should be the stateRoot - _stateRoot, len := loadValue(add(memStart, mul(32, 3))) - // sstore(originStateRoot.slot, value) - - // at position 4 should be transactionsRoot - _transactionsRoot, len := loadValue(add(memStart, mul(32, 4))) - // sstore(originTransactionsRoot.slot, value) - - // at position 5 should be receiptsRoot - _receiptsRoot, len := loadValue(add(memStart, mul(32, 5))) - // sstore(originReceiptsRoot.slot, value) - } - } } diff --git a/packages/protocol/contracts/thirdparty/LibBytesUtils.sol b/packages/protocol/contracts/thirdparty/LibBytesUtils.sol index 23b2949ca76..69f27184251 100644 --- a/packages/protocol/contracts/thirdparty/LibBytesUtils.sol +++ b/packages/protocol/contracts/thirdparty/LibBytesUtils.sol @@ -24,7 +24,7 @@ // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -pragma solidity ^0.8.9; +pragma solidity ^0.8.18; /** * @title LibBytesUtils diff --git a/packages/protocol/contracts/thirdparty/LibMerkleTrie.sol b/packages/protocol/contracts/thirdparty/LibMerkleTrie.sol index bb4de176c66..5c5446858d3 100644 --- a/packages/protocol/contracts/thirdparty/LibMerkleTrie.sol +++ b/packages/protocol/contracts/thirdparty/LibMerkleTrie.sol @@ -24,7 +24,7 @@ // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -pragma solidity ^0.8.9; +pragma solidity ^0.8.18; /* Library Imports */ import {LibBytesUtils} from "./LibBytesUtils.sol"; diff --git a/packages/protocol/contracts/thirdparty/LibRLPReader.sol b/packages/protocol/contracts/thirdparty/LibRLPReader.sol index 9b4fb79be92..3df840372c8 100644 --- a/packages/protocol/contracts/thirdparty/LibRLPReader.sol +++ b/packages/protocol/contracts/thirdparty/LibRLPReader.sol @@ -24,7 +24,7 @@ // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -pragma solidity ^0.8.9; +pragma solidity ^0.8.18; /** * @title LibRLPReader diff --git a/packages/protocol/contracts/thirdparty/LibRLPWriter.sol b/packages/protocol/contracts/thirdparty/LibRLPWriter.sol index 7c50f134948..ae256de5e78 100644 --- a/packages/protocol/contracts/thirdparty/LibRLPWriter.sol +++ b/packages/protocol/contracts/thirdparty/LibRLPWriter.sol @@ -25,7 +25,7 @@ // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -pragma solidity ^0.8.9; +pragma solidity ^0.8.18; /** * @title LibRLPWriter diff --git a/packages/protocol/contracts/thirdparty/LibSecureMerkleTrie.sol b/packages/protocol/contracts/thirdparty/LibSecureMerkleTrie.sol index deebd47579f..8a8f63f597f 100644 --- a/packages/protocol/contracts/thirdparty/LibSecureMerkleTrie.sol +++ b/packages/protocol/contracts/thirdparty/LibSecureMerkleTrie.sol @@ -24,7 +24,7 @@ // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -pragma solidity ^0.8.9; +pragma solidity ^0.8.18; /* Library Imports */ import {LibMerkleTrie} from "./LibMerkleTrie.sol";