Skip to content

Add Preimages precompile #10156

@LucasGrasso

Description

@LucasGrasso

Is there an existing issue?

  • I have searched the existing issues

Experiencing problems? Have you tried our Stack Exchange first?

  • This is not a support question.

Motivation

In views of the development of the Governance Precompile, a Preimages precompile might turn out to be useful in order to keep the whole flow of submitting referenda on the smart-contract side.

Request

Development of a pallet_preimage precompile

Solution

Develop a preimage-precompiles crate that implements a precompile for the following interface (or something similar):

interface Preimage {
    /// @dev Register a preimage on-chain.
    /// @param preImage The preimage to be registered on-chain
    /// @return hash The hash of the preimage
    function notePreimage(bytes memory preImage)
        external
        returns (bytes32 hash);

    /// @dev Clear an unrequested preimage from storage.
    /// @param hash The preimage to be cleared from storage
    function unnotePreimage(bytes32 hash) external;
}

Are you willing to help with this request?

Yes!

Metadata

Metadata

Labels

I5-enhancementAn additional feature request.T7-smart_contractsThis PR/Issue is related to smart contracts.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions