Identifier
The identifier of a contract element (parameter, variable, entrypoint, ...) is a string that starts with an alphabetic character (lower or upper case) followed by a string of alphanumeric characters (lower or upper case) or underscores. The maximum size of an identifier is 254. That is to say that an identifier verifies the following regular expression:
([A-Za-z][A-Za-z0-9_]*){1,254}
Keywords
A keyword is a reserved identifier that cannot be used as identifier, unless it is prefixed by the %
character.
For example, transfer
is the builtin instruction to call an external contract; in order to declare an entrypoint named transfer
, prefix it with %
:
entry %transfer() {
/* ... */
}
Below is the list of the language keywords.
added
aggregate
and
any
archetype
as
assert
asset
asset_view
at
before
begin
big_map
but
by
call
called
call_view
const
constant
contract
definition
div
do
do_fail_if
done
do_require
effect
else
emit
emptylist
end
entry
entrypoint
enum
event
exists
extension
fail
fail if
fails
false
fold
for
forall
from
function
getter
identified
if
in
initial
initialized
invariant
iter
label
lambda
left
let
list
map
match
namespace
none
not
on
option
or
otherwise
partition
asset_key
postcondition
predicate
record
ref
removed
require
require_entrypoint
return
right
sapling_state
sapling_transaction
security
self
set
shadow
some
sorted
sourced
specification
states
then
ticket
to
transfer
transition
true
type
unmoved
unpack
Unit
use
var
variable
view
when
while
with
xor