TYPE
object
objectParent of all object types. An object is a singleton data structure that resides in the SQL database.
Objects are much like entities, with the following restrictions:
- only a single instance is allowed for each definition
- all object attributes must have default values
- object values cannot be created or deleted from code (they are automatically created during blockchain initialization)
Example definition:
object state {
mutable x: integer = 0;
mutable s: text = 'n/a';
}
Object attributes are accessed directly:
print(state.x);
print(state.s);
Object values can be modified directly, or with an update statement:
// Direct modification
state.x += 10;
state.s = 'Updated';
// Modification via update statement
update state ( x += 5, s = 'Updated' );
See Also
Since
0.7.0
© 2026 Chromia