Omniscia Nevermined Audit
AccessCondition Code Style Findings
AccessCondition Code Style Findings
ACN-01C: Usage of Proper APIs
Type | Severity | Location |
---|---|---|
Code Style | Informational | AccessCondition.sol:L58, L207 |
Description:
The DIDRegistry
contract exposes the isDIDOwner
function which should be favored over a manual retrieval of the DID owner and equality validation.
Example:
contracts/conditions/AccessCondition.sol
48modifier onlyDIDOwnerOrProvider(49 bytes32 _documentId50)51{52 DIDRegistry didRegistry = DIDRegistry(53 agreementStoreManager.getDIDRegistryAddress()54 );55 56 require(57 didRegistry.isDIDProvider(_documentId, msg.sender) || 58 msg.sender == didRegistry.getDIDOwner(_documentId),59 'Invalid DID owner/provider'60 );61 _;62}
Recommendation:
We advise the linked conditionals to be replaced by the specified invocation.
Alleviation:
The check was correctly replaced by a isDIDOwner
invocation.