did:cow, a proposal for an ID resolution method with most of the convenience of did:plc/did:web and the robustness of a public blockchain
3
fork

Configure Feed

Select the types of activity you want to include in your feed.

resolveCow return empty string for deactivated dids

+5 -2
+1 -1
cli/cow.py
··· 185 185 initial_wrapped, 186 186 ).call() 187 187 188 - if wrapped_did == "did::": 188 + if wrapped_did == "": 189 189 click.echo("status: deactivated") 190 190 return 191 191
+4 -1
src/CowRegistry.sol
··· 98 98 /// @dev Returns the initial values if the cow has never been registered on-chain. 99 99 /// @param _controller The initial controller address from the did:cow identifier. 100 100 /// @param _wrappedDID The initial wrapped DID from the did:cow identifier, without "did:". 101 - /// @return wrappedDID The current full wrapped DID (with "did:" prepended), or "did::" if deactivated. 101 + /// @return wrappedDID The current full wrapped DID (with "did:" prepended), or empty string if deactivated. 102 102 /// @return controller The current controller address. 103 103 function resolveCow(address _controller, string memory _wrappedDID) external view returns (string memory wrappedDID, address controller) { 104 104 bytes32 cowHash = calculateCowHash(_controller, _wrappedDID); 105 105 Cow storage cow = cows[cowHash]; 106 106 if (bytes(cow.wrappedDID).length == 0) { 107 107 return (string.concat("did:", _wrappedDID), _controller); 108 + } 109 + if (keccak256(bytes(cow.wrappedDID)) == keccak256(bytes(DEACTIVATED))) { 110 + return ("", address(0)); 108 111 } 109 112 return (string.concat("did:", cow.wrappedDID), cow.controller); 110 113 }