From 33395c3f678609dca02f745ff2e0dc617b7b77fe Mon Sep 17 00:00:00 2001 From: d1onys1us <13951458+d1onys1us@users.noreply.github.com> Date: Wed, 28 Feb 2024 22:25:51 -0500 Subject: [PATCH] docs(protocol,repo): standardize protocol docs (#16178) Co-authored-by: David --- CONTRIBUTING.md | 37 ++++++++++++++++--- packages/protocol/contracts/L1/ITaikoL1.sol | 13 ------- packages/protocol/contracts/L1/TaikoData.sol | 15 +------- .../protocol/contracts/L1/TaikoErrors.sol | 21 ++--------- .../protocol/contracts/L1/TaikoEvents.sol | 15 +------- packages/protocol/contracts/L1/TaikoL1.sol | 28 ++++---------- packages/protocol/contracts/L1/TaikoToken.sol | 17 +-------- .../contracts/L1/gov/TaikoGovernor.sol | 13 ------- .../L1/gov/TaikoTimelockController.sol | 13 ------- .../contracts/L1/hooks/AssignmentHook.sol | 15 +------- .../protocol/contracts/L1/hooks/IHook.sol | 13 ------- .../contracts/L1/libs/LibDepositing.sol | 15 +------- .../contracts/L1/libs/LibProposing.sol | 15 +------- .../protocol/contracts/L1/libs/LibProving.sol | 15 +------- .../protocol/contracts/L1/libs/LibUtils.sol | 17 +-------- .../contracts/L1/libs/LibVerifying.sol | 15 +------- .../contracts/L1/provers/GuardianProver.sol | 13 ------- .../contracts/L1/provers/Guardians.sol | 13 ------- .../contracts/L1/tiers/DevnetTierProvider.sol | 15 +------- .../contracts/L1/tiers/ITierProvider.sol | 15 +------- .../L1/tiers/MainnetTierProvider.sol | 15 +------- .../L1/tiers/TestnetTierProvider.sol | 15 +------- .../protocol/contracts/L2/CrossChainOwned.sol | 15 +------- .../protocol/contracts/L2/Lib1559Math.sol | 17 +-------- packages/protocol/contracts/L2/TaikoL2.sol | 15 +------- .../L2/TaikoL2EIP1559Configurable.sol | 15 +------- packages/protocol/contracts/bridge/Bridge.sol | 19 ++-------- .../protocol/contracts/bridge/IBridge.sol | 15 +------- .../contracts/common/AddressManager.sol | 15 +------- .../contracts/common/AddressResolver.sol | 22 +---------- .../contracts/common/EssentialContract.sol | 13 ------- .../contracts/common/IAddressManager.sol | 16 +------- .../contracts/common/IAddressResolver.sol | 20 ++-------- packages/protocol/contracts/libs/Lib4844.sol | 17 +-------- .../protocol/contracts/libs/LibAddress.sol | 17 +-------- packages/protocol/contracts/libs/LibMath.sol | 15 +------- .../protocol/contracts/libs/LibTrieProof.sol | 2 +- .../contracts/signal/ISignalService.sol | 15 +------- .../protocol/contracts/signal/LibSignals.sol | 13 ------- .../contracts/signal/SignalService.sol | 17 +-------- .../contracts/team/TimelockTokenPool.sol | 17 +-------- .../contracts/team/airdrop/ERC20Airdrop.sol | 15 +------- .../contracts/team/airdrop/ERC20Airdrop2.sol | 17 +-------- .../contracts/team/airdrop/ERC721Airdrop.sol | 13 ------- .../team/airdrop/MerkleClaimable.sol | 15 +------- .../thirdparty/solmate/LibFixedPointMath.sol | 3 +- .../contracts/tokenvault/BaseNFTVault.sol | 15 +------- .../contracts/tokenvault/BaseVault.sol | 13 ------- .../contracts/tokenvault/BridgedERC1155.sol | 15 +------- .../contracts/tokenvault/BridgedERC20.sol | 15 +------- .../contracts/tokenvault/BridgedERC20Base.sol | 13 ------- .../contracts/tokenvault/BridgedERC721.sol | 15 +------- .../contracts/tokenvault/ERC1155Vault.sol | 15 +------- .../contracts/tokenvault/ERC20Vault.sol | 17 +-------- .../contracts/tokenvault/ERC721Vault.sol | 20 ++-------- .../contracts/tokenvault/IBridgedERC20.sol | 15 +------- .../contracts/tokenvault/LibBridgedToken.sol | 13 ------- .../tokenvault/adapters/USDCAdapter.sol | 13 ------- .../contracts/verifiers/GuardianVerifier.sol | 13 ------- .../contracts/verifiers/IVerifier.sol | 17 +-------- .../contracts/verifiers/SgxVerifier.sol | 22 +++-------- packages/protocol/foundry.toml | 2 +- .../script/AddSGXVerifierInstances.s.sol | 13 ------- .../script/AuthorizeTaikoForMultihop.s.sol | 17 +-------- .../protocol/script/DeployERC20Airdrop.s.sol | 13 ------- packages/protocol/script/DeployOnL1.s.sol | 21 ++--------- .../protocol/script/DeployUSDCAdapter.s.sol | 13 ------- packages/protocol/script/SetAddress.s.sol | 13 ------- packages/protocol/script/SetDcapParams.s.sol | 13 ------- .../script/SetRemoteBridgeSuites.s.sol | 13 ------- .../upgrade/UpgradeAddressManager.s.sol | 15 +------- .../upgrade/UpgradeAssignmentHook.s.sol | 15 +------- .../script/upgrade/UpgradeBridge.s.sol | 15 +------- .../script/upgrade/UpgradeERC1155Vault.s.sol | 15 +------- .../script/upgrade/UpgradeERC20Vault.s.sol | 15 +------- .../script/upgrade/UpgradeERC721Vault.s.sol | 15 +------- .../upgrade/UpgradeGuardianProver.s.sol | 15 +------- .../script/upgrade/UpgradeScript.s.sol | 13 ------- .../script/upgrade/UpgradeSignalService.s.sol | 15 +------- .../script/upgrade/UpgradeTaikoGovernor.s.sol | 15 +------- .../script/upgrade/UpgradeTaikoL1.s.sol | 15 +------- .../script/upgrade/UpgradeTierProvider.s.sol | 13 ------- .../upgrade/UpgradeTimelockController.s.sol | 15 +------- 83 files changed, 125 insertions(+), 1136 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6951c4b5cda..175274c3d4a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -29,26 +29,53 @@ Because we squash all of the changes into a single commit, please try to keep th For example, `feat(scope): description of feature` should only impact the `scope` package. If your change is a global one, you can use `feat: description of feature`, for example. -### Source code comments +### Source code comments (NatSpec) Follow the [NatSpec format](https://docs.soliditylang.org/en/latest/natspec-format.html) for documenting smart contract source code. Please adhere to a few additional standards: +#### Contract header + +All contracts should have at the top, and nothing else (minimum viable documentation): + +``` +// SPDX-License-Identifier: MIT +pragma solidity 0.8.24; +``` + +All contracts should have, preceding their declaration, at minimum: + +``` +/// @title A title +/// @custom:security-contact security@taiko.xyz +``` + +#### Single tag + +Always use a single tag, for example do not do this: + +``` +/// @dev Here is a dev comment. +/// @dev Here is another dev comment. +``` + +Instead, combine them into a single comment. + #### Comment style Choose `///` over `/** */` for multi-line NatSpec comments for consistency. All NatSpec comments should use `///` instead of `/** */`. Additional explanatory comments should use `//`, even for multi-line comments. #### Notice tag -Omit the usage of `@notice` and let the compiler automatically pick it up to save column space. For example, this: +Explicitly use `@notice`, don't let the compiler pick it up automatically: ``` -/// @notice This is a notice. +/// This is a notice. ``` becomes this: ``` -/// This is a notice. +/// @notice This is a notice. ``` #### Annotation indentation @@ -168,7 +195,7 @@ If you are referring to some struct or function within the file you can use the #### Documenting interfaces -To document the implementing contract of an interface, you cannot use `@inheritdoc`, it is not supported for contracts. Thus, you should mention a statement like so: +To document the implementing contract of an interface, you cannot use `@inheritdoc`, it is not supported for contracts at the top-level. Thus, you should mention a statement like so: ```solidity /// @notice See the documentation in {IProverPool} diff --git a/packages/protocol/contracts/L1/ITaikoL1.sol b/packages/protocol/contracts/L1/ITaikoL1.sol index df280f43ec8..7823dccd6da 100644 --- a/packages/protocol/contracts/L1/ITaikoL1.sol +++ b/packages/protocol/contracts/L1/ITaikoL1.sol @@ -1,17 +1,4 @@ // SPDX-License-Identifier: MIT -// _____ _ _ _ _ -// |_ _|_ _(_) |_____ | | __ _| |__ ___ -// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< -// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -// -// Email: security@taiko.xyz -// Website: https://taiko.xyz -// GitHub: https://github.com/taikoxyz -// Discord: https://discord.gg/taikoxyz -// Twitter: https://twitter.com/taikoxyz -// Blog: https://mirror.xyz/labs.taiko.eth -// Youtube: https://www.youtube.com/@taikoxyz - pragma solidity 0.8.24; import "./TaikoData.sol"; diff --git a/packages/protocol/contracts/L1/TaikoData.sol b/packages/protocol/contracts/L1/TaikoData.sol index 35ef11ccd6c..0b5513e8bb1 100644 --- a/packages/protocol/contracts/L1/TaikoData.sol +++ b/packages/protocol/contracts/L1/TaikoData.sol @@ -1,23 +1,10 @@ // SPDX-License-Identifier: MIT -// _____ _ _ _ _ -// |_ _|_ _(_) |_____ | | __ _| |__ ___ -// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< -// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -// -// Email: security@taiko.xyz -// Website: https://taiko.xyz -// GitHub: https://github.com/taikoxyz -// Discord: https://discord.gg/taikoxyz -// Twitter: https://twitter.com/taikoxyz -// Blog: https://mirror.xyz/labs.taiko.eth -// Youtube: https://www.youtube.com/@taikoxyz - pragma solidity 0.8.24; /// @title TaikoData -/// @custom:security-contact security@taiko.xyz /// @notice This library defines various data structures used in the Taiko /// protocol. +/// @custom:security-contact security@taiko.xyz library TaikoData { /// @dev Struct holding Taiko configuration parameters. See {TaikoConfig}. struct Config { diff --git a/packages/protocol/contracts/L1/TaikoErrors.sol b/packages/protocol/contracts/L1/TaikoErrors.sol index fced9d6374f..4f106e59210 100644 --- a/packages/protocol/contracts/L1/TaikoErrors.sol +++ b/packages/protocol/contracts/L1/TaikoErrors.sol @@ -1,27 +1,14 @@ // SPDX-License-Identifier: MIT -// _____ _ _ _ _ -// |_ _|_ _(_) |_____ | | __ _| |__ ___ -// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< -// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -// -// Email: security@taiko.xyz -// Website: https://taiko.xyz -// GitHub: https://github.com/taikoxyz -// Discord: https://discord.gg/taikoxyz -// Twitter: https://twitter.com/taikoxyz -// Blog: https://mirror.xyz/labs.taiko.eth -// Youtube: https://www.youtube.com/@taikoxyz - pragma solidity 0.8.24; /// @title TaikoErrors -/// @custom:security-contact security@taiko.xyz -/// @notice This abstract contract provides custom error declartions used in +/// @notice This abstract contract provides custom error declarations used in /// the Taiko protocol. Each error corresponds to specific situations where /// exceptions might be thrown. +/// @dev The errors defined here must match the definitions in the corresponding +/// L1 libraries. +/// @custom:security-contact security@taiko.xyz abstract contract TaikoErrors { - // NOTE: The following custom errors must match the definitions in - // `L1/libs/*.sol`. error L1_ALREADY_CONTESTED(); error L1_ALREADY_PROVED(); error L1_ASSIGNED_PROVER_NOT_ALLOWED(); diff --git a/packages/protocol/contracts/L1/TaikoEvents.sol b/packages/protocol/contracts/L1/TaikoEvents.sol index 5218e29eb31..c751bcbf77d 100644 --- a/packages/protocol/contracts/L1/TaikoEvents.sol +++ b/packages/protocol/contracts/L1/TaikoEvents.sol @@ -1,28 +1,15 @@ // SPDX-License-Identifier: MIT -// _____ _ _ _ _ -// |_ _|_ _(_) |_____ | | __ _| |__ ___ -// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< -// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -// -// Email: security@taiko.xyz -// Website: https://taiko.xyz -// GitHub: https://github.com/taikoxyz -// Discord: https://discord.gg/taikoxyz -// Twitter: https://twitter.com/taikoxyz -// Blog: https://mirror.xyz/labs.taiko.eth -// Youtube: https://www.youtube.com/@taikoxyz - pragma solidity 0.8.24; import "./TaikoData.sol"; /// @title TaikoEvents -/// @custom:security-contact security@taiko.xyz /// @notice This abstract contract provides event declarations for the Taiko /// protocol, which are emitted during block proposal, proof, verification, and /// Ethereum deposit processes. /// @dev The events defined here must match the definitions in the corresponding /// L1 libraries. +/// @custom:security-contact security@taiko.xyz abstract contract TaikoEvents { /// @dev Emitted when a block is proposed. /// @param blockId The ID of the proposed block. diff --git a/packages/protocol/contracts/L1/TaikoL1.sol b/packages/protocol/contracts/L1/TaikoL1.sol index 3f6d34d8701..337cc0f6a46 100644 --- a/packages/protocol/contracts/L1/TaikoL1.sol +++ b/packages/protocol/contracts/L1/TaikoL1.sol @@ -1,17 +1,4 @@ // SPDX-License-Identifier: MIT -// _____ _ _ _ _ -// |_ _|_ _(_) |_____ | | __ _| |__ ___ -// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< -// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -// -// Email: security@taiko.xyz -// Website: https://taiko.xyz -// GitHub: https://github.com/taikoxyz -// Discord: https://discord.gg/taikoxyz -// Twitter: https://twitter.com/taikoxyz -// Blog: https://mirror.xyz/labs.taiko.eth -// Youtube: https://www.youtube.com/@taikoxyz - pragma solidity 0.8.24; import "../common/EssentialContract.sol"; @@ -24,15 +11,14 @@ import "./TaikoErrors.sol"; import "./TaikoEvents.sol"; /// @title TaikoL1 -/// @custom:security-contact security@taiko.xyz +/// @notice This contract serves as the "base layer contract" of the Taiko protocol, providing +/// functionalities for proposing, proving, and verifying blocks. The term "base layer contract" +/// means that although this is usually deployed on L1, it can also be deployed on L2s to create +/// L3 "inception layers". The contract also handles the deposit and withdrawal of Taiko tokens +/// and Ether. Additionally, this contract doesn't hold any Ether. Ether deposited to L2 are held +/// by the Bridge contract. /// @dev Labeled in AddressResolver as "taiko" -/// @notice This contract serves as the "base layer contract" of the Taiko -/// protocol, providing functionalities for proposing, proving, and verifying -/// blocks. The term "base layer contract" means that although this is usually -/// deployed on L1, it can also be deployed on L2s to create L3s ("inception -/// layers"). The contract also handles the deposit and withdrawal of Taiko -/// tokens and Ether. -/// This contract doesn't hold any Ether. Ether deposited to L2 are held by the Bridge contract. +/// @custom:security-contact security@taiko.xyz contract TaikoL1 is EssentialContract, ITaikoL1, ITierProvider, TaikoEvents, TaikoErrors { TaikoData.State public state; uint256[50] private __gap; diff --git a/packages/protocol/contracts/L1/TaikoToken.sol b/packages/protocol/contracts/L1/TaikoToken.sol index f6f8cf49211..e4f281f8c8c 100644 --- a/packages/protocol/contracts/L1/TaikoToken.sol +++ b/packages/protocol/contracts/L1/TaikoToken.sol @@ -1,17 +1,4 @@ // SPDX-License-Identifier: MIT -// _____ _ _ _ _ -// |_ _|_ _(_) |_____ | | __ _| |__ ___ -// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< -// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -// -// Email: security@taiko.xyz -// Website: https://taiko.xyz -// GitHub: https://github.com/taikoxyz -// Discord: https://discord.gg/taikoxyz -// Twitter: https://twitter.com/taikoxyz -// Blog: https://mirror.xyz/labs.taiko.eth -// Youtube: https://www.youtube.com/@taikoxyz - pragma solidity 0.8.24; import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol"; @@ -20,11 +7,11 @@ import "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20VotesUpg import "../common/EssentialContract.sol"; /// @title TaikoToken -/// @custom:security-contact security@taiko.xyz -/// @dev Labeled in AddressResolver as "taiko_token" /// @notice The TaikoToken (TKO), in the protocol is used for prover collateral /// in the form of bonds. It is an ERC20 token with 18 decimal places of /// precision. +/// @dev Labeled in AddressResolver as "taiko_token" +/// @custom:security-contact security@taiko.xyz contract TaikoToken is EssentialContract, ERC20SnapshotUpgradeable, ERC20VotesUpgradeable { uint256[50] private __gap; diff --git a/packages/protocol/contracts/L1/gov/TaikoGovernor.sol b/packages/protocol/contracts/L1/gov/TaikoGovernor.sol index 57e1085af7a..a6a4c125273 100644 --- a/packages/protocol/contracts/L1/gov/TaikoGovernor.sol +++ b/packages/protocol/contracts/L1/gov/TaikoGovernor.sol @@ -1,17 +1,4 @@ // SPDX-License-Identifier: MIT -// _____ _ _ _ _ -// |_ _|_ _(_) |_____ | | __ _| |__ ___ -// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< -// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -// -// Email: security@taiko.xyz -// Website: https://taiko.xyz -// GitHub: https://github.com/taikoxyz -// Discord: https://discord.gg/taikoxyz -// Twitter: https://twitter.com/taikoxyz -// Blog: https://mirror.xyz/labs.taiko.eth -// Youtube: https://www.youtube.com/@taikoxyz - pragma solidity 0.8.24; import "@openzeppelin/contracts-upgradeable/governance/GovernorUpgradeable.sol"; diff --git a/packages/protocol/contracts/L1/gov/TaikoTimelockController.sol b/packages/protocol/contracts/L1/gov/TaikoTimelockController.sol index 0704405284c..42331f4e9eb 100644 --- a/packages/protocol/contracts/L1/gov/TaikoTimelockController.sol +++ b/packages/protocol/contracts/L1/gov/TaikoTimelockController.sol @@ -1,17 +1,4 @@ // SPDX-License-Identifier: MIT -// _____ _ _ _ _ -// |_ _|_ _(_) |_____ | | __ _| |__ ___ -// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< -// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -// -// Email: security@taiko.xyz -// Website: https://taiko.xyz -// GitHub: https://github.com/taikoxyz -// Discord: https://discord.gg/taikoxyz -// Twitter: https://twitter.com/taikoxyz -// Blog: https://mirror.xyz/labs.taiko.eth -// Youtube: https://www.youtube.com/@taikoxyz - pragma solidity 0.8.24; import "@openzeppelin/contracts-upgradeable/governance/TimelockControllerUpgradeable.sol"; diff --git a/packages/protocol/contracts/L1/hooks/AssignmentHook.sol b/packages/protocol/contracts/L1/hooks/AssignmentHook.sol index ca584f4ca67..42ef248e8d5 100644 --- a/packages/protocol/contracts/L1/hooks/AssignmentHook.sol +++ b/packages/protocol/contracts/L1/hooks/AssignmentHook.sol @@ -1,17 +1,4 @@ // SPDX-License-Identifier: MIT -// _____ _ _ _ _ -// |_ _|_ _(_) |_____ | | __ _| |__ ___ -// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< -// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -// -// Email: security@taiko.xyz -// Website: https://taiko.xyz -// GitHub: https://github.com/taikoxyz -// Discord: https://discord.gg/taikoxyz -// Twitter: https://twitter.com/taikoxyz -// Blog: https://mirror.xyz/labs.taiko.eth -// Youtube: https://www.youtube.com/@taikoxyz - pragma solidity 0.8.24; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; @@ -22,8 +9,8 @@ import "../ITaikoL1.sol"; import "./IHook.sol"; /// @title AssignmentHook +/// @notice A hook that handles prover assignment verification and fee processing. /// @custom:security-contact security@taiko.xyz -/// A hook that handles prover assignment varification and fee processing. contract AssignmentHook is EssentialContract, IHook { using LibAddress for address; using SafeERC20 for IERC20; diff --git a/packages/protocol/contracts/L1/hooks/IHook.sol b/packages/protocol/contracts/L1/hooks/IHook.sol index f599cb8d065..04d4fab88bf 100644 --- a/packages/protocol/contracts/L1/hooks/IHook.sol +++ b/packages/protocol/contracts/L1/hooks/IHook.sol @@ -1,17 +1,4 @@ // SPDX-License-Identifier: MIT -// _____ _ _ _ _ -// |_ _|_ _(_) |_____ | | __ _| |__ ___ -// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< -// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -// -// Email: security@taiko.xyz -// Website: https://taiko.xyz -// GitHub: https://github.com/taikoxyz -// Discord: https://discord.gg/taikoxyz -// Twitter: https://twitter.com/taikoxyz -// Blog: https://mirror.xyz/labs.taiko.eth -// Youtube: https://www.youtube.com/@taikoxyz - pragma solidity 0.8.24; import "../TaikoData.sol"; diff --git a/packages/protocol/contracts/L1/libs/LibDepositing.sol b/packages/protocol/contracts/L1/libs/LibDepositing.sol index be1d6d3111e..601a2ee2914 100644 --- a/packages/protocol/contracts/L1/libs/LibDepositing.sol +++ b/packages/protocol/contracts/L1/libs/LibDepositing.sol @@ -1,17 +1,4 @@ // SPDX-License-Identifier: MIT -// _____ _ _ _ _ -// |_ _|_ _(_) |_____ | | __ _| |__ ___ -// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< -// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -// -// Email: security@taiko.xyz -// Website: https://taiko.xyz -// GitHub: https://github.com/taikoxyz -// Discord: https://discord.gg/taikoxyz -// Twitter: https://twitter.com/taikoxyz -// Blog: https://mirror.xyz/labs.taiko.eth -// Youtube: https://www.youtube.com/@taikoxyz - pragma solidity 0.8.24; import "../../common/IAddressResolver.sol"; @@ -20,8 +7,8 @@ import "../../libs/LibMath.sol"; import "../TaikoData.sol"; /// @title LibDepositing -/// @custom:security-contact security@taiko.xyz /// @notice A library for handling Ether deposits in the Taiko protocol. +/// @custom:security-contact security@taiko.xyz library LibDepositing { using LibAddress for address; using LibAddress for address payable; diff --git a/packages/protocol/contracts/L1/libs/LibProposing.sol b/packages/protocol/contracts/L1/libs/LibProposing.sol index 0a0b840c982..063e3a073d0 100644 --- a/packages/protocol/contracts/L1/libs/LibProposing.sol +++ b/packages/protocol/contracts/L1/libs/LibProposing.sol @@ -1,17 +1,4 @@ // SPDX-License-Identifier: MIT -// _____ _ _ _ _ -// |_ _|_ _(_) |_____ | | __ _| |__ ___ -// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< -// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -// -// Email: security@taiko.xyz -// Website: https://taiko.xyz -// GitHub: https://github.com/taikoxyz -// Discord: https://discord.gg/taikoxyz -// Twitter: https://twitter.com/taikoxyz -// Blog: https://mirror.xyz/labs.taiko.eth -// Youtube: https://www.youtube.com/@taikoxyz - pragma solidity 0.8.24; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; @@ -23,8 +10,8 @@ import "../TaikoData.sol"; import "./LibDepositing.sol"; /// @title LibProposing -/// @custom:security-contact security@taiko.xyz /// @notice A library for handling block proposals in the Taiko protocol. +/// @custom:security-contact security@taiko.xyz library LibProposing { using LibAddress for address; diff --git a/packages/protocol/contracts/L1/libs/LibProving.sol b/packages/protocol/contracts/L1/libs/LibProving.sol index f74939135d2..7fdb6a47146 100644 --- a/packages/protocol/contracts/L1/libs/LibProving.sol +++ b/packages/protocol/contracts/L1/libs/LibProving.sol @@ -1,17 +1,4 @@ // SPDX-License-Identifier: MIT -// _____ _ _ _ _ -// |_ _|_ _(_) |_____ | | __ _| |__ ___ -// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< -// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -// -// Email: security@taiko.xyz -// Website: https://taiko.xyz -// GitHub: https://github.com/taikoxyz -// Discord: https://discord.gg/taikoxyz -// Twitter: https://twitter.com/taikoxyz -// Blog: https://mirror.xyz/labs.taiko.eth -// Youtube: https://www.youtube.com/@taikoxyz - pragma solidity 0.8.24; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; @@ -23,9 +10,9 @@ import "../TaikoData.sol"; import "./LibUtils.sol"; /// @title LibProving -/// @custom:security-contact security@taiko.xyz /// @notice A library for handling block contestation and proving in the Taiko /// protocol. +/// @custom:security-contact security@taiko.xyz library LibProving { using LibMath for uint256; diff --git a/packages/protocol/contracts/L1/libs/LibUtils.sol b/packages/protocol/contracts/L1/libs/LibUtils.sol index 703771bc2e8..759e69d132d 100644 --- a/packages/protocol/contracts/L1/libs/LibUtils.sol +++ b/packages/protocol/contracts/L1/libs/LibUtils.sol @@ -1,24 +1,11 @@ // SPDX-License-Identifier: MIT -// _____ _ _ _ _ -// |_ _|_ _(_) |_____ | | __ _| |__ ___ -// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< -// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -// -// Email: security@taiko.xyz -// Website: https://taiko.xyz -// GitHub: https://github.com/taikoxyz -// Discord: https://discord.gg/taikoxyz -// Twitter: https://twitter.com/taikoxyz -// Blog: https://mirror.xyz/labs.taiko.eth -// Youtube: https://www.youtube.com/@taikoxyz - pragma solidity 0.8.24; import "../TaikoData.sol"; /// @title LibUtils -/// @custom:security-contact security@taiko.xyz /// @notice A library that offers helper functions. +/// @custom:security-contact security@taiko.xyz library LibUtils { // Warning: Any errors defined here must also be defined in TaikoErrors.sol. error L1_BLOCK_MISMATCH(); @@ -26,8 +13,8 @@ library LibUtils { error L1_TRANSITION_NOT_FOUND(); error L1_UNEXPECTED_TRANSITION_ID(); + /// @notice This function will revert if the transition is not found. /// @dev Retrieves the transition with a given parentHash. - /// This function will revert if the transition is not found. /// @param state Current TaikoData.State. /// @param config Actual TaikoData.Config. /// @param blockId Id of the block. diff --git a/packages/protocol/contracts/L1/libs/LibVerifying.sol b/packages/protocol/contracts/L1/libs/LibVerifying.sol index 937d0e00cde..a822a50e03a 100644 --- a/packages/protocol/contracts/L1/libs/LibVerifying.sol +++ b/packages/protocol/contracts/L1/libs/LibVerifying.sol @@ -1,17 +1,4 @@ // SPDX-License-Identifier: MIT -// _____ _ _ _ _ -// |_ _|_ _(_) |_____ | | __ _| |__ ___ -// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< -// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -// -// Email: security@taiko.xyz -// Website: https://taiko.xyz -// GitHub: https://github.com/taikoxyz -// Discord: https://discord.gg/taikoxyz -// Twitter: https://twitter.com/taikoxyz -// Blog: https://mirror.xyz/labs.taiko.eth -// Youtube: https://www.youtube.com/@taikoxyz - pragma solidity 0.8.24; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; @@ -24,8 +11,8 @@ import "../TaikoData.sol"; import "./LibUtils.sol"; /// @title LibVerifying -/// @custom:security-contact security@taiko.xyz /// @notice A library for handling block verification in the Taiko protocol. +/// @custom:security-contact security@taiko.xyz library LibVerifying { using LibMath for uint256; diff --git a/packages/protocol/contracts/L1/provers/GuardianProver.sol b/packages/protocol/contracts/L1/provers/GuardianProver.sol index 2ed232d8c6c..c03ab9b0a2f 100644 --- a/packages/protocol/contracts/L1/provers/GuardianProver.sol +++ b/packages/protocol/contracts/L1/provers/GuardianProver.sol @@ -1,17 +1,4 @@ // SPDX-License-Identifier: MIT -// _____ _ _ _ _ -// |_ _|_ _(_) |_____ | | __ _| |__ ___ -// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< -// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -// -// Email: security@taiko.xyz -// Website: https://taiko.xyz -// GitHub: https://github.com/taikoxyz -// Discord: https://discord.gg/taikoxyz -// Twitter: https://twitter.com/taikoxyz -// Blog: https://mirror.xyz/labs.taiko.eth -// Youtube: https://www.youtube.com/@taikoxyz - pragma solidity 0.8.24; import "../tiers/ITierProvider.sol"; diff --git a/packages/protocol/contracts/L1/provers/Guardians.sol b/packages/protocol/contracts/L1/provers/Guardians.sol index 09ae0946c15..b0c65229a81 100644 --- a/packages/protocol/contracts/L1/provers/Guardians.sol +++ b/packages/protocol/contracts/L1/provers/Guardians.sol @@ -1,17 +1,4 @@ // SPDX-License-Identifier: MIT -// _____ _ _ _ _ -// |_ _|_ _(_) |_____ | | __ _| |__ ___ -// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< -// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -// -// Email: security@taiko.xyz -// Website: https://taiko.xyz -// GitHub: https://github.com/taikoxyz -// Discord: https://discord.gg/taikoxyz -// Twitter: https://twitter.com/taikoxyz -// Blog: https://mirror.xyz/labs.taiko.eth -// Youtube: https://www.youtube.com/@taikoxyz - pragma solidity 0.8.24; import "../../common/EssentialContract.sol"; diff --git a/packages/protocol/contracts/L1/tiers/DevnetTierProvider.sol b/packages/protocol/contracts/L1/tiers/DevnetTierProvider.sol index dad51b1f421..1bbcfbd62d9 100644 --- a/packages/protocol/contracts/L1/tiers/DevnetTierProvider.sol +++ b/packages/protocol/contracts/L1/tiers/DevnetTierProvider.sol @@ -1,25 +1,12 @@ // SPDX-License-Identifier: MIT -// _____ _ _ _ _ -// |_ _|_ _(_) |_____ | | __ _| |__ ___ -// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< -// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -// -// Email: security@taiko.xyz -// Website: https://taiko.xyz -// GitHub: https://github.com/taikoxyz -// Discord: https://discord.gg/taikoxyz -// Twitter: https://twitter.com/taikoxyz -// Blog: https://mirror.xyz/labs.taiko.eth -// Youtube: https://www.youtube.com/@taikoxyz - pragma solidity 0.8.24; import "../../common/EssentialContract.sol"; import "./ITierProvider.sol"; /// @title DevnetTierProvider -/// @custom:security-contact security@taiko.xyz /// @dev Labeled in AddressResolver as "tier_provider" +/// @custom:security-contact security@taiko.xyz contract DevnetTierProvider is EssentialContract, ITierProvider { uint256[50] private __gap; diff --git a/packages/protocol/contracts/L1/tiers/ITierProvider.sol b/packages/protocol/contracts/L1/tiers/ITierProvider.sol index 83fb88e2f7a..b66cc7c2c2e 100644 --- a/packages/protocol/contracts/L1/tiers/ITierProvider.sol +++ b/packages/protocol/contracts/L1/tiers/ITierProvider.sol @@ -1,22 +1,9 @@ // SPDX-License-Identifier: MIT -// _____ _ _ _ _ -// |_ _|_ _(_) |_____ | | __ _| |__ ___ -// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< -// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -// -// Email: security@taiko.xyz -// Website: https://taiko.xyz -// GitHub: https://github.com/taikoxyz -// Discord: https://discord.gg/taikoxyz -// Twitter: https://twitter.com/taikoxyz -// Blog: https://mirror.xyz/labs.taiko.eth -// Youtube: https://www.youtube.com/@taikoxyz - pragma solidity 0.8.24; /// @title ITierProvider -/// @custom:security-contact security@taiko.xyz /// @notice Defines interface to return tier configuration. +/// @custom:security-contact security@taiko.xyz interface ITierProvider { struct Tier { bytes32 verifierName; diff --git a/packages/protocol/contracts/L1/tiers/MainnetTierProvider.sol b/packages/protocol/contracts/L1/tiers/MainnetTierProvider.sol index 6b96e0c6794..442bf37b8af 100644 --- a/packages/protocol/contracts/L1/tiers/MainnetTierProvider.sol +++ b/packages/protocol/contracts/L1/tiers/MainnetTierProvider.sol @@ -1,25 +1,12 @@ // SPDX-License-Identifier: MIT -// _____ _ _ _ _ -// |_ _|_ _(_) |_____ | | __ _| |__ ___ -// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< -// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -// -// Email: security@taiko.xyz -// Website: https://taiko.xyz -// GitHub: https://github.com/taikoxyz -// Discord: https://discord.gg/taikoxyz -// Twitter: https://twitter.com/taikoxyz -// Blog: https://mirror.xyz/labs.taiko.eth -// Youtube: https://www.youtube.com/@taikoxyz - pragma solidity 0.8.24; import "../../common/EssentialContract.sol"; import "./ITierProvider.sol"; /// @title MainnetTierProvider -/// @custom:security-contact security@taiko.xyz /// @dev Labeled in AddressResolver as "tier_provider" +/// @custom:security-contact security@taiko.xyz contract MainnetTierProvider is EssentialContract, ITierProvider { uint256[50] private __gap; diff --git a/packages/protocol/contracts/L1/tiers/TestnetTierProvider.sol b/packages/protocol/contracts/L1/tiers/TestnetTierProvider.sol index 82446f1288e..47ce635ad6d 100644 --- a/packages/protocol/contracts/L1/tiers/TestnetTierProvider.sol +++ b/packages/protocol/contracts/L1/tiers/TestnetTierProvider.sol @@ -1,25 +1,12 @@ // SPDX-License-Identifier: MIT -// _____ _ _ _ _ -// |_ _|_ _(_) |_____ | | __ _| |__ ___ -// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< -// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -// -// Email: security@taiko.xyz -// Website: https://taiko.xyz -// GitHub: https://github.com/taikoxyz -// Discord: https://discord.gg/taikoxyz -// Twitter: https://twitter.com/taikoxyz -// Blog: https://mirror.xyz/labs.taiko.eth -// Youtube: https://www.youtube.com/@taikoxyz - pragma solidity 0.8.24; import "../../common/EssentialContract.sol"; import "./ITierProvider.sol"; /// @title TestnetTierProvider -/// @custom:security-contact security@taiko.xyz /// @dev Labeled in AddressResolver as "tier_provider" +/// @custom:security-contact security@taiko.xyz contract TestnetTierProvider is EssentialContract, ITierProvider { uint256[50] private __gap; diff --git a/packages/protocol/contracts/L2/CrossChainOwned.sol b/packages/protocol/contracts/L2/CrossChainOwned.sol index c52dd786f7d..4c84a57eb29 100644 --- a/packages/protocol/contracts/L2/CrossChainOwned.sol +++ b/packages/protocol/contracts/L2/CrossChainOwned.sol @@ -1,17 +1,4 @@ // SPDX-License-Identifier: MIT -// _____ _ _ _ _ -// |_ _|_ _(_) |_____ | | __ _| |__ ___ -// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< -// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -// -// Email: security@taiko.xyz -// Website: https://taiko.xyz -// GitHub: https://github.com/taikoxyz -// Discord: https://discord.gg/taikoxyz -// Twitter: https://twitter.com/taikoxyz -// Blog: https://mirror.xyz/labs.taiko.eth -// Youtube: https://www.youtube.com/@taikoxyz - pragma solidity 0.8.24; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; @@ -19,11 +6,11 @@ import "../common/EssentialContract.sol"; import "../bridge/IBridge.sol"; /// @title CrossChainOwned -/// @custom:security-contact security@taiko.xyz /// @notice This contract's owner can be a local address or one that lives on another chain and uses /// signals for transaction approval. /// @dev Notice that when sending the message on the owner chain, the gas limit of the message must /// not be zero, so on this chain, some EOA can help execute this transaction. +/// @custom:security-contact security@taiko.xyz abstract contract CrossChainOwned is EssentialContract, IMessageInvocable { uint64 public ownerChainId; // slot 1 uint64 public nextTxId; diff --git a/packages/protocol/contracts/L2/Lib1559Math.sol b/packages/protocol/contracts/L2/Lib1559Math.sol index 9d5be015495..6ddbda5ecb9 100644 --- a/packages/protocol/contracts/L2/Lib1559Math.sol +++ b/packages/protocol/contracts/L2/Lib1559Math.sol @@ -1,25 +1,12 @@ // SPDX-License-Identifier: MIT -// _____ _ _ _ _ -// |_ _|_ _(_) |_____ | | __ _| |__ ___ -// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< -// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -// -// Email: security@taiko.xyz -// Website: https://taiko.xyz -// GitHub: https://github.com/taikoxyz -// Discord: https://discord.gg/taikoxyz -// Twitter: https://twitter.com/taikoxyz -// Blog: https://mirror.xyz/labs.taiko.eth -// Youtube: https://www.youtube.com/@taikoxyz - pragma solidity 0.8.24; import "../thirdparty/solmate/LibFixedPointMath.sol"; /// @title Lib1559Math +/// @notice Implements e^(x) based bonding curve for EIP-1559 +/// @dev See https://ethresear.ch/t/make-eip-1559-more-like-an-amm-curve/9082 /// @custom:security-contact security@taiko.xyz -/// @dev Implementation of e^(x) based bonding curve for EIP-1559 -/// See https://ethresear.ch/t/make-eip-1559-more-like-an-amm-curve/9082 library Lib1559Math { error EIP1559_INVALID_PARAMS(); diff --git a/packages/protocol/contracts/L2/TaikoL2.sol b/packages/protocol/contracts/L2/TaikoL2.sol index d31fb3b26d2..20b530fc95c 100644 --- a/packages/protocol/contracts/L2/TaikoL2.sol +++ b/packages/protocol/contracts/L2/TaikoL2.sol @@ -1,17 +1,4 @@ // SPDX-License-Identifier: MIT -// _____ _ _ _ _ -// |_ _|_ _(_) |_____ | | __ _| |__ ___ -// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< -// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -// -// Email: security@taiko.xyz -// Website: https://taiko.xyz -// GitHub: https://github.com/taikoxyz -// Discord: https://discord.gg/taikoxyz -// Twitter: https://twitter.com/taikoxyz -// Blog: https://mirror.xyz/labs.taiko.eth -// Youtube: https://www.youtube.com/@taikoxyz - pragma solidity 0.8.24; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; @@ -25,12 +12,12 @@ import "./Lib1559Math.sol"; import "./CrossChainOwned.sol"; /// @title TaikoL2 -/// @custom:security-contact security@taiko.xyz /// @notice Taiko L2 is a smart contract that handles cross-layer message /// verification and manages EIP-1559 gas pricing for Layer 2 (L2) operations. /// It is used to anchor the latest L1 block details to L2 for cross-layer /// communication, manage EIP-1559 parameters for gas pricing, and store /// verified L1 block information. +/// @custom:security-contact security@taiko.xyz contract TaikoL2 is CrossChainOwned { using LibAddress for address; using LibMath for uint256; diff --git a/packages/protocol/contracts/L2/TaikoL2EIP1559Configurable.sol b/packages/protocol/contracts/L2/TaikoL2EIP1559Configurable.sol index 30a9d015697..3a60867cfe5 100644 --- a/packages/protocol/contracts/L2/TaikoL2EIP1559Configurable.sol +++ b/packages/protocol/contracts/L2/TaikoL2EIP1559Configurable.sol @@ -1,24 +1,11 @@ // SPDX-License-Identifier: MIT -// _____ _ _ _ _ -// |_ _|_ _(_) |_____ | | __ _| |__ ___ -// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< -// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -// -// Email: security@taiko.xyz -// Website: https://taiko.xyz -// GitHub: https://github.com/taikoxyz -// Discord: https://discord.gg/taikoxyz -// Twitter: https://twitter.com/taikoxyz -// Blog: https://mirror.xyz/labs.taiko.eth -// Youtube: https://www.youtube.com/@taikoxyz - pragma solidity 0.8.24; import "./TaikoL2.sol"; /// @title TaikoL2EIP1559Configurable +/// @notice TaikoL2 with a setter to change EIP-1559 configurations and states. /// @custom:security-contact security@taiko.xyz -/// @notice Taiko L2 with a setter to change EIP-1559 configurations and states. contract TaikoL2EIP1559Configurable is TaikoL2 { Config public customConfig; uint256[49] private __gap; diff --git a/packages/protocol/contracts/bridge/Bridge.sol b/packages/protocol/contracts/bridge/Bridge.sol index 790f48dfba1..2346e8cfbcb 100644 --- a/packages/protocol/contracts/bridge/Bridge.sol +++ b/packages/protocol/contracts/bridge/Bridge.sol @@ -1,17 +1,4 @@ // SPDX-License-Identifier: MIT -// _____ _ _ _ _ -// |_ _|_ _(_) |_____ | | __ _| |__ ___ -// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< -// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -// -// Email: security@taiko.xyz -// Website: https://taiko.xyz -// GitHub: https://github.com/taikoxyz -// Discord: https://discord.gg/taikoxyz -// Twitter: https://twitter.com/taikoxyz -// Blog: https://mirror.xyz/labs.taiko.eth -// Youtube: https://www.youtube.com/@taikoxyz - pragma solidity 0.8.24; import "@openzeppelin/contracts/utils/Address.sol"; @@ -22,10 +9,10 @@ import "../thirdparty/nomad-xyz/ExcessivelySafeCall.sol"; import "./IBridge.sol"; /// @title Bridge -/// @custom:security-contact security@taiko.xyz -/// @dev Labeled in AddressResolver as "bridge" /// @notice See the documentation for {IBridge}. -/// @dev The code hash for the same address on L1 and L2 may be different. +/// @dev Labeled in AddressResolver as "bridge". Additionally, the code hash for the same address on +/// L1 and L2 may be different. +/// @custom:security-contact security@taiko.xyz contract Bridge is EssentialContract, IBridge { using Address for address; using LibAddress for address; diff --git a/packages/protocol/contracts/bridge/IBridge.sol b/packages/protocol/contracts/bridge/IBridge.sol index 29cc3c1ea1c..53ce8032231 100644 --- a/packages/protocol/contracts/bridge/IBridge.sol +++ b/packages/protocol/contracts/bridge/IBridge.sol @@ -1,23 +1,10 @@ // SPDX-License-Identifier: MIT -// _____ _ _ _ _ -// |_ _|_ _(_) |_____ | | __ _| |__ ___ -// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< -// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -// -// Email: security@taiko.xyz -// Website: https://taiko.xyz -// GitHub: https://github.com/taikoxyz -// Discord: https://discord.gg/taikoxyz -// Twitter: https://twitter.com/taikoxyz -// Blog: https://mirror.xyz/labs.taiko.eth -// Youtube: https://www.youtube.com/@taikoxyz - pragma solidity 0.8.24; /// @title IBridge -/// @custom:security-contact security@taiko.xyz /// @notice The bridge used in conjunction with the {ISignalService}. /// @dev Ether is held by Bridges on L1 and L2s. +/// @custom:security-contact security@taiko.xyz interface IBridge { struct Message { // Message ID. diff --git a/packages/protocol/contracts/common/AddressManager.sol b/packages/protocol/contracts/common/AddressManager.sol index 8a2f445ed36..9e1f5328687 100644 --- a/packages/protocol/contracts/common/AddressManager.sol +++ b/packages/protocol/contracts/common/AddressManager.sol @@ -1,25 +1,12 @@ // SPDX-License-Identifier: MIT -// _____ _ _ _ _ -// |_ _|_ _(_) |_____ | | __ _| |__ ___ -// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< -// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -// -// Email: security@taiko.xyz -// Website: https://taiko.xyz -// GitHub: https://github.com/taikoxyz -// Discord: https://discord.gg/taikoxyz -// Twitter: https://twitter.com/taikoxyz -// Blog: https://mirror.xyz/labs.taiko.eth -// Youtube: https://www.youtube.com/@taikoxyz - pragma solidity 0.8.24; import "./IAddressManager.sol"; import "./EssentialContract.sol"; /// @title AddressManager +/// @notice See the documentation in {IAddressManager}. /// @custom:security-contact security@taiko.xyz -/// @notice Manages a mapping of chainId-name pairs to Ethereum addresses. contract AddressManager is EssentialContract, IAddressManager { mapping(uint256 chainId => mapping(bytes32 name => address addr)) private addresses; uint256[49] private __gap; diff --git a/packages/protocol/contracts/common/AddressResolver.sol b/packages/protocol/contracts/common/AddressResolver.sol index a693175b914..d7d676bf296 100644 --- a/packages/protocol/contracts/common/AddressResolver.sol +++ b/packages/protocol/contracts/common/AddressResolver.sol @@ -1,17 +1,4 @@ // SPDX-License-Identifier: MIT -// _____ _ _ _ _ -// |_ _|_ _(_) |_____ | | __ _| |__ ___ -// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< -// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -// -// Email: security@taiko.xyz -// Website: https://taiko.xyz -// GitHub: https://github.com/taikoxyz -// Discord: https://discord.gg/taikoxyz -// Twitter: https://twitter.com/taikoxyz -// Blog: https://mirror.xyz/labs.taiko.eth -// Youtube: https://www.youtube.com/@taikoxyz - pragma solidity 0.8.24; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; @@ -19,15 +6,8 @@ import "./IAddressManager.sol"; import "./IAddressResolver.sol"; /// @title AddressResolver +/// @notice See the documentation in {IAddressResolver}. /// @custom:security-contact security@taiko.xyz -/// @notice This contract acts as a bridge for name-to-address resolution. -/// It delegates the resolution to the AddressManager. By separating the logic, -/// we can maintain flexibility in address management without affecting the -/// resolving process. -/// -/// Note that the address manager should be changed using upgradability, there -/// is no setAddressManager() function go guarantee atomicness across all -/// contracts that are resolvers. abstract contract AddressResolver is IAddressResolver, Initializable { address public addressManager; uint256[49] private __gap; diff --git a/packages/protocol/contracts/common/EssentialContract.sol b/packages/protocol/contracts/common/EssentialContract.sol index 15ff3151bca..500f802a41e 100644 --- a/packages/protocol/contracts/common/EssentialContract.sol +++ b/packages/protocol/contracts/common/EssentialContract.sol @@ -1,17 +1,4 @@ // SPDX-License-Identifier: MIT -// _____ _ _ _ _ -// |_ _|_ _(_) |_____ | | __ _| |__ ___ -// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< -// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -// -// Email: security@taiko.xyz -// Website: https://taiko.xyz -// GitHub: https://github.com/taikoxyz -// Discord: https://discord.gg/taikoxyz -// Twitter: https://twitter.com/taikoxyz -// Blog: https://mirror.xyz/labs.taiko.eth -// Youtube: https://www.youtube.com/@taikoxyz - pragma solidity 0.8.24; import "@openzeppelin/contracts/proxy/utils/UUPSUpgradeable.sol"; diff --git a/packages/protocol/contracts/common/IAddressManager.sol b/packages/protocol/contracts/common/IAddressManager.sol index 73324c3efc9..211ca7cd0fe 100644 --- a/packages/protocol/contracts/common/IAddressManager.sol +++ b/packages/protocol/contracts/common/IAddressManager.sol @@ -1,23 +1,9 @@ // SPDX-License-Identifier: MIT -// _____ _ _ _ _ -// |_ _|_ _(_) |_____ | | __ _| |__ ___ -// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< -// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -// -// Email: security@taiko.xyz -// Website: https://taiko.xyz -// GitHub: https://github.com/taikoxyz -// Discord: https://discord.gg/taikoxyz -// Twitter: https://twitter.com/taikoxyz -// Blog: https://mirror.xyz/labs.taiko.eth -// Youtube: https://www.youtube.com/@taikoxyz - pragma solidity 0.8.24; /// @title IAddressManager +/// @notice Manages a mapping of (chainId, name) pairs to Ethereum addresses. /// @custom:security-contact security@taiko.xyz -/// @notice Specifies methods to manage address mappings for given chainId-name -/// pairs. interface IAddressManager { /// @notice Gets the address mapped to a specific chainId-name pair. /// @dev Note that in production, this method shall be a pure function diff --git a/packages/protocol/contracts/common/IAddressResolver.sol b/packages/protocol/contracts/common/IAddressResolver.sol index 18001cac9cf..2b3b391bb1e 100644 --- a/packages/protocol/contracts/common/IAddressResolver.sol +++ b/packages/protocol/contracts/common/IAddressResolver.sol @@ -1,29 +1,15 @@ // SPDX-License-Identifier: MIT -// _____ _ _ _ _ -// |_ _|_ _(_) |_____ | | __ _| |__ ___ -// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< -// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -// -// Email: security@taiko.xyz -// Website: https://taiko.xyz -// GitHub: https://github.com/taikoxyz -// Discord: https://discord.gg/taikoxyz -// Twitter: https://twitter.com/taikoxyz -// Blog: https://mirror.xyz/labs.taiko.eth -// Youtube: https://www.youtube.com/@taikoxyz - pragma solidity 0.8.24; /// @title IAddressResolver -/// @custom:security-contact security@taiko.xyz /// @notice This contract acts as a bridge for name-to-address resolution. /// It delegates the resolution to the AddressManager. By separating the logic, /// we can maintain flexibility in address management without affecting the /// resolving process. -/// -/// Note that the address manager should be changed using upgradability, there -/// is no setAddressManager() function go guarantee atomicness across all +/// @dev Note that the address manager should be changed using upgradability, there +/// is no setAddressManager() function to guarantee atomicity across all /// contracts that are resolvers. +/// @custom:security-contact security@taiko.xyz interface IAddressResolver { /// @notice Resolves a name to its address deployed on this chain. /// @param name Name whose address is to be resolved. diff --git a/packages/protocol/contracts/libs/Lib4844.sol b/packages/protocol/contracts/libs/Lib4844.sol index 025ad27df16..24e0e590c84 100644 --- a/packages/protocol/contracts/libs/Lib4844.sol +++ b/packages/protocol/contracts/libs/Lib4844.sol @@ -1,23 +1,10 @@ // SPDX-License-Identifier: MIT -// _____ _ _ _ _ -// |_ _|_ _(_) |_____ | | __ _| |__ ___ -// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< -// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -// -// Email: security@taiko.xyz -// Website: https://taiko.xyz -// GitHub: https://github.com/taikoxyz -// Discord: https://discord.gg/taikoxyz -// Twitter: https://twitter.com/taikoxyz -// Blog: https://mirror.xyz/labs.taiko.eth -// Youtube: https://www.youtube.com/@taikoxyz - pragma solidity 0.8.24; /// @title Lib4844 -/// @custom:security-contact security@taiko.xyz /// @notice A library for handling EIP-4844 blobs -/// `solc contracts/libs/Lib4844.sol --ir > contracts/libs/Lib4844.yul` +/// @dev `solc contracts/libs/Lib4844.sol --ir > contracts/libs/Lib4844.yul` +/// @custom:security-contact security@taiko.xyz library Lib4844 { address public constant POINT_EVALUATION_PRECOMPILE_ADDRESS = address(0x0A); uint32 public constant FIELD_ELEMENTS_PER_BLOB = 4096; diff --git a/packages/protocol/contracts/libs/LibAddress.sol b/packages/protocol/contracts/libs/LibAddress.sol index 821c9135145..d3de8ef558d 100644 --- a/packages/protocol/contracts/libs/LibAddress.sol +++ b/packages/protocol/contracts/libs/LibAddress.sol @@ -1,17 +1,4 @@ // SPDX-License-Identifier: MIT -// _____ _ _ _ _ -// |_ _|_ _(_) |_____ | | __ _| |__ ___ -// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< -// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -// -// Email: security@taiko.xyz -// Website: https://taiko.xyz -// GitHub: https://github.com/taikoxyz -// Discord: https://discord.gg/taikoxyz -// Twitter: https://twitter.com/taikoxyz -// Blog: https://mirror.xyz/labs.taiko.eth -// Youtube: https://www.youtube.com/@taikoxyz - pragma solidity 0.8.24; import "@openzeppelin/contracts/utils/Address.sol"; @@ -19,10 +6,10 @@ import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; import "@openzeppelin/contracts/utils/introspection/IERC165.sol"; import "@openzeppelin/contracts/interfaces/IERC1271.sol"; import "../thirdparty/nomad-xyz/ExcessivelySafeCall.sol"; + /// @title LibAddress -/// @custom:security-contact security@taiko.xyz /// @dev Provides utilities for address-related operations. - +/// @custom:security-contact security@taiko.xyz library LibAddress { bytes4 private constant EIP1271_MAGICVALUE = 0x1626ba7e; diff --git a/packages/protocol/contracts/libs/LibMath.sol b/packages/protocol/contracts/libs/LibMath.sol index 0f461335121..3d53a1926dc 100644 --- a/packages/protocol/contracts/libs/LibMath.sol +++ b/packages/protocol/contracts/libs/LibMath.sol @@ -1,22 +1,9 @@ // SPDX-License-Identifier: MIT -// _____ _ _ _ _ -// |_ _|_ _(_) |_____ | | __ _| |__ ___ -// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< -// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -// -// Email: security@taiko.xyz -// Website: https://taiko.xyz -// GitHub: https://github.com/taikoxyz -// Discord: https://discord.gg/taikoxyz -// Twitter: https://twitter.com/taikoxyz -// Blog: https://mirror.xyz/labs.taiko.eth -// Youtube: https://www.youtube.com/@taikoxyz - pragma solidity 0.8.24; /// @title LibMath -/// @custom:security-contact security@taiko.xyz /// @dev This library offers additional math functions for uint256. +/// @custom:security-contact security@taiko.xyz library LibMath { /// @dev Returns the smaller of the two given values. /// @param a The first number to compare. diff --git a/packages/protocol/contracts/libs/LibTrieProof.sol b/packages/protocol/contracts/libs/LibTrieProof.sol index 1ba033e71e6..ac86586943e 100644 --- a/packages/protocol/contracts/libs/LibTrieProof.sol +++ b/packages/protocol/contracts/libs/LibTrieProof.sol @@ -4,7 +4,7 @@ // | |/ _` | | / / _ \ | |__/ _` | '_ (_-< // |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -pragma solidity ^0.8.24; +pragma solidity 0.8.24; import "../thirdparty/optimism/rlp/RLPReader.sol"; import "../thirdparty/optimism/rlp/RLPWriter.sol"; diff --git a/packages/protocol/contracts/signal/ISignalService.sol b/packages/protocol/contracts/signal/ISignalService.sol index 2d7362080bc..1537e3ee37a 100644 --- a/packages/protocol/contracts/signal/ISignalService.sol +++ b/packages/protocol/contracts/signal/ISignalService.sol @@ -1,27 +1,14 @@ // SPDX-License-Identifier: MIT -// _____ _ _ _ _ -// |_ _|_ _(_) |_____ | | __ _| |__ ___ -// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< -// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -// -// Email: security@taiko.xyz -// Website: https://taiko.xyz -// GitHub: https://github.com/taikoxyz -// Discord: https://discord.gg/taikoxyz -// Twitter: https://twitter.com/taikoxyz -// Blog: https://mirror.xyz/labs.taiko.eth -// Youtube: https://www.youtube.com/@taikoxyz - pragma solidity 0.8.24; /// @title ISignalService -/// @custom:security-contact security@taiko.xyz /// @notice The SignalService contract serves as a secure cross-chain message /// passing system. It defines methods for sending and verifying signals with /// merkle proofs. The trust assumption is that the target chain has secure /// access to the merkle root (such as Taiko injects it in the anchor /// transaction). With this, verifying a signal is reduced to simply verifying /// a merkle proof. +/// @custom:security-contact security@taiko.xyz interface ISignalService { /// @notice Emitted when a remote chain's state root or signal root is /// synced locally as a signal. diff --git a/packages/protocol/contracts/signal/LibSignals.sol b/packages/protocol/contracts/signal/LibSignals.sol index 947e6d491fe..ef4aad8bd45 100644 --- a/packages/protocol/contracts/signal/LibSignals.sol +++ b/packages/protocol/contracts/signal/LibSignals.sol @@ -1,17 +1,4 @@ // SPDX-License-Identifier: MIT -// _____ _ _ _ _ -// |_ _|_ _(_) |_____ | | __ _| |__ ___ -// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< -// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -// -// Email: security@taiko.xyz -// Website: https://taiko.xyz -// GitHub: https://github.com/taikoxyz -// Discord: https://discord.gg/taikoxyz -// Twitter: https://twitter.com/taikoxyz -// Blog: https://mirror.xyz/labs.taiko.eth -// Youtube: https://www.youtube.com/@taikoxyz - pragma solidity 0.8.24; /// @title LibSignals diff --git a/packages/protocol/contracts/signal/SignalService.sol b/packages/protocol/contracts/signal/SignalService.sol index 27694183399..3c7ed9468f3 100644 --- a/packages/protocol/contracts/signal/SignalService.sol +++ b/packages/protocol/contracts/signal/SignalService.sol @@ -1,17 +1,4 @@ // SPDX-License-Identifier: MIT -// _____ _ _ _ _ -// |_ _|_ _(_) |_____ | | __ _| |__ ___ -// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< -// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -// -// Email: security@taiko.xyz -// Website: https://taiko.xyz -// GitHub: https://github.com/taikoxyz -// Discord: https://discord.gg/taikoxyz -// Twitter: https://twitter.com/taikoxyz -// Blog: https://mirror.xyz/labs.taiko.eth -// Youtube: https://www.youtube.com/@taikoxyz - pragma solidity 0.8.24; import "@openzeppelin/contracts/utils/math/SafeCast.sol"; @@ -21,9 +8,9 @@ import "./ISignalService.sol"; import "./LibSignals.sol"; /// @title SignalService -/// @custom:security-contact security@taiko.xyz -/// @dev Labeled in AddressResolver as "signal_service" /// @notice See the documentation in {ISignalService} for more details. +/// @dev Labeled in AddressResolver as "signal_service". +/// @custom:security-contact security@taiko.xyz contract SignalService is EssentialContract, ISignalService { enum CacheOption { CACHE_NOTHING, diff --git a/packages/protocol/contracts/team/TimelockTokenPool.sol b/packages/protocol/contracts/team/TimelockTokenPool.sol index 00124fcf5ba..c869af7ed7f 100644 --- a/packages/protocol/contracts/team/TimelockTokenPool.sol +++ b/packages/protocol/contracts/team/TimelockTokenPool.sol @@ -1,17 +1,4 @@ // SPDX-License-Identifier: MIT -// _____ _ _ _ _ -// |_ _|_ _(_) |_____ | | __ _| |__ ___ -// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< -// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -// -// Email: security@taiko.xyz -// Website: https://taiko.xyz -// GitHub: https://github.com/taikoxyz -// Discord: https://discord.gg/taikoxyz -// Twitter: https://twitter.com/taikoxyz -// Blog: https://mirror.xyz/labs.taiko.eth -// Youtube: https://www.youtube.com/@taikoxyz - pragma solidity 0.8.24; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; @@ -20,8 +7,7 @@ import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "../common/EssentialContract.sol"; /// @title TimelockTokenPool -/// @custom:security-contact security@taiko.xyz -/// Contract for managing Taiko tokens allocated to different roles and +/// @notice Contract for managing Taiko tokens allocated to different roles and /// individuals. /// /// Manages Taiko tokens through a three-state lifecycle: "allocated" to @@ -35,6 +21,7 @@ import "../common/EssentialContract.sol"; /// - investors /// - team members, advisors, etc. /// - grant program grantees +/// @custom:security-contact security@taiko.xyz contract TimelockTokenPool is EssentialContract { using SafeERC20 for IERC20; diff --git a/packages/protocol/contracts/team/airdrop/ERC20Airdrop.sol b/packages/protocol/contracts/team/airdrop/ERC20Airdrop.sol index bc68c6e7d29..97228c4ef9c 100644 --- a/packages/protocol/contracts/team/airdrop/ERC20Airdrop.sol +++ b/packages/protocol/contracts/team/airdrop/ERC20Airdrop.sol @@ -1,17 +1,4 @@ // SPDX-License-Identifier: MIT -// _____ _ _ _ _ -// |_ _|_ _(_) |_____ | | __ _| |__ ___ -// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< -// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -// -// Email: security@taiko.xyz -// Website: https://taiko.xyz -// GitHub: https://github.com/taikoxyz -// Discord: https://discord.gg/taikoxyz -// Twitter: https://twitter.com/taikoxyz -// Blog: https://mirror.xyz/labs.taiko.eth -// Youtube: https://www.youtube.com/@taikoxyz - pragma solidity 0.8.24; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; @@ -19,8 +6,8 @@ import "@openzeppelin/contracts/governance/utils/IVotes.sol"; import "./MerkleClaimable.sol"; /// @title ERC20Airdrop +/// @notice Contract for managing Taiko token airdrop for eligible users. /// @custom:security-contact security@taiko.xyz -/// Contract for managing Taiko token airdrop for eligible users contract ERC20Airdrop is MerkleClaimable { address public token; address public vault; diff --git a/packages/protocol/contracts/team/airdrop/ERC20Airdrop2.sol b/packages/protocol/contracts/team/airdrop/ERC20Airdrop2.sol index 5a5039701b5..905cbf13129 100644 --- a/packages/protocol/contracts/team/airdrop/ERC20Airdrop2.sol +++ b/packages/protocol/contracts/team/airdrop/ERC20Airdrop2.sol @@ -1,17 +1,4 @@ // SPDX-License-Identifier: MIT -// _____ _ _ _ _ -// |_ _|_ _(_) |_____ | | __ _| |__ ___ -// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< -// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -// -// Email: security@taiko.xyz -// Website: https://taiko.xyz -// GitHub: https://github.com/taikoxyz -// Discord: https://discord.gg/taikoxyz -// Twitter: https://twitter.com/taikoxyz -// Blog: https://mirror.xyz/labs.taiko.eth -// Youtube: https://www.youtube.com/@taikoxyz - pragma solidity 0.8.24; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; @@ -19,9 +6,9 @@ import "../../libs/LibMath.sol"; import "./MerkleClaimable.sol"; /// @title ERC20Airdrop2 -/// @custom:security-contact security@taiko.xyz -/// Contract for managing Taiko token airdrop for eligible users but the +/// @notice Contract for managing Taiko token airdrop for eligible users, but the /// withdrawal is not immediate and is subject to a withdrawal window. +/// @custom:security-contact security@taiko.xyz contract ERC20Airdrop2 is MerkleClaimable { using LibMath for uint256; diff --git a/packages/protocol/contracts/team/airdrop/ERC721Airdrop.sol b/packages/protocol/contracts/team/airdrop/ERC721Airdrop.sol index fe7da69357d..e0011fe8e8d 100644 --- a/packages/protocol/contracts/team/airdrop/ERC721Airdrop.sol +++ b/packages/protocol/contracts/team/airdrop/ERC721Airdrop.sol @@ -1,17 +1,4 @@ // SPDX-License-Identifier: MIT -// _____ _ _ _ _ -// |_ _|_ _(_) |_____ | | __ _| |__ ___ -// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< -// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -// -// Email: security@taiko.xyz -// Website: https://taiko.xyz -// GitHub: https://github.com/taikoxyz -// Discord: https://discord.gg/taikoxyz -// Twitter: https://twitter.com/taikoxyz -// Blog: https://mirror.xyz/labs.taiko.eth -// Youtube: https://www.youtube.com/@taikoxyz - pragma solidity 0.8.24; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; diff --git a/packages/protocol/contracts/team/airdrop/MerkleClaimable.sol b/packages/protocol/contracts/team/airdrop/MerkleClaimable.sol index e5d61fbac64..4e23720e940 100644 --- a/packages/protocol/contracts/team/airdrop/MerkleClaimable.sol +++ b/packages/protocol/contracts/team/airdrop/MerkleClaimable.sol @@ -1,25 +1,12 @@ // SPDX-License-Identifier: MIT -// _____ _ _ _ _ -// |_ _|_ _(_) |_____ | | __ _| |__ ___ -// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< -// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -// -// Email: security@taiko.xyz -// Website: https://taiko.xyz -// GitHub: https://github.com/taikoxyz -// Discord: https://discord.gg/taikoxyz -// Twitter: https://twitter.com/taikoxyz -// Blog: https://mirror.xyz/labs.taiko.eth -// Youtube: https://www.youtube.com/@taikoxyz - pragma solidity 0.8.24; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; import "../../common/EssentialContract.sol"; /// @title MerkleClaimable +/// @notice Contract for managing Taiko token airdrop for eligible users /// @custom:security-contact security@taiko.xyz -/// Contract for managing Taiko token airdrop for eligible users abstract contract MerkleClaimable is EssentialContract { mapping(bytes32 hash => bool claimed) public isClaimed; bytes32 public merkleRoot; diff --git a/packages/protocol/contracts/thirdparty/solmate/LibFixedPointMath.sol b/packages/protocol/contracts/thirdparty/solmate/LibFixedPointMath.sol index 13e0e2b0af3..d30f704559e 100644 --- a/packages/protocol/contracts/thirdparty/solmate/LibFixedPointMath.sol +++ b/packages/protocol/contracts/thirdparty/solmate/LibFixedPointMath.sol @@ -5,8 +5,7 @@ pragma solidity 0.8.24; library LibFixedPointMath { uint128 public constant MAX_EXP_INPUT = 135_305_999_368_893_231_588; - uint256 public constant SCALING_FACTOR = 1e18; // For fixed point - // representation factor + uint256 public constant SCALING_FACTOR = 1e18; // For fixed point representation factor error Overflow(); diff --git a/packages/protocol/contracts/tokenvault/BaseNFTVault.sol b/packages/protocol/contracts/tokenvault/BaseNFTVault.sol index d9261a75979..c5bba056ddc 100644 --- a/packages/protocol/contracts/tokenvault/BaseNFTVault.sol +++ b/packages/protocol/contracts/tokenvault/BaseNFTVault.sol @@ -1,24 +1,11 @@ // SPDX-License-Identifier: MIT -// _____ _ _ _ _ -// |_ _|_ _(_) |_____ | | __ _| |__ ___ -// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< -// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -// -// Email: security@taiko.xyz -// Website: https://taiko.xyz -// GitHub: https://github.com/taikoxyz -// Discord: https://discord.gg/taikoxyz -// Twitter: https://twitter.com/taikoxyz -// Blog: https://mirror.xyz/labs.taiko.eth -// Youtube: https://www.youtube.com/@taikoxyz - pragma solidity 0.8.24; import "./BaseVault.sol"; /// @title BaseNFTVault -/// @custom:security-contact security@taiko.xyz /// @notice Abstract contract for bridging NFTs across different chains. +/// @custom:security-contact security@taiko.xyz abstract contract BaseNFTVault is BaseVault { // Struct representing the canonical NFT on another chain. struct CanonicalNFT { diff --git a/packages/protocol/contracts/tokenvault/BaseVault.sol b/packages/protocol/contracts/tokenvault/BaseVault.sol index 2b2ad165a0b..6eccee2f7d8 100644 --- a/packages/protocol/contracts/tokenvault/BaseVault.sol +++ b/packages/protocol/contracts/tokenvault/BaseVault.sol @@ -1,17 +1,4 @@ // SPDX-License-Identifier: MIT -// _____ _ _ _ _ -// |_ _|_ _(_) |_____ | | __ _| |__ ___ -// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< -// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -// -// Email: security@taiko.xyz -// Website: https://taiko.xyz -// GitHub: https://github.com/taikoxyz -// Discord: https://discord.gg/taikoxyz -// Twitter: https://twitter.com/taikoxyz -// Blog: https://mirror.xyz/labs.taiko.eth -// Youtube: https://www.youtube.com/@taikoxyz - pragma solidity 0.8.24; import "@openzeppelin/contracts-upgradeable/utils/introspection/IERC165Upgradeable.sol"; diff --git a/packages/protocol/contracts/tokenvault/BridgedERC1155.sol b/packages/protocol/contracts/tokenvault/BridgedERC1155.sol index 54a2de68bd1..3da6f292aba 100644 --- a/packages/protocol/contracts/tokenvault/BridgedERC1155.sol +++ b/packages/protocol/contracts/tokenvault/BridgedERC1155.sol @@ -1,17 +1,4 @@ // SPDX-License-Identifier: MIT -// _____ _ _ _ _ -// |_ _|_ _(_) |_____ | | __ _| |__ ___ -// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< -// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -// -// Email: security@taiko.xyz -// Website: https://taiko.xyz -// GitHub: https://github.com/taikoxyz -// Discord: https://discord.gg/taikoxyz -// Twitter: https://twitter.com/taikoxyz -// Blog: https://mirror.xyz/labs.taiko.eth -// Youtube: https://www.youtube.com/@taikoxyz - pragma solidity 0.8.24; import "@openzeppelin/contracts/utils/Strings.sol"; @@ -22,8 +9,8 @@ import "../common/EssentialContract.sol"; import "./LibBridgedToken.sol"; /// @title BridgedERC1155 -/// @custom:security-contact security@taiko.xyz /// @notice Contract for bridging ERC1155 tokens across different chains. +/// @custom:security-contact security@taiko.xyz contract BridgedERC1155 is EssentialContract, IERC1155MetadataURIUpgradeable, ERC1155Upgradeable { address public srcToken; // Address of the source token contract. uint256 public srcChainId; // Source chain ID where the token originates. diff --git a/packages/protocol/contracts/tokenvault/BridgedERC20.sol b/packages/protocol/contracts/tokenvault/BridgedERC20.sol index 520a1ad34a5..8ec38f4b16e 100644 --- a/packages/protocol/contracts/tokenvault/BridgedERC20.sol +++ b/packages/protocol/contracts/tokenvault/BridgedERC20.sol @@ -1,17 +1,4 @@ // SPDX-License-Identifier: MIT -// _____ _ _ _ _ -// |_ _|_ _(_) |_____ | | __ _| |__ ___ -// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< -// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -// -// Email: security@taiko.xyz -// Website: https://taiko.xyz -// GitHub: https://github.com/taikoxyz -// Discord: https://discord.gg/taikoxyz -// Twitter: https://twitter.com/taikoxyz -// Blog: https://mirror.xyz/labs.taiko.eth -// Youtube: https://www.youtube.com/@taikoxyz - pragma solidity 0.8.24; import "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.sol"; @@ -22,9 +9,9 @@ import "./LibBridgedToken.sol"; import "./BridgedERC20Base.sol"; /// @title BridgedERC20 -/// @custom:security-contact security@taiko.xyz /// @notice An upgradeable ERC20 contract that represents tokens bridged from /// another chain. +/// @custom:security-contact security@taiko.xyz contract BridgedERC20 is BridgedERC20Base, IERC20MetadataUpgradeable, diff --git a/packages/protocol/contracts/tokenvault/BridgedERC20Base.sol b/packages/protocol/contracts/tokenvault/BridgedERC20Base.sol index dfd45d39f3e..0dfdc94776c 100644 --- a/packages/protocol/contracts/tokenvault/BridgedERC20Base.sol +++ b/packages/protocol/contracts/tokenvault/BridgedERC20Base.sol @@ -1,17 +1,4 @@ // SPDX-License-Identifier: MIT -// _____ _ _ _ _ -// |_ _|_ _(_) |_____ | | __ _| |__ ___ -// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< -// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -// -// Email: security@taiko.xyz -// Website: https://taiko.xyz -// GitHub: https://github.com/taikoxyz -// Discord: https://discord.gg/taikoxyz -// Twitter: https://twitter.com/taikoxyz -// Blog: https://mirror.xyz/labs.taiko.eth -// Youtube: https://www.youtube.com/@taikoxyz - pragma solidity 0.8.24; import "../common/EssentialContract.sol"; diff --git a/packages/protocol/contracts/tokenvault/BridgedERC721.sol b/packages/protocol/contracts/tokenvault/BridgedERC721.sol index c5e7fc50f1b..6599e5bab37 100644 --- a/packages/protocol/contracts/tokenvault/BridgedERC721.sol +++ b/packages/protocol/contracts/tokenvault/BridgedERC721.sol @@ -1,17 +1,4 @@ // SPDX-License-Identifier: MIT -// _____ _ _ _ _ -// |_ _|_ _(_) |_____ | | __ _| |__ ___ -// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< -// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -// -// Email: security@taiko.xyz -// Website: https://taiko.xyz -// GitHub: https://github.com/taikoxyz -// Discord: https://discord.gg/taikoxyz -// Twitter: https://twitter.com/taikoxyz -// Blog: https://mirror.xyz/labs.taiko.eth -// Youtube: https://www.youtube.com/@taikoxyz - pragma solidity 0.8.24; import "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol"; @@ -20,8 +7,8 @@ import "../common/EssentialContract.sol"; import "./LibBridgedToken.sol"; /// @title BridgedERC721 -/// @custom:security-contact security@taiko.xyz /// @notice Contract for bridging ERC721 tokens across different chains. +/// @custom:security-contact security@taiko.xyz contract BridgedERC721 is EssentialContract, ERC721Upgradeable { address public srcToken; // Address of the source token contract. uint256 public srcChainId; // Source chain ID where the token originates. diff --git a/packages/protocol/contracts/tokenvault/ERC1155Vault.sol b/packages/protocol/contracts/tokenvault/ERC1155Vault.sol index f3e1758e353..5b8028ab0e0 100644 --- a/packages/protocol/contracts/tokenvault/ERC1155Vault.sol +++ b/packages/protocol/contracts/tokenvault/ERC1155Vault.sol @@ -1,17 +1,4 @@ // SPDX-License-Identifier: MIT -// _____ _ _ _ _ -// |_ _|_ _(_) |_____ | | __ _| |__ ___ -// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< -// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -// -// Email: security@taiko.xyz -// Website: https://taiko.xyz -// GitHub: https://github.com/taikoxyz -// Discord: https://discord.gg/taikoxyz -// Twitter: https://twitter.com/taikoxyz -// Blog: https://mirror.xyz/labs.taiko.eth -// Youtube: https://www.youtube.com/@taikoxyz - pragma solidity 0.8.24; import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol"; @@ -22,10 +9,10 @@ import "./BaseNFTVault.sol"; import "./BridgedERC1155.sol"; /// @title IERC1155NameAndSymbol -/// @custom:security-contact security@taiko.xyz /// @notice Interface for ERC1155 contracts that provide name() and symbol() /// functions. These functions may not be part of the official interface but are /// used by some contracts. +/// @custom:security-contact security@taiko.xyz interface IERC1155NameAndSymbol { function name() external view returns (string memory); function symbol() external view returns (string memory); diff --git a/packages/protocol/contracts/tokenvault/ERC20Vault.sol b/packages/protocol/contracts/tokenvault/ERC20Vault.sol index 651c19a75df..f4d98236117 100644 --- a/packages/protocol/contracts/tokenvault/ERC20Vault.sol +++ b/packages/protocol/contracts/tokenvault/ERC20Vault.sol @@ -1,17 +1,4 @@ // SPDX-License-Identifier: MIT -// _____ _ _ _ _ -// |_ _|_ _(_) |_____ | | __ _| |__ ___ -// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< -// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -// -// Email: security@taiko.xyz -// Website: https://taiko.xyz -// GitHub: https://github.com/taikoxyz -// Discord: https://discord.gg/taikoxyz -// Twitter: https://twitter.com/taikoxyz -// Blog: https://mirror.xyz/labs.taiko.eth -// Youtube: https://www.youtube.com/@taikoxyz - pragma solidity 0.8.24; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; @@ -23,11 +10,11 @@ import "./BridgedERC20.sol"; import "./BaseVault.sol"; /// @title ERC20Vault -/// @custom:security-contact security@taiko.xyz -/// @dev Labeled in AddressResolver as "erc20_vault" /// @notice This vault holds all ERC20 tokens (excluding Ether) that users have /// deposited. It also manages the mapping between canonical ERC20 tokens and /// their bridged tokens. +/// @dev Labeled in AddressResolver as "erc20_vault". +/// @custom:security-contact security@taiko.xyz contract ERC20Vault is BaseVault { using LibAddress for address; using SafeERC20 for IERC20; diff --git a/packages/protocol/contracts/tokenvault/ERC721Vault.sol b/packages/protocol/contracts/tokenvault/ERC721Vault.sol index 0c62934dcd6..a8e13028a1c 100644 --- a/packages/protocol/contracts/tokenvault/ERC721Vault.sol +++ b/packages/protocol/contracts/tokenvault/ERC721Vault.sol @@ -1,17 +1,4 @@ // SPDX-License-Identifier: MIT -// _____ _ _ _ _ -// |_ _|_ _(_) |_____ | | __ _| |__ ___ -// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< -// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -// -// Email: security@taiko.xyz -// Website: https://taiko.xyz -// GitHub: https://github.com/taikoxyz -// Discord: https://discord.gg/taikoxyz -// Twitter: https://twitter.com/taikoxyz -// Blog: https://mirror.xyz/labs.taiko.eth -// Youtube: https://www.youtube.com/@taikoxyz - pragma solidity 0.8.24; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; @@ -22,11 +9,10 @@ import "./BaseNFTVault.sol"; import "./BridgedERC721.sol"; /// @title ERC721Vault +/// @notice This vault holds all ERC721 tokens that users have deposited. It also manages +/// the mapping between canonical tokens and their bridged tokens. +/// @dev Labeled in AddressResolver as "erc721_vault". /// @custom:security-contact security@taiko.xyz -/// @dev Labeled in AddressResolver as "erc721_vault" -/// @notice This vault holds all ERC721 tokens that users have deposited. -/// It also manages the mapping between canonical tokens and their bridged -/// tokens. contract ERC721Vault is BaseNFTVault, IERC721Receiver { using LibAddress for address; diff --git a/packages/protocol/contracts/tokenvault/IBridgedERC20.sol b/packages/protocol/contracts/tokenvault/IBridgedERC20.sol index 7cd61097dc2..af93b7c425d 100644 --- a/packages/protocol/contracts/tokenvault/IBridgedERC20.sol +++ b/packages/protocol/contracts/tokenvault/IBridgedERC20.sol @@ -1,25 +1,12 @@ // SPDX-License-Identifier: MIT -// _____ _ _ _ _ -// |_ _|_ _(_) |_____ | | __ _| |__ ___ -// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< -// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -// -// Email: security@taiko.xyz -// Website: https://taiko.xyz -// GitHub: https://github.com/taikoxyz -// Discord: https://discord.gg/taikoxyz -// Twitter: https://twitter.com/taikoxyz -// Blog: https://mirror.xyz/labs.taiko.eth -// Youtube: https://www.youtube.com/@taikoxyz - pragma solidity 0.8.24; /// @title IBridgedERC20 -/// @custom:security-contact security@taiko.xyz /// @notice Interface for all bridged tokens. /// @dev To facilitate compatibility with third-party bridged tokens, such as USDC's native /// standard, it's necessary to implement an intermediary adapter contract which should conform to /// this interface, enabling effective interaction with third-party contracts. +/// @custom:security-contact security@taiko.xyz interface IBridgedERC20 { /// @notice Mints `amount` tokens and assigns them to the `account` address. /// @param account The account to receive the minted tokens. diff --git a/packages/protocol/contracts/tokenvault/LibBridgedToken.sol b/packages/protocol/contracts/tokenvault/LibBridgedToken.sol index 1123135f3b2..61114c61e33 100644 --- a/packages/protocol/contracts/tokenvault/LibBridgedToken.sol +++ b/packages/protocol/contracts/tokenvault/LibBridgedToken.sol @@ -1,17 +1,4 @@ // SPDX-License-Identifier: MIT -// _____ _ _ _ _ -// |_ _|_ _(_) |_____ | | __ _| |__ ___ -// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< -// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -// -// Email: security@taiko.xyz -// Website: https://taiko.xyz -// GitHub: https://github.com/taikoxyz -// Discord: https://discord.gg/taikoxyz -// Twitter: https://twitter.com/taikoxyz -// Blog: https://mirror.xyz/labs.taiko.eth -// Youtube: https://www.youtube.com/@taikoxyz - pragma solidity 0.8.24; import "@openzeppelin/contracts/utils/Strings.sol"; diff --git a/packages/protocol/contracts/tokenvault/adapters/USDCAdapter.sol b/packages/protocol/contracts/tokenvault/adapters/USDCAdapter.sol index dfce097c7d8..5dd71b0c753 100644 --- a/packages/protocol/contracts/tokenvault/adapters/USDCAdapter.sol +++ b/packages/protocol/contracts/tokenvault/adapters/USDCAdapter.sol @@ -1,17 +1,4 @@ // SPDX-License-Identifier: MIT -// _____ _ _ _ _ -// |_ _|_ _(_) |_____ | | __ _| |__ ___ -// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< -// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -// -// Email: security@taiko.xyz -// Website: https://taiko.xyz -// GitHub: https://github.com/taikoxyz -// Discord: https://discord.gg/taikoxyz -// Twitter: https://twitter.com/taikoxyz -// Blog: https://mirror.xyz/labs.taiko.eth -// Youtube: https://www.youtube.com/@taikoxyz - pragma solidity 0.8.24; import "../BridgedERC20Base.sol"; diff --git a/packages/protocol/contracts/verifiers/GuardianVerifier.sol b/packages/protocol/contracts/verifiers/GuardianVerifier.sol index 33bb3b72874..aaa5ea3277c 100644 --- a/packages/protocol/contracts/verifiers/GuardianVerifier.sol +++ b/packages/protocol/contracts/verifiers/GuardianVerifier.sol @@ -1,17 +1,4 @@ // SPDX-License-Identifier: MIT -// _____ _ _ _ _ -// |_ _|_ _(_) |_____ | | __ _| |__ ___ -// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< -// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -// -// Email: security@taiko.xyz -// Website: https://taiko.xyz -// GitHub: https://github.com/taikoxyz -// Discord: https://discord.gg/taikoxyz -// Twitter: https://twitter.com/taikoxyz -// Blog: https://mirror.xyz/labs.taiko.eth -// Youtube: https://www.youtube.com/@taikoxyz - pragma solidity 0.8.24; import "../common/EssentialContract.sol"; diff --git a/packages/protocol/contracts/verifiers/IVerifier.sol b/packages/protocol/contracts/verifiers/IVerifier.sol index 218279b815c..e5656ec61ed 100644 --- a/packages/protocol/contracts/verifiers/IVerifier.sol +++ b/packages/protocol/contracts/verifiers/IVerifier.sol @@ -1,24 +1,11 @@ // SPDX-License-Identifier: MIT -// _____ _ _ _ _ -// |_ _|_ _(_) |_____ | | __ _| |__ ___ -// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< -// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -// -// Email: security@taiko.xyz -// Website: https://taiko.xyz -// GitHub: https://github.com/taikoxyz -// Discord: https://discord.gg/taikoxyz -// Twitter: https://twitter.com/taikoxyz -// Blog: https://mirror.xyz/labs.taiko.eth -// Youtube: https://www.youtube.com/@taikoxyz - pragma solidity 0.8.24; import "../L1/TaikoData.sol"; -/// @title IVerifier Interface -/// @custom:security-contact security@taiko.xyz +/// @title IVerifier /// @notice Defines the function that handles proof verification. +/// @custom:security-contact security@taiko.xyz interface IVerifier { struct Context { bytes32 metaHash; diff --git a/packages/protocol/contracts/verifiers/SgxVerifier.sol b/packages/protocol/contracts/verifiers/SgxVerifier.sol index b4a8670b02c..a4bef5270a4 100644 --- a/packages/protocol/contracts/verifiers/SgxVerifier.sol +++ b/packages/protocol/contracts/verifiers/SgxVerifier.sol @@ -1,17 +1,4 @@ // SPDX-License-Identifier: MIT -// _____ _ _ _ _ -// |_ _|_ _(_) |_____ | | __ _| |__ ___ -// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< -// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -// -// Email: security@taiko.xyz -// Website: https://taiko.xyz -// GitHub: https://github.com/taikoxyz -// Discord: https://discord.gg/taikoxyz -// Twitter: https://twitter.com/taikoxyz -// Blog: https://mirror.xyz/labs.taiko.eth -// Youtube: https://www.youtube.com/@taikoxyz - pragma solidity 0.8.24; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; @@ -23,11 +10,12 @@ import "../automata-attestation/lib/QuoteV3Auth/V3Struct.sol"; import "./IVerifier.sol"; /// @title SgxVerifier +/// @notice This contract is the implementation of verifying SGX signature proofs +/// onchain. +/// @dev Please see references below: +/// - Reference #1: https://ethresear.ch/t/2fa-zk-rollups-using-sgx/14462 +/// - Reference #2: https://github.com/gramineproject/gramine/discussions/1579 /// @custom:security-contact security@taiko.xyz -/// @notice This contract is the implementation of verifying SGX signature -/// proofs on-chain. Please see references below! -/// Reference #1: https://ethresear.ch/t/2fa-zk-rollups-using-sgx/14462 -/// Reference #2: https://github.com/gramineproject/gramine/discussions/1579 contract SgxVerifier is EssentialContract, IVerifier { /// @dev Each public-private key pair (Ethereum address) is generated within /// the SGX program when it boots up. The off-chain remote attestation diff --git a/packages/protocol/foundry.toml b/packages/protocol/foundry.toml index def9be86349..c6ddae12e86 100644 --- a/packages/protocol/foundry.toml +++ b/packages/protocol/foundry.toml @@ -1,6 +1,6 @@ # See more config options https://github.com/foundry-rs/foundry/tree/master/config [profile.default] -solc-version = "0.8.24" +solc_version = "0.8.24" src = "contracts" out = "out" test = "test" diff --git a/packages/protocol/script/AddSGXVerifierInstances.s.sol b/packages/protocol/script/AddSGXVerifierInstances.s.sol index 74f45172181..de8c02d4ad1 100644 --- a/packages/protocol/script/AddSGXVerifierInstances.s.sol +++ b/packages/protocol/script/AddSGXVerifierInstances.s.sol @@ -1,17 +1,4 @@ // SPDX-License-Identifier: MIT -// _____ _ _ _ _ -// |_ _|_ _(_) |_____ | | __ _| |__ ___ -// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< -// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -// -// Email: security@taiko.xyz -// Website: https://taiko.xyz -// GitHub: https://github.com/taikoxyz -// Discord: https://discord.gg/taikoxyz -// Twitter: https://twitter.com/taikoxyz -// Blog: https://mirror.xyz/labs.taiko.eth -// Youtube: https://www.youtube.com/@taikoxyz - pragma solidity 0.8.24; import "../test/DeployCapability.sol"; diff --git a/packages/protocol/script/AuthorizeTaikoForMultihop.s.sol b/packages/protocol/script/AuthorizeTaikoForMultihop.s.sol index 515905a0601..5929e4e0ac3 100644 --- a/packages/protocol/script/AuthorizeTaikoForMultihop.s.sol +++ b/packages/protocol/script/AuthorizeTaikoForMultihop.s.sol @@ -1,17 +1,4 @@ // SPDX-License-Identifier: MIT -// _____ _ _ _ _ -// |_ _|_ _(_) |_____ | | __ _| |__ ___ -// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< -// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -// -// Email: security@taiko.xyz -// Website: https://taiko.xyz -// GitHub: https://github.com/taikoxyz -// Discord: https://discord.gg/taikoxyz -// Twitter: https://twitter.com/taikoxyz -// Blog: https://mirror.xyz/labs.taiko.eth -// Youtube: https://www.youtube.com/@taikoxyz - pragma solidity 0.8.24; import "../test/DeployCapability.sol"; @@ -22,8 +9,8 @@ contract AuthorizeTaikoForMultihop is DeployCapability { uint256 public privateKey = vm.envUint("PRIVATE_KEY"); address public sharedSignalService = vm.envAddress("SHARED_SIGNAL_SERVICE"); address public timelockAddress = vm.envAddress("TIMELOCK_ADDRESS"); - address[] public taikoContracts = vm.envAddress("TAIKO_CONTRACTS", ","); // TaikoL1 and TaikoL2 - // contracts + // TaikoL1 and TaikoL2 contracts + address[] public taikoContracts = vm.envAddress("TAIKO_CONTRACTS", ","); function run() external { require(taikoContracts.length != 0, "invalid taiko contracts"); diff --git a/packages/protocol/script/DeployERC20Airdrop.s.sol b/packages/protocol/script/DeployERC20Airdrop.s.sol index 00b325cec27..8d2eb6b904a 100644 --- a/packages/protocol/script/DeployERC20Airdrop.s.sol +++ b/packages/protocol/script/DeployERC20Airdrop.s.sol @@ -1,17 +1,4 @@ // SPDX-License-Identifier: MIT -// _____ _ _ _ _ -// |_ _|_ _(_) |_____ | | __ _| |__ ___ -// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< -// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -// -// Email: security@taiko.xyz -// Website: https://taiko.xyz -// GitHub: https://github.com/taikoxyz -// Discord: https://discord.gg/taikoxyz -// Twitter: https://twitter.com/taikoxyz -// Blog: https://mirror.xyz/labs.taiko.eth -// Youtube: https://www.youtube.com/@taikoxyz - pragma solidity 0.8.24; import "../test/DeployCapability.sol"; diff --git a/packages/protocol/script/DeployOnL1.s.sol b/packages/protocol/script/DeployOnL1.s.sol index 948e68ee224..b9262307d73 100644 --- a/packages/protocol/script/DeployOnL1.s.sol +++ b/packages/protocol/script/DeployOnL1.s.sol @@ -1,17 +1,4 @@ // SPDX-License-Identifier: MIT -// _____ _ _ _ _ -// |_ _|_ _(_) |_____ | | __ _| |__ ___ -// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< -// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -// -// Email: security@taiko.xyz -// Website: https://taiko.xyz -// GitHub: https://github.com/taikoxyz -// Discord: https://discord.gg/taikoxyz -// Twitter: https://twitter.com/taikoxyz -// Blog: https://mirror.xyz/labs.taiko.eth -// Youtube: https://www.youtube.com/@taikoxyz - pragma solidity 0.8.24; import "@openzeppelin/contracts/utils/Strings.sol"; @@ -39,10 +26,10 @@ import "../test/common/erc20/FreeMintERC20.sol"; import "../test/common/erc20/MayFailFreeMintERC20.sol"; import "../test/DeployCapability.sol"; -// Actually this one is deployed already on mainnets, but we are now deploying our own (non vi-ir) -// version. For mainnet, it is easier to go with either this: -// https://github.com/daimo-eth/p256-verifier or this: -// https://github.com/rdubois-crypto/FreshCryptoLib +// Actually this one is deployed already on mainnet, but we are now deploying our own (non via-ir) +// version. For mainnet, it is easier to go with one of: +// - https://github.com/daimo-eth/p256-verifier +// - https://github.com/rdubois-crypto/FreshCryptoLib import { P256Verifier } from "p256-verifier/src/P256Verifier.sol"; /// @title DeployOnL1 diff --git a/packages/protocol/script/DeployUSDCAdapter.s.sol b/packages/protocol/script/DeployUSDCAdapter.s.sol index 8594fd905a9..6dd53548f35 100644 --- a/packages/protocol/script/DeployUSDCAdapter.s.sol +++ b/packages/protocol/script/DeployUSDCAdapter.s.sol @@ -1,17 +1,4 @@ // SPDX-License-Identifier: MIT -// _____ _ _ _ _ -// |_ _|_ _(_) |_____ | | __ _| |__ ___ -// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< -// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -// -// Email: security@taiko.xyz -// Website: https://taiko.xyz -// GitHub: https://github.com/taikoxyz -// Discord: https://discord.gg/taikoxyz -// Twitter: https://twitter.com/taikoxyz -// Blog: https://mirror.xyz/labs.taiko.eth -// Youtube: https://www.youtube.com/@taikoxyz - pragma solidity 0.8.24; import "../contracts/tokenvault/adapters/USDCAdapter.sol"; diff --git a/packages/protocol/script/SetAddress.s.sol b/packages/protocol/script/SetAddress.s.sol index 31f3b96a9df..a1e18a4796e 100644 --- a/packages/protocol/script/SetAddress.s.sol +++ b/packages/protocol/script/SetAddress.s.sol @@ -1,17 +1,4 @@ // SPDX-License-Identifier: MIT -// _____ _ _ _ _ -// |_ _|_ _(_) |_____ | | __ _| |__ ___ -// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< -// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -// -// Email: security@taiko.xyz -// Website: https://taiko.xyz -// GitHub: https://github.com/taikoxyz -// Discord: https://discord.gg/taikoxyz -// Twitter: https://twitter.com/taikoxyz -// Blog: https://mirror.xyz/labs.taiko.eth -// Youtube: https://www.youtube.com/@taikoxyz - pragma solidity 0.8.24; import "forge-std/src/Script.sol"; diff --git a/packages/protocol/script/SetDcapParams.s.sol b/packages/protocol/script/SetDcapParams.s.sol index 4b6e13ef948..442a9065553 100644 --- a/packages/protocol/script/SetDcapParams.s.sol +++ b/packages/protocol/script/SetDcapParams.s.sol @@ -1,17 +1,4 @@ // SPDX-License-Identifier: MIT -// _____ _ _ _ _ -// |_ _|_ _(_) |_____ | | __ _| |__ ___ -// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< -// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -// -// Email: security@taiko.xyz -// Website: https://taiko.xyz -// GitHub: https://github.com/taikoxyz -// Discord: https://discord.gg/taikoxyz -// Twitter: https://twitter.com/taikoxyz -// Blog: https://mirror.xyz/labs.taiko.eth -// Youtube: https://www.youtube.com/@taikoxyz - pragma solidity 0.8.24; import "forge-std/src/Script.sol"; diff --git a/packages/protocol/script/SetRemoteBridgeSuites.s.sol b/packages/protocol/script/SetRemoteBridgeSuites.s.sol index 8bb18397cc8..ff19ac02b58 100644 --- a/packages/protocol/script/SetRemoteBridgeSuites.s.sol +++ b/packages/protocol/script/SetRemoteBridgeSuites.s.sol @@ -1,17 +1,4 @@ // SPDX-License-Identifier: MIT -// _____ _ _ _ _ -// |_ _|_ _(_) |_____ | | __ _| |__ ___ -// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< -// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -// -// Email: security@taiko.xyz -// Website: https://taiko.xyz -// GitHub: https://github.com/taikoxyz -// Discord: https://discord.gg/taikoxyz -// Twitter: https://twitter.com/taikoxyz -// Blog: https://mirror.xyz/labs.taiko.eth -// Youtube: https://www.youtube.com/@taikoxyz - pragma solidity 0.8.24; import "../test/DeployCapability.sol"; diff --git a/packages/protocol/script/upgrade/UpgradeAddressManager.s.sol b/packages/protocol/script/upgrade/UpgradeAddressManager.s.sol index ff795128b2d..829ff2590ef 100644 --- a/packages/protocol/script/upgrade/UpgradeAddressManager.s.sol +++ b/packages/protocol/script/upgrade/UpgradeAddressManager.s.sol @@ -1,18 +1,5 @@ // SPDX-License-Identifier: MIT -// _____ _ _ _ _ -// |_ _|_ _(_) |_____ | | __ _| |__ ___ -// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< -// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -// -// Email: security@taiko.xyz -// Website: https://taiko.xyz -// GitHub: https://github.com/taikoxyz -// Discord: https://discord.gg/taikoxyz -// Twitter: https://twitter.com/taikoxyz -// Blog: https://mirror.xyz/labs.taiko.eth -// Youtube: https://www.youtube.com/@taikoxyz - -pragma solidity ^0.8.24; +pragma solidity 0.8.24; import "forge-std/src/Script.sol"; import "forge-std/src/console2.sol"; diff --git a/packages/protocol/script/upgrade/UpgradeAssignmentHook.s.sol b/packages/protocol/script/upgrade/UpgradeAssignmentHook.s.sol index fcf11015edc..f48779bf9b5 100644 --- a/packages/protocol/script/upgrade/UpgradeAssignmentHook.s.sol +++ b/packages/protocol/script/upgrade/UpgradeAssignmentHook.s.sol @@ -1,18 +1,5 @@ // SPDX-License-Identifier: MIT -// _____ _ _ _ _ -// |_ _|_ _(_) |_____ | | __ _| |__ ___ -// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< -// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -// -// Email: security@taiko.xyz -// Website: https://taiko.xyz -// GitHub: https://github.com/taikoxyz -// Discord: https://discord.gg/taikoxyz -// Twitter: https://twitter.com/taikoxyz -// Blog: https://mirror.xyz/labs.taiko.eth -// Youtube: https://www.youtube.com/@taikoxyz - -pragma solidity ^0.8.24; +pragma solidity 0.8.24; import "forge-std/src/Script.sol"; import "forge-std/src/console2.sol"; diff --git a/packages/protocol/script/upgrade/UpgradeBridge.s.sol b/packages/protocol/script/upgrade/UpgradeBridge.s.sol index 978b706bafb..9c1ac14e6ee 100644 --- a/packages/protocol/script/upgrade/UpgradeBridge.s.sol +++ b/packages/protocol/script/upgrade/UpgradeBridge.s.sol @@ -1,18 +1,5 @@ // SPDX-License-Identifier: MIT -// _____ _ _ _ _ -// |_ _|_ _(_) |_____ | | __ _| |__ ___ -// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< -// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -// -// Email: security@taiko.xyz -// Website: https://taiko.xyz -// GitHub: https://github.com/taikoxyz -// Discord: https://discord.gg/taikoxyz -// Twitter: https://twitter.com/taikoxyz -// Blog: https://mirror.xyz/labs.taiko.eth -// Youtube: https://www.youtube.com/@taikoxyz - -pragma solidity ^0.8.24; +pragma solidity 0.8.24; import "forge-std/src/Script.sol"; import "forge-std/src/console2.sol"; diff --git a/packages/protocol/script/upgrade/UpgradeERC1155Vault.s.sol b/packages/protocol/script/upgrade/UpgradeERC1155Vault.s.sol index 6a6b4f9a952..c819962080f 100644 --- a/packages/protocol/script/upgrade/UpgradeERC1155Vault.s.sol +++ b/packages/protocol/script/upgrade/UpgradeERC1155Vault.s.sol @@ -1,18 +1,5 @@ // SPDX-License-Identifier: MIT -// _____ _ _ _ _ -// |_ _|_ _(_) |_____ | | __ _| |__ ___ -// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< -// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -// -// Email: security@taiko.xyz -// Website: https://taiko.xyz -// GitHub: https://github.com/taikoxyz -// Discord: https://discord.gg/taikoxyz -// Twitter: https://twitter.com/taikoxyz -// Blog: https://mirror.xyz/labs.taiko.eth -// Youtube: https://www.youtube.com/@taikoxyz - -pragma solidity ^0.8.24; +pragma solidity 0.8.24; import "forge-std/src/Script.sol"; import "forge-std/src/console2.sol"; diff --git a/packages/protocol/script/upgrade/UpgradeERC20Vault.s.sol b/packages/protocol/script/upgrade/UpgradeERC20Vault.s.sol index da11b43c180..f4672413587 100644 --- a/packages/protocol/script/upgrade/UpgradeERC20Vault.s.sol +++ b/packages/protocol/script/upgrade/UpgradeERC20Vault.s.sol @@ -1,18 +1,5 @@ // SPDX-License-Identifier: MIT -// _____ _ _ _ _ -// |_ _|_ _(_) |_____ | | __ _| |__ ___ -// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< -// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -// -// Email: security@taiko.xyz -// Website: https://taiko.xyz -// GitHub: https://github.com/taikoxyz -// Discord: https://discord.gg/taikoxyz -// Twitter: https://twitter.com/taikoxyz -// Blog: https://mirror.xyz/labs.taiko.eth -// Youtube: https://www.youtube.com/@taikoxyz - -pragma solidity ^0.8.24; +pragma solidity 0.8.24; import "forge-std/src/Script.sol"; import "forge-std/src/console2.sol"; diff --git a/packages/protocol/script/upgrade/UpgradeERC721Vault.s.sol b/packages/protocol/script/upgrade/UpgradeERC721Vault.s.sol index 62889fef728..406773cec6c 100644 --- a/packages/protocol/script/upgrade/UpgradeERC721Vault.s.sol +++ b/packages/protocol/script/upgrade/UpgradeERC721Vault.s.sol @@ -1,18 +1,5 @@ // SPDX-License-Identifier: MIT -// _____ _ _ _ _ -// |_ _|_ _(_) |_____ | | __ _| |__ ___ -// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< -// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -// -// Email: security@taiko.xyz -// Website: https://taiko.xyz -// GitHub: https://github.com/taikoxyz -// Discord: https://discord.gg/taikoxyz -// Twitter: https://twitter.com/taikoxyz -// Blog: https://mirror.xyz/labs.taiko.eth -// Youtube: https://www.youtube.com/@taikoxyz - -pragma solidity ^0.8.24; +pragma solidity 0.8.24; import "forge-std/src/Script.sol"; import "forge-std/src/console2.sol"; diff --git a/packages/protocol/script/upgrade/UpgradeGuardianProver.s.sol b/packages/protocol/script/upgrade/UpgradeGuardianProver.s.sol index 448b9e0bbd8..cce9a7136bb 100644 --- a/packages/protocol/script/upgrade/UpgradeGuardianProver.s.sol +++ b/packages/protocol/script/upgrade/UpgradeGuardianProver.s.sol @@ -1,18 +1,5 @@ // SPDX-License-Identifier: MIT -// _____ _ _ _ _ -// |_ _|_ _(_) |_____ | | __ _| |__ ___ -// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< -// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -// -// Email: security@taiko.xyz -// Website: https://taiko.xyz -// GitHub: https://github.com/taikoxyz -// Discord: https://discord.gg/taikoxyz -// Twitter: https://twitter.com/taikoxyz -// Blog: https://mirror.xyz/labs.taiko.eth -// Youtube: https://www.youtube.com/@taikoxyz - -pragma solidity ^0.8.24; +pragma solidity 0.8.24; import "forge-std/src/Script.sol"; import "forge-std/src/console2.sol"; diff --git a/packages/protocol/script/upgrade/UpgradeScript.s.sol b/packages/protocol/script/upgrade/UpgradeScript.s.sol index 3e116ede7a1..fa6d833290e 100644 --- a/packages/protocol/script/upgrade/UpgradeScript.s.sol +++ b/packages/protocol/script/upgrade/UpgradeScript.s.sol @@ -1,17 +1,4 @@ // SPDX-License-Identifier: MIT -// _____ _ _ _ _ -// |_ _|_ _(_) |_____ | | __ _| |__ ___ -// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< -// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -// -// Email: security@taiko.xyz -// Website: https://taiko.xyz -// GitHub: https://github.com/taikoxyz -// Discord: https://discord.gg/taikoxyz -// Twitter: https://twitter.com/taikoxyz -// Blog: https://mirror.xyz/labs.taiko.eth -// Youtube: https://www.youtube.com/@taikoxyz - pragma solidity 0.8.24; import "../../contracts/L1/gov/TaikoTimelockController.sol"; diff --git a/packages/protocol/script/upgrade/UpgradeSignalService.s.sol b/packages/protocol/script/upgrade/UpgradeSignalService.s.sol index 2461b94e064..0f5271865a3 100644 --- a/packages/protocol/script/upgrade/UpgradeSignalService.s.sol +++ b/packages/protocol/script/upgrade/UpgradeSignalService.s.sol @@ -1,18 +1,5 @@ // SPDX-License-Identifier: MIT -// _____ _ _ _ _ -// |_ _|_ _(_) |_____ | | __ _| |__ ___ -// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< -// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -// -// Email: security@taiko.xyz -// Website: https://taiko.xyz -// GitHub: https://github.com/taikoxyz -// Discord: https://discord.gg/taikoxyz -// Twitter: https://twitter.com/taikoxyz -// Blog: https://mirror.xyz/labs.taiko.eth -// Youtube: https://www.youtube.com/@taikoxyz - -pragma solidity ^0.8.24; +pragma solidity 0.8.24; import "forge-std/src/Script.sol"; import "forge-std/src/console2.sol"; diff --git a/packages/protocol/script/upgrade/UpgradeTaikoGovernor.s.sol b/packages/protocol/script/upgrade/UpgradeTaikoGovernor.s.sol index 87bb815ddb4..18cf211336e 100644 --- a/packages/protocol/script/upgrade/UpgradeTaikoGovernor.s.sol +++ b/packages/protocol/script/upgrade/UpgradeTaikoGovernor.s.sol @@ -1,18 +1,5 @@ // SPDX-License-Identifier: MIT -// _____ _ _ _ _ -// |_ _|_ _(_) |_____ | | __ _| |__ ___ -// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< -// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -// -// Email: security@taiko.xyz -// Website: https://taiko.xyz -// GitHub: https://github.com/taikoxyz -// Discord: https://discord.gg/taikoxyz -// Twitter: https://twitter.com/taikoxyz -// Blog: https://mirror.xyz/labs.taiko.eth -// Youtube: https://www.youtube.com/@taikoxyz - -pragma solidity ^0.8.24; +pragma solidity 0.8.24; import "forge-std/src/Script.sol"; import "forge-std/src/console2.sol"; diff --git a/packages/protocol/script/upgrade/UpgradeTaikoL1.s.sol b/packages/protocol/script/upgrade/UpgradeTaikoL1.s.sol index 44fcad7b5d5..b142466aca1 100644 --- a/packages/protocol/script/upgrade/UpgradeTaikoL1.s.sol +++ b/packages/protocol/script/upgrade/UpgradeTaikoL1.s.sol @@ -1,18 +1,5 @@ // SPDX-License-Identifier: MIT -// _____ _ _ _ _ -// |_ _|_ _(_) |_____ | | __ _| |__ ___ -// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< -// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -// -// Email: security@taiko.xyz -// Website: https://taiko.xyz -// GitHub: https://github.com/taikoxyz -// Discord: https://discord.gg/taikoxyz -// Twitter: https://twitter.com/taikoxyz -// Blog: https://mirror.xyz/labs.taiko.eth -// Youtube: https://www.youtube.com/@taikoxyz - -pragma solidity ^0.8.24; +pragma solidity 0.8.24; import "forge-std/src/Script.sol"; import "forge-std/src/console2.sol"; diff --git a/packages/protocol/script/upgrade/UpgradeTierProvider.s.sol b/packages/protocol/script/upgrade/UpgradeTierProvider.s.sol index 9747341d651..f8429206b4a 100644 --- a/packages/protocol/script/upgrade/UpgradeTierProvider.s.sol +++ b/packages/protocol/script/upgrade/UpgradeTierProvider.s.sol @@ -1,17 +1,4 @@ // SPDX-License-Identifier: MIT -// _____ _ _ _ _ -// |_ _|_ _(_) |_____ | | __ _| |__ ___ -// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< -// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -// -// Email: security@taiko.xyz -// Website: https://taiko.xyz -// GitHub: https://github.com/taikoxyz -// Discord: https://discord.gg/taikoxyz -// Twitter: https://twitter.com/taikoxyz -// Blog: https://mirror.xyz/labs.taiko.eth -// Youtube: https://www.youtube.com/@taikoxyz - pragma solidity 0.8.24; import "../../test/DeployCapability.sol"; diff --git a/packages/protocol/script/upgrade/UpgradeTimelockController.s.sol b/packages/protocol/script/upgrade/UpgradeTimelockController.s.sol index 3b8c3d34ad1..2dc1430f806 100644 --- a/packages/protocol/script/upgrade/UpgradeTimelockController.s.sol +++ b/packages/protocol/script/upgrade/UpgradeTimelockController.s.sol @@ -1,18 +1,5 @@ // SPDX-License-Identifier: MIT -// _____ _ _ _ _ -// |_ _|_ _(_) |_____ | | __ _| |__ ___ -// | |/ _` | | / / _ \ | |__/ _` | '_ (_-< -// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/ -// -// Email: security@taiko.xyz -// Website: https://taiko.xyz -// GitHub: https://github.com/taikoxyz -// Discord: https://discord.gg/taikoxyz -// Twitter: https://twitter.com/taikoxyz -// Blog: https://mirror.xyz/labs.taiko.eth -// Youtube: https://www.youtube.com/@taikoxyz - -pragma solidity ^0.8.24; +pragma solidity 0.8.24; import "forge-std/src/Script.sol"; import "forge-std/src/console2.sol";