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

contracts: Make Origin information available #13644

Description

@athei

As of right now a contract needs to implement a government model for privileged operations. Examples of such operations would be upgrading the code of a contract or self destruction.

It would be nice if a contract could tap into a chains government system when they align. In order to do so we would expose an API to contracts that allows checking if it was called by a special origin instead of an AccoundID.

We would probably mirror the tracks used in referendas (root, whitelisted, spender). This allows contracts to implement something like ensure_root()?.

Was brought up here: https://substrate.stackexchange.com/questions/7608/ensure-root-in-ink

If we should support only root specifically or go with a more generalized API is still an open question. More research needed.

Metadata

Metadata

Assignees

Labels

J0-enhancementAn additional feature request.Z2-mediumCan be fixed by a coder with good Rust knowledge but little knowledge of the codebase.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions