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.

check for empty wrapped did on initialize

+7
+1
src/CowRegistry.sol
··· 122 122 /// @param _controller The initial controller address. 123 123 /// @param _wrappedDID The initial wrapped DID, without the leading "did:" prefix. 124 124 function initializeCow(address _controller, string memory _wrappedDID) external { 125 + if (bytes(_wrappedDID).length == 0) revert EmptyWrappedDID(); 125 126 _ensureCowInitialized(_controller, _wrappedDID); 126 127 } 127 128
+6
test/CowRegistry.t.sol
··· 364 364 vm.expectRevert(CowRegistry.NotInitialized.selector); 365 365 registry.deactivateByHash(cowHash); 366 366 } 367 + 368 + function test_initialize_rejectsEmptyWrappedDID() public { 369 + vm.prank(controller1); 370 + vm.expectRevert(CowRegistry.EmptyWrappedDID.selector); 371 + registry.initializeCow(controller1, ""); 372 + } 367 373 }