Skip to content
Testnet
All raffles

Deploy a raffle

Put up a prize and set the rules. Once deployed, the raffle program on Rialo holds the money and enforces the terms: it sells tickets until the sale closes and accepts reveals until the reveal deadline. Five seconds after that, Rialo sends the draw by itself, because the same transaction schedules it; anyone can also press Draw once every ticket is revealed. You cannot change the terms afterwards. The program itself is not frozen: its deployer can still upgrade it during the testnet period.

The raffle

0 / 32 bytes

Stored on chain in the raffle account, as up to 32 bytes of UTF-8. Plain letters are one byte each.

The prize

RLO

Moved from your wallet into the raffle account by the same transaction that creates it, and paid to the winners. Zero is allowed: the pool is then the ticket money alone.

1 to supply

The pool is split equally and any remainder goes to the first ticket drawn. If fewer tickets are revealed than this, only the revealed ones can win.

The tickets

RLO

Added to the pool. Buying a ticket also publishes a commitment to a secret that stays in the buyer's browser.

2 to 200

Selling the last one closes the sale at once, without waiting for the deadline.

RLO

Paid per ticket on top of the price and handed back when the holder reveals. A holder who never reveals forfeits it to the pool, which is what discourages walking away after seeing the other secrets.

The clock

Sale runs for
Then reveals stay open for

Both deadlines are fixed when you press Deploy, from this device’s clock, and the chain checks every purchase and reveal against its own. When every ticket is revealed the draw can run at once instead of waiting for the reveal deadline.

Automatic draw

Deploying also schedules the draw with Rialo’s Subscriber program: at ·····, 5 seconds after reveals close, Rialo sends it by itself, in your name and with nobody pressing anything. It costs a small deposit, held by that program until you reclaim it on the raffle page after the draw (reclaiming costs the usual network fee), plus a network fee when Rialo sends it. If it does not arrive, the raffle page keeps a Draw button anyone can press.

Deploying signs a transaction, so it needs a wallet. Connecting makes a testnet key in this browser; the bar at the top shows its balance and can ask the faucet for funds.

Specimen

Every field strikes onto the card as you type. Nothing is on chain until you press Deploy and the chain executes it.

Drawbook
Specimen

·····

Prize
0.500RLO
Ticket

0.050

Winners

1

Sale closes

·····

Reveals close

·····

This half stays with the raffle account. It carries each buyer’s commitment, so anyone can check the draw against it later.

Stub
01to10
Bond

0.020

The buyer keeps this half. Their number and nonce are struck here at purchase, and the nonce is the one secret in the draw.

The sheet, as it will deploy

10 cells, none sold. The board draws this same bar for every raffle.

If it sells out
1.00RLO pool

The prize plus every ticket, plus any bonds forfeited by holders who never reveal.