Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Usage of Proper APIs #80

Closed
aaitor opened this issue May 11, 2021 · 0 comments
Closed

Usage of Proper APIs #80

aaitor opened this issue May 11, 2021 · 0 comments

Comments

@aaitor
Copy link
Member

aaitor commented May 11, 2021

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:

modifier onlyDIDOwnerOrProvider(
    bytes32 _documentId
)
{
    DIDRegistry didRegistry = DIDRegistry(
        agreementStoreManager.getDIDRegistryAddress()
    );
    
    require(
        didRegistry.isDIDProvider(_documentId, msg.sender) || 
        msg.sender == didRegistry.getDIDOwner(_documentId),
        'Invalid DID owner/provider'
    );
    _;
}

Recommendation:

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant