From 1a2407a72814ee62a689af8a7c67e99eeaf7310a Mon Sep 17 00:00:00 2001 From: yushihang Date: Sun, 12 Jan 2025 09:51:16 +0800 Subject: [PATCH] add zero address checking --- contracts/cross-chain/CrossChainProofValidator.sol | 2 ++ 1 file changed, 2 insertions(+) diff --git a/contracts/cross-chain/CrossChainProofValidator.sol b/contracts/cross-chain/CrossChainProofValidator.sol index 09f271f2..5e0829e5 100644 --- a/contracts/cross-chain/CrossChainProofValidator.sol +++ b/contracts/cross-chain/CrossChainProofValidator.sol @@ -40,6 +40,7 @@ contract CrossChainProofValidator is Ownable, EIP712, ICrossChainProofValidator string memory signatureVersion, address oracleSigningAddress ) EIP712(domainName, signatureVersion) Ownable(msg.sender) { + require(oracleSigningAddress != address(0), "Oracle signing address should not be zero"); bytes32 hashedName = keccak256(bytes(domainName)); bytes32 hashedVersion = keccak256(bytes(signatureVersion)); uint256 chainId = 0; @@ -63,6 +64,7 @@ contract CrossChainProofValidator is Ownable, EIP712, ICrossChainProofValidator * @param oracleSigningAddress The new oracle signing address **/ function setOracleSigningAddress(address oracleSigningAddress) public onlyOwner { + require(oracleSigningAddress != address(0), "Oracle signing address should not be zero"); _oracleSigningAddress = oracleSigningAddress; }