How are failed transactions refunded in on-chain roulette?

0
158

A failed transaction on an on-chain roulette table falls into one of three cases, and each refunds a different amount by a different route. If the bet transaction itself reverts, the stake never leaves your wallet, and only the gas is lost. If the bet is accepted but the draw never arrives, the stake comes back through an expiry claim. If the payout transaction fails after a win, the winnings stay owed by the contract and are paid on the next successful call.

When does the bet itself revert?

The bet function at a crypto games roulette contract rejects the call. The common reasons are a stake below the minimum or above the maximum, a pocket number outside 0 to 36, a table that is paused, or a gas limit too low for the function to finish. The explorer shows the transaction as failed with a short reason string beside it.

What is lost is the gas fee for the attempt, which the network keeps, whether or not the call succeeds. What comes back is the stake, and it comes back without any action on your part. A reverted transaction undoes every change it made, including the transfer of your stake into the contract, so the coins never left your wallet in the first place. No claim is needed, and nothing is owed.

When the bet is accepted but the draw fails?

The bet was mined, the contract holds the stake, and the VRF fulfilment or the house reveal did not arrive before the expiry block. The contract marks the bet as expired. What is lost is the gas for the best transaction and, later, the gas for the claim. What comes back is the full stake, through a refund or claim function that the interface shows as a button once the bet has expired. No edge and no fee applies, because the contract never had a number to settle against.

When the payout fails after a win?

The draw arrived, the bet won, and the transfer of winnings to your address failed. This happens when the contract’s bankroll is momentarily short because a larger win settled in the same block, or when your receiving address is itself a contract that rejects incoming transfers. Nothing is lost here, because the win is recorded against your address in the contract’s storage the moment the draw settles, and that record survives a failed transfer. What comes back is the winnings on the next successful payout call. Most contracts expose a withdraw or claim winnings function that retries the transfer, and if the bankroll was the cause, the retry succeeds as soon as the bankroll is topped up.

Claiming, in the second and third cases, means opening the table with the same wallet that placed the bet, finding the claims or history section, and pressing the button beside the amount. If the table’s page is down, the same function can be called from the contract’s page on the explorer. The claim needs gas and no stake, and the refund or the winnings arrive in the same transaction that claims them.

Gas is the only cost that is never returned, because it pays the network rather than the contract. Everything the contract holds on your behalf, whether a stake that never got a number or a win that could not be paid, stays claimable until you take it.