Omniscia Nevermined Audit

NFTAccessCondition Code Style Findings

NFTAccessCondition Code Style Findings

NFA-01C: Usage of Proper APIs

TypeSeverityLocation
Code StyleInformationalNFTAccessCondition.sol:L45, L173

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/NFTs/NFTAccessCondition.sol
164function checkPermissions(
165 address _grantee,
166 bytes32 _documentId
167)
168 external view
169 returns(bool permissionGranted)
170{
171 return (
172 didRegistry.isDIDProvider(_documentId, _grantee) ||
173 _grantee == didRegistry.getDIDOwner(_documentId) ||
174 nftPermissions[_documentId].permission[_grantee]
175 );
176}

Recommendation:

We advise the linked conditionals to be replaced by the specified invocation.

Alleviation:

The check was correctly replaced by a isDIDOwner invocation.