Ingress.setContractAddress() can cause duplicate entries in contractKeys
`setContractAddress()` checks `ContractDetails` existence by inspecting `contractAddress`. A `contractAddress` of `0` means that the contract does not already exist, and its name must be added to contractKeys:\\n```\\nfunction setContractAddress(bytes32 name, address addr) public returns (bool) {\\n    require(name > 0x0000000000000000000000000000000000000000000000000000000000000000, "Contract name must not be empty.");\\n    require(isAuthorized(msg.sender), "Not authorized to update contract registry.");\\n\\n    ContractDetails memory info = registry[name];\\n    // create info if it doesn't exist in the registry\\n    if (info.contractAddress == address(0)) {\\n        info = ContractDetails({\\n            owner: msg.sender,\\n            contractAddress: addr\\n        });\\n\\n        // Update registry indexing\\n        contractKeys.push(name);\\n   } else {\\n        info.contractAddress = addr;\\n   }\\n    // update record in the registry\\n    registry[name] = info;\\n\\n    emit RegistryUpdated(addr,name);\\n\\n    return true;\\n}\\n```\\n\\nIf, however, a contract is actually added with the address `0`, which is currently allowed in the code, then the contract does already exists, and adding the name to `contractKeys` again will result in a duplicate.\\nMitigation\\nAn admin can call `removeContract` repeatedly with the same name to remove multiple duplicate entries.
Resolution\\nThis is fixed in PegaSysEng/[email protected]faff726.\\nEither disallow a contract address of `0` or check for existence via the `owner` field instead (which can never be 0).
```\\nfunction setContractAddress(bytes32 name, address addr) public returns (bool) {\\n    require(name > 0x0000000000000000000000000000000000000000000000000000000000000000, "Contract name must not be empty.");\\n    require(isAuthorized(msg.sender), "Not authorized to update contract registry.");\\n\\n    ContractDetails memory info = registry[name];\\n    // create info if it doesn't exist in the registry\\n    if (info.contractAddress == address(0)) {\\n        info = ContractDetails({\\n            owner: msg.sender,\\n            contractAddress: addr\\n        });\\n\\n        // Update registry indexing\\n        contractKeys.push(name);\\n   } else {\\n        info.contractAddress = addr;\\n   }\\n    // update record in the registry\\n    registry[name] = info;\\n\\n    emit RegistryUpdated(addr,name);\\n\\n    return true;\\n}\\n```\\n