Skip to main content

Reserved Keywords

Module & Package​

KeywordDescription
cocoModule definition
packagePackage qualifier
importsImport packages
pubPublic visibility in packages
constConstant definition

State & Storage​

KeywordDescription
stateState definition (state logic, state actor)
logicLogic state keyword
actorActor state keyword
LogicAccess logic state (Module.Logic.field)
ActorAccess actor state (Module.Actor(id).field)
SenderCurrent sender identifier
memoryTemporary variable
storageStorage pointer variable
observeRead from state
mutateWrite to state
payerWho pays for logic-state storage (mutate ... payer Logic)
gatherLoad complex object from storage (not maps)
disperseStore complex object to storage (a map merges)

Endpoints & Functions​

KeywordDescription
endpointEndpoint definition
functionLocal function definition
deployLogic initialization endpoint
enlistReserved. No longer compiles as an endpoint qualifier (since v0.9.2)
dynamicEndpoint mutates state
staticEndpoint reads state (no mutation)
pureEndpoint has no state access

Classes & Types​

KeywordDescription
classClass definition
fieldClass field
methodClass method
selfReference to class instance
makeCreate new complex value

Control Flow​

KeywordDescription
if / elseConditional
switch / case / defaultMulti-branch conditional
for / inIteration
breakExit loop
continueSkip to next iteration
returnSet output and exit
yieldSet output (continue execution)
passNo operation
throwThrow exception

Events​

KeywordDescription
eventEvent definition
topicEvent topic field
emitEmit event

Interfaces & Assets​

KeywordDescription
interfaceInterface definition
assetAsset logic / asset interface section

Built-in Objects​

KeywordDescription
EnvironmentRuntime environment methods
InvocationCurrent invocation methods
BuiltinsBuilt-in functions
Actor(id)Actor query methods (Exists, HasSigned, Param)

Standard Functions​

KeywordDescription
lenLength of collection, string, bytes, or class
typeofType name as String
appendAdd to varray
popendRemove and return last varray element
mergeCombine arrays or maps
removeRemove key from map
makeCreate empty/default collection or class
joinConcatenate strings or merge classes (via __join__)
rangeGenerate integer sequence
sweepRemove empty collection from storage
generateAuto-create missing map keys
polorizeSerialize value to POLO bytes
depolorizeDeserialize POLO-encoded bytes

Literals​

KeywordDescription
trueBoolean true
falseBoolean false

Additional Keywords​

KeywordDescription
try / catch / finallyException handling
revertThrow with revert flag
buildReserved