Skip to content
This repository was archived by the owner on May 18, 2023. It is now read-only.
This repository was archived by the owner on May 18, 2023. It is now read-only.

verify function visibility should be public to enable inheritance #24

@Turupawn

Description

@Turupawn

Hello, I'm writing educational content about Noir in spanish and @critesjosh has been guiding me on the process. I stumbled into following issue while writing a guide on how to create a dApp. I got redirected here from acvm-backend-barretenberg.

I did a PR #23 that solves this. Happy to hear your comments.

The problem

It should be common for devs to inherit from UltraVerifier while creating a dApp. This is to keep the codebase organized and readable. A normal implementation should look like the following example:

//SPDX-License-Identifier: MIT
pragma solidity >=0.8.19;

contract MyDApp is UltraVerifier {
    // Custom logic
    function proveStuff(bytes calldata _proof, bytes32[] calldata _publicInputs) public {
        verify(_proof, _publicInputs));
        // More custom logic
    }
}

However this is currently not possible due to the verify function being external. This means that this function is not visible to inherited contracts.

The solution

I think the verify visibility should be changed to public. This will enable verify being called from inherited contracts like the example above.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions