Closed
Description
What is the bug?
In the setStorageRegistry function, the contract updates the storageRegistry address without performing a validity check (i.e., whether the _storageRegistry address is a valid contract implementing the IStorageRegistry interface). If a non-contract address or a contract with a different interface is passed, this could lead to undefined behavior or loss of functionality.
fix: Add a check to ensure _storageRegistry is a valid contract that supports the IStorageRegistry interface using this.
require(Address.isContract(_storageRegistry), "Not a valid contract");
Nb: Adding this check improves contract robustness and prevents the contract from breaking due to incorrect registry addresses.