ExamplesTip jar

Examples: Tip jar

Woven from its 177 bytes

Tip jar

Send lamports to alice and log both balances.

Language
Python
Bytecode
177bytes
Cards
20
Units on the Weft VM
32 104CU
Runs
Inline, in one transaction
# Moves lamports from the signer to alice through the System Program.
tip = 25_000_000  # 0.025 SOL
before = account(accounts["alice"])["lamports"]
transfer(accounts["alice"], tip)
after = account(accounts["alice"])["lamports"]
print(f"alice: {before} -> {after} lamports")
return after - before