Yolc
A safe, expressive, fun language for Ethereum
mint :: OmniFn (ADDR -> U256 -> ())
mint = $lfn $ ylvm'pv
\to amount -> LVM.do
Ur balanceBefore <- ycall balanceOf (ver to)
Ur newAmount <- ywithrv_1 (balanceBefore, ver amount)
(\x y -> x + y)
-- ⚠️ NOTE: DATA VERSIONING AT COMPILE-TIME:
-- update balance must happen before external calls.
balances #-> to <<:= newAmount
-- call **untrusted** external contract onTokenMinted
ycall (to @-> onTokenMinted) (ver to) (ver amount)