Smart Contract

One Rust contract on NEAR holds every deposit and pays out by fixed rules.

Where it lives

Account
Escrowescrow.lold.near
USDC17208628f84f5d6ad33f0da3bbbeb27ffcb398eac501a31bd6ad2011e36133a1
Code hashGaYShHFfXF7LDLw4QCQFP4qcDVqogvDimimREQHu2qga

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

MethodWhoDoes
create_eventHostCreates an event
ft_transfer_callGuestPays and registers · {"action":"register","event_id":N}
ft_transfer_callGuest, during the dispute windowOpens a dispute · {"action":"dispute","event_id":N,"target":"…","attended":true}
finalizeHost, by the deadline (3 days after the end by default)Publishes the list of who came (ticket: closes the event)
resolve_disputeThe event’s DAORecords the council’s verdict on one dispute
void_eventThe event’s DAO, before the court deadlineCalls the published list off: every deposit and dispute deposit goes back
settleAnyone, after the dispute windowPays out by the final list
refundAnyone, after that deadlinePublishes an empty list for a host who published none
cancelHost · ticket: anyone after 30 daysRefunds every deposit (tickets: no refund)
set_rulesOwnerCourt, treasury and hours for new events; running events keep theirs
withdrawAnyoneSends out your balance
on_authNEAR Intents walletsCreate, finalize or cancel through an auth_call intent
add_to_whitelist · set_whitelist_modeOwnerOnly listed hosts create events, when on
add_sponsored · set_sponsored_modeOwnerFree events only for listed hosts, when on
upgrade · freezeOwnerNew code until freeze; freeze is forever
get_event · get_guests · balance_of · get_configAnyoneFree reads
near contract call-function as-read-only escrow.lold.near get_event \
  json-args '{"event_id": 0}' network-config mainnet now

Limits

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
NextDisputes & DAO
Loading component…