i run into bellow code when browsing some erc721 contract:
interface OwnableDelegateProxy {}
contract ProxyRegistry {
mapping(address => OwnableDelegateProxy) public proxies;
}
and it's caller context:
function isProxy(address _address, address _operator)
public
view
returns (bool)
{
if (address(proxyRegistry).isContract()) {
try proxyRegistry.proxies(_address) returns (
OwnableDelegateProxy _proxy
) {
return address(_proxy) == _operator;
} catch {}
}
return false;
}
i can't quite understand the above code.
What if we replace OwnableDelegateProxy type with address type?