-
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): improve MainnetSgxVerifier (#17811)
- Loading branch information
Showing
5 changed files
with
37 additions
and
5 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
packages/protocol/contracts/mainnet/MainnetRiscZeroVerifier.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,21 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity 0.8.24; | ||
|
||
import "../verifiers/RiscZeroVerifier.sol"; | ||
import "./LibRollupAddressCache.sol"; | ||
|
||
/// @title MainnetRiscZeroVerifier | ||
/// @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 {RiscZeroVerifier}. | ||
/// @custom:security-contact security@taiko.xyz | ||
contract MainnetRiscZeroVerifier is RiscZeroVerifier { | ||
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); | ||
} | ||
|
||
function taikoChainId() internal pure override returns (uint64) { | ||
return LibNetwork.TAIKO_MAINNET; | ||
} | ||
} |
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
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
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
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