sui_verifier_v1

Module one_time_witness_verifier

Source
Expand description

A module can define a one-time witness type, that is a type that is instantiated only once, and this property is enforced by the system. We define a one-time witness type as a struct type that has the same name as the module that defines it but with all the letters capitalized, and possessing certain special properties specified below (please note that by convention, “regular” struct type names are expressed in camel case). In other words, if a module defines a struct type whose name is the same as the module name, this type MUST possess these special properties, otherwise the module definition will be considered invalid and will be rejected by the validator:

  • it has only one ability: drop
  • it has only one arbitrarily named field of type boolean (since Move structs cannot be empty)
  • its definition does not involve type parameters
  • its only instance in existence is passed as an argument to the module initializer
  • it is never instantiated anywhere in its defining module

Functions§