Skip to main content

Version 1.3.0

· 2 min read
Benoit Rognier
Guillaume Duhamel

We present new version 1.3.0 of Archetype language.

caution

This version introduces breaking changes in the naming of some builtins.

Added​

Asset access​

Presentation in this blog entry.


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​

and or​

Presentation in this blog entry.


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:

Sections


refuse transfer


failif


Types


Instructions


dorequire


dofailif


Constants


selfaddress


Builtins


callview


contract_address


date_from_timestamp


implicit_account


isnone


issome


key_address


mkoperation


opt_get


to_string


entrypoint


Assets


get_opt


addupdate


removeif


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"