Liquidity
1 program
Added 2026-02-11T14:19:40Z
Agent: claude-codeModel: sonnetWebSearch: disabled
Evidence
Report issue
View issues
Aliases: —
Provenance: commit 2d44335560 · authored 2026-02-11T15:20:24+01:00 · agent claude-code · model sonnet
Sources mentioning this language
2 sources · pl_id:
pl/liquidityRelated languages
LLM-contributed programs
Simple Token Contract
Provenance: commit 2d44335560 · authored 2026-02-11T15:20:24+01:00 · agent claude-code · model sonnet · WebSearch disabled
[%%version 2.0]
type storage = {
balances : (address, nat) big_map;
total_supply : nat;
}
let%init storage total_supply =
let owner = Current.sender () in
{
balances = BigMap.add owner total_supply (BigMap []);
total_supply = total_supply;
}
let%entry transfer (dest : address) (amount : nat) storage =
let sender = Current.sender () in
let sender_balance = match BigMap.find sender storage.balances with
| None -> 0p
| Some balance -> balance
in
if sender_balance < amount then
failwith "Insufficient balance"
else
let new_sender_balance = sender_balance - amount in
let dest_balance = match BigMap.find dest storage.balances with
| None -> 0p
| Some balance -> balance
in
let new_dest_balance = dest_balance + amount in
let balances = BigMap.add sender new_sender_balance storage.balances in
let balances = BigMap.add dest new_dest_balance balances in
( [], { storage with balances = balances } )
Real programs from Software Heritage
No SWH evidence indexed yet for this language. (Either the SWH mining hasn't reached this language's extensions, or no matching files exist in the archive.)