Skip to content

Latest commit

 

History

History
31 lines (22 loc) · 850 Bytes

_GlobalPreOrder.md

File metadata and controls

31 lines (22 loc) · 850 Bytes

_GlobalPreOrder System Service

The system service charged with approving every transaction on a virtual chain (eg. checking subscription).

Implemented on the Native processor.

Permissions

  • This is a system contract that runs under System permissions.

 

_init (method)

Permissions

  • Internal (caller must be the same service).
  • ReadWrite (potentially changes state).

Behavior

  • Empty.

 

approve (method)

Permissions

  • External (caller can be anyone).
  • ReadOnly (does not change state).

Behavior

  • Get the virtual chain by calling Environment.GetVirtualChain.
  • Read the subscription data from Ethereum by calling Ethereum.CallContract.
    • Optimization: Maintain a cached value of the subscription status, refresh it every 1000 blocks.
  • Check if the subscription is valid.