-
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.
chore(protocol): change two vars to immutable & use SignatureChecker (#…
- Loading branch information
Showing
5 changed files
with
5 additions
and
42 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ pragma solidity 0.8.24; | |
|
||
import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; | ||
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; | ||
import "@openzeppelin/contracts/utils/cryptography/SignatureChecker.sol"; | ||
import "../../common/EssentialContract.sol"; | ||
import "../../libs/LibAddress.sol"; | ||
import "../ITaikoL1.sol"; | ||
|
@@ -13,6 +14,7 @@ import "./IHook.sol"; | |
/// @custom:security-contact [email protected] | ||
contract AssignmentHook is EssentialContract, IHook { | ||
using LibAddress for address; | ||
using SignatureChecker for address; | ||
using SafeERC20 for IERC20; | ||
|
||
struct ProverAssignment { | ||
|
@@ -95,7 +97,7 @@ contract AssignmentHook is EssentialContract, IHook { | |
address taikoL1Address = msg.sender; | ||
bytes32 hash = hashAssignment(assignment, taikoL1Address, _meta.blobHash); | ||
|
||
if (!_blk.assignedProver.isValidSignature(hash, assignment.signature)) { | ||
if (!_blk.assignedProver.isValidSignatureNow(hash, assignment.signature)) { | ||
revert HOOK_ASSIGNMENT_INVALID_SIG(); | ||
} | ||
|
||
|
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