Smart Contract
One Rust contract on NEAR holds every deposit and pays out by fixed rules.
Where it lives
| Account | |
|---|---|
| Escrow | escrow.lold.near |
| USDC | 17208628f84f5d6ad33f0da3bbbeb27ffcb398eac501a31bd6ad2011e36133a1 |
| Code hash | GaYShHFfXF7LDLw4QCQFP4qcDVqogvDimimREQHu2qga |
Source · built reproducibly in CI, so you can rebuild it and compare the hash.
Money rules
- Deposit
- Guests who came split the whole pool. Nobody came: full refund.
- Ticket
- The price goes to the host when a guest registers.
- Publish
- Within 3 days after the end, the host publishes who came. Nothing is paid yet.
- Disputes
- For 12 hours any guest can dispute one record by locking one deposit. The event’s Sputnik DAO council decides (3 votes) within 7 days after the window. A dispute it doesn’t decide in time expires: the list stands and the deposit goes back.
- Payout
- Then anyone can settle. A wrong dispute loses its deposit: half to the treasury, half to the guests who came.
- Cancel
- The host can cancel a deposit event until it publishes the list. Everyone is refunded. Cancelling a ticket event refunds nothing.
- No list
- 3 days after the end without a list, anyone can start the refund. The list then counts as empty, and guests who came have the dispute window to prove it. If nobody does, everyone gets the deposit back. If someone does, the guests who proved it split the pool.
What the host can’t do
- Take the deposits.
- Publish the list before the event ends. Before the start, the only way out is a full refund.
- Have the last word: any guest can dispute the list, and the council decides.
- Mark someone who didn’t register.
- Touch anyone’s balance.
The host publishes who came, and any guest can dispute a record before the council. Deposit events close registration when they start (ticket events when they end), so the host cannot add guests after seeing who came.
Check-ins stay off-chain, so 300 guests cost nothing. Only the final list goes on-chain. The contract account has no keys: only the owner can upgrade the code, and after freeze nobody can. Check get_config and the code hash.
Methods
| Method | Who | Does |
|---|---|---|
create_event | Host | Creates an event |
ft_transfer_call | Guest | Pays and registers · {"action":"register","event_id":N} |
ft_transfer_call | Guest, during the dispute window | Opens a dispute · {"action":"dispute","event_id":N,"target":"…","attended":true} |
finalize | Host, by the deadline (3 days after the end by default) | Publishes the list of who came (ticket: closes the event) |
resolve_dispute | The event’s DAO | Records the council’s verdict on one dispute |
void_event | The event’s DAO, before the court deadline | Calls the published list off: every deposit and dispute deposit goes back |
settle | Anyone, after the dispute window | Pays out by the final list |
refund | Anyone, after that deadline | Publishes an empty list for a host who published none |
cancel | Host · ticket: anyone after 30 days | Refunds every deposit (tickets: no refund) |
set_rules | Owner | Court, treasury and hours for new events; running events keep theirs |
withdraw | Anyone | Sends out your balance |
on_auth | NEAR Intents wallets | Create, finalize or cancel through an auth_call intent |
add_to_whitelist · set_whitelist_mode | Owner | Only listed hosts create events, when on |
add_sponsored · set_sponsored_mode | Owner | Free events only for listed hosts, when on |
upgrade · freeze | Owner | New code until freeze; freeze is forever |
get_event · get_guests · balance_of · get_config | Anyone | Free reads |
near contract call-function as-read-only escrow.lold.near get_event \
json-args '{"event_id": 0}' network-config mainnet nowLimits
From 0.1 USDC · up to 300 guests · free up to 50 seats, 2 per host in 30 days, ending within 60 days · ends within a year.
See it on-chain
Build and test
cd contracts cargo test --locked -p near-events -p test-usdc cargo test --locked -p near-events-sandbox cargo near build reproducible-wasm --manifest-path events/Cargo.toml