> For the complete documentation index, see [llms.txt](https://docs.desuicoinflip.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.desuicoinflip.io/mechanics.md).

# Mechanics

<figure><img src="/files/0Zyv8gNbIDBh2FVXhy2u" alt="" width="563"><figcaption><p>SuiFrens x DeSuiLabs Coin Flip</p></figcaption></figure>

&#x20;is a smart contract with 50/50 odds of heads or tails.

A user bets on heads or tails. If they guess correctly, they win and the smart contract loses. A loss triggers the smart contract to send the user double their initial wager:

```jsx
User: bets 0.5 SUI on HEADS.
Smart contract: HEADS ✅

Smart Contract sends 1 SUI to user wallet
```

If a user guesses incorrectly, the smart contract sends the players wager into the house wallet:

```jsx
User: bets 0.5 SUI on TAILS.
Smart contract: HEADS ❌

Smart Contract sends 0.5 SUI to house wallet

```
