@@ -13,6 +13,8 @@ import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
13
13
contract CrossChainProofValidator is Ownable , EIP712 , ICrossChainProofValidator {
14
14
using ECDSA for bytes32 ;
15
15
16
+ error OracleSigningAddressShouldNotBeZero ();
17
+
16
18
bytes32 public constant TYPE_HASH =
17
19
keccak256 (
18
20
"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract) "
@@ -35,12 +37,18 @@ contract CrossChainProofValidator is Ownable, EIP712, ICrossChainProofValidator
35
37
36
38
address private _oracleSigningAddress;
37
39
40
+ function _checkOracleSigningAddress (address oracleSigningAddress ) internal pure {
41
+ if (oracleSigningAddress == address (0 )) {
42
+ revert OracleSigningAddressShouldNotBeZero ();
43
+ }
44
+ }
45
+
38
46
constructor (
39
47
string memory domainName ,
40
48
string memory signatureVersion ,
41
49
address oracleSigningAddress
42
50
) EIP712 (domainName, signatureVersion) Ownable (msg .sender ) {
43
- require (oracleSigningAddress != address ( 0 ), " Oracle signing address should not be zero " );
51
+ _checkOracleSigningAddress (oracleSigningAddress);
44
52
bytes32 hashedName = keccak256 (bytes (domainName));
45
53
bytes32 hashedVersion = keccak256 (bytes (signatureVersion));
46
54
uint256 chainId = 0 ;
@@ -64,7 +72,7 @@ contract CrossChainProofValidator is Ownable, EIP712, ICrossChainProofValidator
64
72
* @param oracleSigningAddress The new oracle signing address
65
73
**/
66
74
function setOracleSigningAddress (address oracleSigningAddress ) public onlyOwner {
67
- require (oracleSigningAddress != address ( 0 ), " Oracle signing address should not be zero " );
75
+ _checkOracleSigningAddress (oracleSigningAddress);
68
76
_oracleSigningAddress = oracleSigningAddress;
69
77
}
70
78
0 commit comments