Standard library
Syscalls reach the chain. Each figure is the whole call, the builtin call included, measured on the Weft program.
| Syscall | Does | Units |
|---|---|---|
| log() | write a line to the transaction log | 678 +3 per byte |
| load() | read a key from the script's storage | 552 +224 per value read |
| store() | write a key to the script's storage | 697 +21 per byte, +224 per value written |
| account() | read an account's lamports, owner and data length | 3,955 |
| transfer() | move lamports from the signer through the System Program | 3,759 |
| sha256() | hash a string | 1,548 |
| now() | unix time from the Clock sysvar | 484 |
| slot() | the current slot from the Clock sysvar | 486 |
| signer() | the address that signed the run | 519 |
Helpers run in the interpreter: len, str, num, int, push, pop, keys, values, range, floor, ceil, abs, min, max, sqrt, upper, lower, split, join, contains, type. Each language also keeps its own spellings — console.log and Math.floor in JavaScript, print and append in Python, print and tostring in Lua, display in Lisp.