Skip to content

Global contracts (NEP-591) #48

Description

@r-near

Background. NEP-591 (live on mainnet) lets accounts reference shared, globally-deployed contract code instead of each carrying its own WASM. It adds two actions: DeployGlobalContract and UseGlobalContract.

Current behavior. UseGlobalContract is parsed only on an open, unmerged PR (both identifier variants — code hash and account id). DeployGlobalContract is rejected outright by the action parser.

Work.

  • Land UseGlobalContract: finalize and merge the existing PR — both identifier variants (CodeHash, AccountId).
  • Add DeployGlobalContract: parse the action's code blob and deploy_mode.
    • code is a large WASM blob — mirror the existing DeployContract handling: stream it through the hasher (don't buffer), and display code size + sha256 hash.
    • deploy_mode is a 1-byte enum (CodeHash / AccountId) — display immutability clearly to the signer (CodeHash = immutable; AccountId = owner can update it for all referencing accounts).

Acceptance. Both actions parse and display on all target devices; both identifier variants and both deploy modes are covered; malformed input is rejected cleanly; verified against real testnet transactions.

Metadata

Metadata

Assignees

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