From d559ce80c1314e9ddbe02798f1c61a2e8349da6e Mon Sep 17 00:00:00 2001 From: Daniel Wang <99078276+dantaik@users.noreply.github.com> Date: Thu, 15 Aug 2024 14:24:20 +0800 Subject: [PATCH] fix(protocol): make sure new instance is not zero address in SgxVerifier (#17918) --- packages/protocol/contracts/verifiers/SgxVerifier.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/protocol/contracts/verifiers/SgxVerifier.sol b/packages/protocol/contracts/verifiers/SgxVerifier.sol index 3acba8ef0f6..b1971182022 100644 --- a/packages/protocol/contracts/verifiers/SgxVerifier.sol +++ b/packages/protocol/contracts/verifiers/SgxVerifier.sol @@ -170,7 +170,7 @@ contract SgxVerifier is EssentialContract, IVerifier { if (!_isInstanceValid(id, oldInstance)) revert SGX_INVALID_INSTANCE(); - if (oldInstance != newInstance) { + if (newInstance != oldInstance && newInstance != address(0)) { _replaceInstance(id, oldInstance, newInstance); } }