Skip to main content
Version: Next


It is sometimes useful or necessary to modify the default semantics of a LIGO construct. This is done by annotating the construct with a decorator. Decorators have one of the two forms:

  1. @name_of_decorator,
  2. @name_of_decorator("Some string").

Decorators are located just before the construct they apply to. Note that the lexical convention for decorators clashes with that of escaped variables, therefore predefined decorators cannot be variables.

Decorators can be composed by simple juxtaposition, like so:

type storage = int;
type result = [list<operation>, storage];
@entry @no_mutation
const sub = (delta: int, store: storage) : result =>
[[], store - delta];