Skip to main content

Version 1.4.3

· 2 min read
Benoit Rognier
Guillaume Duhamel

We present version 1.4.3 of Archetype language.

Added​

Functions​

Functions can now have side effects on storage. For example, it is now valid to write:

archetype function_side_effect

variable res : nat = 0

function set_res(v : nat) {
res := v
}

entry exec(value : nat) { set_res(value) }

The set_res function above illustrates that:

  • function can now have side effects (here on res)
  • return value may now be omitted, the function may then be used as an instruction

Native Michelson code​

It is now possible to write native michelson code with the follwing elements:

For example:

archetype michelson_instruction

entry exec (i : nat) {
michelson {
PUSH nat 0;
COMPARE;
NEQ;
IF { PUSH string "NOT_ZERO"; FAILWITH } { PUSH nat 0 }
}
}

Exponential builtin​

A builtin for exponential function exp_horner is now available. It is computed with the Horner method applied to the polynomial approwimation of the exponential function.

Changed​

Literals for BLS curves types bls12_381_fr bls12_381_g1 and bls12_381_g2 are now suffixed by fr g1 and g2 respectively; moreover:

  • int, nat and bytes literals cannot be used anymore as bls12_381_fr literals
  • bytes literals cannot be used anymore as bls12_381_g1 and bls12_381_g2 literals