-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(protocol): add MainnetSgxVerifier (#17803)
- Loading branch information
Showing
3 changed files
with
28 additions
and
5 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
packages/protocol/contracts/mainnet/MainnetSgxVerifier.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity 0.8.24; | ||
|
||
import "../verifiers/SgxVerifier.sol"; | ||
import "./LibRollupAddressCache.sol"; | ||
|
||
/// @title MainnetSgxVerifier | ||
/// @dev This contract shall be deployed to replace its parent contract on Ethereum for Taiko | ||
/// mainnet to reduce gas cost. | ||
/// @notice See the documentation in {SgxVerifier}. | ||
/// @custom:security-contact [email protected] | ||
contract MainnetSgxVerifier is SgxVerifier { | ||
function _getAddress(uint64 _chainId, bytes32 _name) internal view override returns (address) { | ||
(bool found, address addr) = LibRollupAddressCache.getAddress(_chainId, _name); | ||
return found ? addr : super._getAddress(_chainId, _name); | ||
} | ||
} |
8 changes: 4 additions & 4 deletions
8
...rotocol/contracts/L1/tiers/TierRouter.sol → ...l/contracts/mainnet/MainnetTierRouter.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity 0.8.24; | ||
|
||
import "./ITierRouter.sol"; | ||
import "../L1/tiers/ITierRouter.sol"; | ||
|
||
/// @title TierRouter | ||
/// @title MainnetTierRouter | ||
/// @dev Labeled in AddressResolver as "tier_router" | ||
/// @custom:security-contact [email protected] | ||
contract TierRouter is ITierRouter { | ||
contract MainnetTierRouter is ITierRouter { | ||
/// @inheritdoc ITierRouter | ||
function getProvider(uint256 /*_blockId*/ ) external pure returns (address) { | ||
return 0x4cffe56C947E26D07C14020499776DB3e9AE3a23; | ||
return 0x4cffe56C947E26D07C14020499776DB3e9AE3a23; // TierProviderV2 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters