You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
type storage = unit
contract type X = sig
type storage
val%entry entry_a : nat -> storage -> operation list * storage
val%entry entry_b : int -> storage -> operation list * storage
end
contract type Y = sig
type storage
type pt =
| A of nat
| B of int
val%entry main : pt -> storage -> operation list * storage
end
(* 1 : Using entry syntax *)
let%entry main (parameter : nat * X.instance) s =
let num, c = parameter in
let op =
if num < 50p then
Contract.call c 0tz entry_a 1p
else
Contract.call c 0tz entry_b 1
in
([op], s)
(* 2 : Using entry manually *)
(* let%entry main (parameter : nat * Y.instance) s =
let num, c = parameter in
let arg =
if num < 50p then
Y.A 1p
else
Y.B 1
in
let op = Contract.call c 0tz arg in
([op], s) *)
For code block 1, it will compile to
For code block 2, it will compile to
Using multiple entries will generate larger size of code.
The text was updated successfully, but these errors were encountered: