-
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.
fix(protocol): fix guardian prover (#16606)
- Loading branch information
Showing
5 changed files
with
31 additions
and
15 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,14 +2,16 @@ | |
pragma solidity 0.8.24; | ||
|
||
import "../common/EssentialContract.sol"; | ||
import "../L1/tiers/ITierProvider.sol"; | ||
import "./IVerifier.sol"; | ||
|
||
/// @title GuardianVerifier | ||
/// @custom:security-contact [email protected] | ||
contract GuardianVerifier is EssentialContract, IVerifier { | ||
uint256[50] private __gap; | ||
|
||
error PERMISSION_DENIED(); | ||
error GV_INVALID_PROOF(); | ||
error GV_PERMISSION_DENIED(); | ||
|
||
/// @notice Initializes the contract. | ||
/// @param _owner The owner of this contract. msg.sender will be used if this value is zero. | ||
|
@@ -22,13 +24,17 @@ contract GuardianVerifier is EssentialContract, IVerifier { | |
function verifyProof( | ||
Context calldata _ctx, | ||
TaikoData.Transition calldata, | ||
TaikoData.TierProof calldata | ||
TaikoData.TierProof calldata _proof | ||
) | ||
external | ||
view | ||
{ | ||
if (_proof.tier != LibTiers.TIER_GUARDIAN) { | ||
revert GV_INVALID_PROOF(); | ||
} | ||
|
||
if (_ctx.msgSender != resolve("guardian_prover", false)) { | ||
revert PERMISSION_DENIED(); | ||
revert GV_PERMISSION_DENIED(); | ||
} | ||
} | ||
} |
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