Skip to content

Conversation

@92GC
Copy link

@92GC 92GC commented Jan 5, 2026

Summary

Add native functions to sui::package for querying package metadata:

public native fun current_package_id(): address;
public native fun policy_for(package_id: address): u8;
public native fun is_immutable(package_id: address): bool;
public native fun version_for(package_id: address): u64;

Problem

These require new VM primitives—UpgradeCaps cannot solve this:

  • current_package_id() needs VM introspection—no object can tell you which package version is currently executing
  • Immutable packages have no UpgradeCap (it gets destroyed)
  • Move cannot dynamically lookup objects by package ID at runtime

Use Cases

  • Enforce "only immutable/additive modules" in DAO action registries
  • Pin governance proposals to specific audited package versions
  • Trustless runtime verification of third-party dependencies

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant