Commerce & Real World · QIE Mainnet Hackathon 3.0

Status: tested on a fork of QIE mainnet · mainnet deployment pending

The kitty that pays the court, or pays everyone back.

Rina books the futsal court and shares one link; friends pay their seats in QUSDC, QIE's dollar stablecoin, or in QIE. The last seat pays the court owner in that same transaction. If the deadline passes first, everyone takes their QUSDC back.

No admin key · deadline refunds · forks QIE mainnet through the public RPC

Kuitansi patungan · group payment

Futsal Kamis Thursday futsal

Untuk pembayaran · pays

test.qie

0.25 QUSDCper seat · 0.75 QUSDC in total

3/3

Batas waktu · deadline all 3 seats were paid before it, so nobody needed a refund

  1. 1seat 1 paid in QUSDCPAID
  2. 2seat 2 paid in QIEPAID
  3. 3seat 3 paid in QIEPAID

✓ Paid in full: 0.75 QUSDC to test.qie, inside seat 3's transaction

Replay of a run on a QIE mainnet fork (block 11,883,271). test.qie is a real mainnet name. Source: evidence/local-flow-run.txt.

Status

Mainnet deployment pending. The contract and app are built and tested against the real QUSDC, QIEDEX, Zone and Oracle contracts on a fork of QIE mainnet. This line reads the app's deployment list and changes when the contract is live.

QIE mainnet, read by this page just now

Block
reading…
QIE price (QIE Oracle, QIE/USDT feed)
reading…
QIE for a 0.25 QUSDC seat (QIEDEX)
reading…

71

contract tests pass; 24 of them read live mainnet state

evidence/forge-test-run.txt

5 / 5

injected bugs caught by the 47 mock-based tests

evidence/mutation-run.txt

267,557

gas for the last seat on a mainnet fork: swap, seat and payout in one transaction

evidence/local-flow-run.txt

4

QIE mainnet components: QUSDC, QIEDEX, Zone .qie, QIE Oracle

README · components

Lembar 01 · sheet 1: the last seat

The last seat fills the roster and pays the seller

Pool page after the last seat: 4 of 4 seats paid, a red LUNAS stamp, and the line Paid in full: 1.00 QUSDC to the payee

The app after the last seat, in a browser run on a mainnet fork (evidence/e2e-local/, pool #2).

$ script/local-flow.sh · anvil fork of QIE mainnetfork block 11883271
deploy Patungan                              gasUsed 3002560
createPoolByName (.qie resolve + title)      gasUsed 177664
join (QUSDC, first seat)                     gasUsed 182829
joinWithQIE (middle seat)                    gasUsed 248372
joinWithQIE (last seat -> payee paid)        gasUsed 267557
payee received 750000 QUSDC units in the last-seat tx (expect 750000)
createPool (address payee)                   gasUsed 128973
cancel (before first join)                   gasUsed 32930
claimRefund (one member)                     gasUsed 95422
refundAll (2 members, 1 skipped)             gasUsed 120539
pool 3 refundedCount 3
escrow QUSDC 500000 = totalHeld 500000 (pool 2's two seats)
native QIE left in contract: 0

A separate run of script/local-flow.sh, lines from evidence/local-flow-run.txt: the payee (owner of test.qie) gains 0.75 QUSDC inside the last seat's own transaction, and no QIE is left behind in the contract.

Browser run on a mainnet fork · selected steps from evidence/e2e-local-run.txt

  1. Dave joins pool #2 paying QIE (quote + 1%, one tx)OK
  2. Erin pays the last seat in QUSDC (approve, pay) and the LUNAS stamp lands
    payee +1000000 QUSDC units in Erin's tx
    OK
  3. the short pool passes its deadline: Fran gets her money back; the stamp says DIKEMBALIKANOK
  4. a double tap on Pay buys exactly one seat (the sheet locks before the wallet prompt)OK
  5. a QIEDEX quote above the Oracle guard shows the reason and no QIE Pay buttonOK

Lembar 02 · sheet 2: one link, two endings

Share, pay in QIE, or get it back

Organizer's share sheet with the pool link and a ready WhatsApp message
Bagikan · shareThe organizer creates the pool and sends one link to the group chat. (Captured on a local test run, so the link shows a local address.)
Join sheet paying 0.25 QUSDC in QIE with a QIEDEX quote and the Oracle cap
Bayar pakai QIE · pay with QIEA QIEDEX quote, the Oracle cap, one transaction. Unused QIE comes back.
Pool past its deadline with a green DIKEMBALIKAN stamp: everyone was refunded
Dikembalikan · refundedThe deadline passed with an open seat, so the member took the QUSDC back.

Lembar 03 · sheet 3: how it works

Four QIE contracts, one flow

Bayar pakai QIE · pay with QIE

The swap hides inside the join

joinWithQIE buys the exact seat price in QUSDC on QIEDEX and seats the member in the same call. A member holding only QIE never opens a swap screen.

QIE→QIEDEX→QUSDC escrow→
QIEDEX router · swapETHForExactTokensWQIE/QUSDC pair

Lunas · paid in full

The last seat pays

When the final seat is bought, the whole pool goes to the payee in that transaction. Nobody presses a release button.

QUSDC · PoolPaid

Untuk pembayaran · pays

Pay a name

The payee can be a .qie name. It is resolved when the pool is created and stored, so a later change to the name cannot redirect the money.

Zone · domainOwnerByName

Batas harga · price guard

The Oracle sets the ceiling

The QIE Oracle's price feed bounds what the swap may cost. It is a sanity bound, never the price paid.

QIE Oracle · latestRoundData

Dikembalikan · refunded

The deadline refunds

Past the deadline, or after a cancel, each member claims their QUSDC, or anyone triggers refunds for everyone.

claimRefund · refundAll

Peta · the map

Where the money moves

Member to escrow, escrow to the payee or back to the member. Patungan has no admin key and no withdraw function.

Architecture: a member joins with QUSDC or QIE; QIE is swapped through QIEDEX within the Oracle bound; Patungan escrows QUSDC; the last seat pays the payee resolved from Zone; past the deadline members are refunded

Tembusan · the carbon copy we keep

What is not true yet, in our own words

  1. Mainnet transactions: none yet (see Status). Everything above ran on a fork or mocks.
    README · Honest limits
  2. Distinct wallets are not distinct people. Any usage count we publish counts wallets.
    README · Honest limits
  3. QUSDC has an issuer-controlled VAULT_ROLE; if the issuer burns escrowed QUSDC, the pool cannot make everyone whole.
    README · Honest limits

Pertanyaan · questions

What a judge would ask

Is it on QIE mainnet?

Not yet. Every write path ran on an anvil fork of QIE mainnet, so it executed against the real QUSDC, QIEDEX, Zone and Oracle contracts and their state. Deploying spends real QIE and is the next step; the status line above changes once the deployment is added to the app's deployment list.

What if the group doesn't fill?

Then nobody is paid. After the deadline each member can take their QUSDC back with claimRefund, and anyone can call refundAll to return everyone's at once (in batches for large pools). The organizer can also cancel early, which opens the same refunds. A seat paid in QIE comes back as QUSDC.

Can the organizer run off with the money?

The organizer never holds it. QUSDC sits in the contract until the last seat, then goes to the payee fixed when the pool was created. Patungan has no admin key and no withdraw function. The one risk outside our code is QUSDC's issuer role, listed above.

Why swap QIE inside the join?

Members who hold QIE can pay without a separate swap. joinWithQIE buys exactly the seat price and returns unused QIE in the same transaction. It reverts if the swap would cost more than the Oracle's fair value plus a guard set at deploy (1,500 bps in the fork runs; the contract caps it at 2,000).

What does the .qie name do?

The organizer types the payee as a name such as test.qie. Patungan resolves it through Zone's domainOwnerByName at creation and stores the address. If the name points somewhere else by the time the transaction is mined, creation reverts with PayeeChanged.

What is mocked, and who are the users?

The demo path is not mocked: the browser runs and script/local-flow.sh use a mainnet fork. 47 of the 71 contract tests use mocks for speed and fuzzing. There are no real users yet; pools the builder creates will be labelled as builder wallets (the app already supports the label).

Everyone chips in, or everyone gets their money back.