# The Smart Contract

The Challenge Rooms are managed by a Smart contract, which is in charge of the coins of the Homies before, during and after each game until the winner collects his prize.&#x20;

The way it works is:

1. Players sign up for a Challenge Room and the contract checks that they have enough $HomieCoins in their wallets to cover the entry fee. If they do not have enough money, they will not be able to enter.
2. Once the room is full, the contract will claim each player's money and hold it for the duration of the game.
3. When the winner is defined, the contract will keep their prize and give it to them when they claim it.&#x20;

**IMPORTANT! It is up to the players to claim their prizes.**&#x20;

In order to minimize the cost of gas, we will create a collection office within the HomieVerse where the prizes will be accumulated and each player will be able to claim all the $HomieCoins he/she has won at once.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://homiewars.gitbook.io/homie-wars-whitepaper/challenge-rooms/the-smart-contract.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
