Skip to content

Add optional system entry point #693

@ethanfrey

Description

@ethanfrey

This would look something like migrate or ibc (See #692), but be a extensible placeholder for any other privledged system callbacks a chain wants to add later. As you start allowing native code to call into contracts, we need some other interface than handle, which assumes an untrusted, external caller. The same way there is a Router and a GovRouter in the sdk - the second one exposes powerful message handlers that can only be reached by trusted code.

I am unsure of a concrete use case of this, but given we just added specific entry points in #691 and #692 I am sure there will be chain-specific extensions coming later, like with CosmosMsg and QueryRequest, so this would be a good extension point to include for 1.0.

It would look something like:

pub fn system(
    deps: DepsMut,
    env: Env,
    msg: SystemMsg,
) -> Result<SystemResponse, ContractError> {
 // ...
}

// or a custom type, but same format
type SystemResponse = HandleResponse;

The content of SystemMsg is an agreement between the contract and the chain it runs on, and is only interpreted in wasmd or a cosmos sdk app that imports wasmd.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions