We present new version 1.3.0
of Archetype language.
This version introduces breaking changes in the naming of some builtins.
Added
otherwise
otherwise
command is now available in all sections to define a specific error message.
For example:
entry set_owner_candidate(oc : address) {
called by owner otherwise "CALLER_NOT_OWNER"
/* ... other sections ... */
}
/
%
It is now possible to divide and apply modulo between tez
values:
const a : rational = 5tz / 3tz;
const b : tez = 5tz % 2tz
Changed
add_update
When add_update
is used to update all asset fields it is now optimized and compiled in Michelson as a UPDATE
instruction.
reverse
reverse
's Michelson code is now optimized with:
NIL string ;
PUSH (list string) {"i0"; "i1"; "i2"};
ITER { CONS };
Fixed
Multiplication between rational
and big amount of tez
could fail with an overflow; the following now works:
const a = (2 / 3) * 9223372036854775807utz;
Renamings
Some builtins' have been renamed (for ex. snake-cased) to be more consistent, and error values have been capitalised.
Below is the list of renamings. New names are on the left, previous on the right:
Types
Builtins
Error messages
"ASSET_NOT_FOUND"
"AssetNotFound"
"DIV_BY_ZERO"
"divbyzero"
"INVALID_CALLER"
"InvalidCaller"
"INVALID_NEGATIVE_TEZ"
"InvalidNegativeTez"
"INVALID_SOURCE"
"InvalidSource"
"INVALID_STATE"
"InvalidState"
"INVALID_CONDITION"
"InvalidCondition"
"KEY_EXISTS"
"KeyExists"
"KEY_EXISTS_OR_NOT_FOUND"
"KeyExistsOrNotFound"
"NO_TRANSFER"
"NoTransfer"