# 3.3 PaidPredictableCompetition

The PaidPredictableCompetition contract extends the PredictableCompetition features by adding customizable registration fee requirements, including customizable payment tokens. This implementation enables organizers to monetize their events while providing additional incentives for participants.

**Function 1: createBracketPrediction**

```solidity
function createBracketPrediction(address _registrant, uint8[] calldata _matchPredictions) public override(PredictableCompetition, IPaidPredictableCompetition) whenNotLive
```

This function allows users to create a bracket prediction and handles the registration fee payment.

| Name               | Type     | Description                                             |
| ------------------ | -------- | ------------------------------------------------------- |
| \_registrant       | address  | The address of the user creating the bracket prediction |
| \_matchPredictions | uint8\[] | An array containing the user's match predictions        |

**Function 2: createBracketPredictionGasToken**

```solidity
function createBracketPredictionGasToken(address _registrant, uint8[] calldata _matchPredictions) external payable override whenNotLive
```

This function allows users to create a bracket prediction and handles the registration fee payment using gas token.

| Name               | Type     | Description                                             |
| ------------------ | -------- | ------------------------------------------------------- |
| \_registrant       | address  | The address of the user creating the bracket prediction |
| \_matchPredictions | uint8\[] | An array containing the user's match predictions        |

**Function 3: refundRegistrationFee**

```solidity
function refundRegistrationFee() external override whenExpired
```

This function allows users to request a refund of their registration fee when the competition has expired.

**Function 4: claimRewards**

```solidity
function claimRewards() external override whenCompleted
```

This function allows users to claim their rewards when the competition is completed.

**Function 5: calculatePendingRewards**

```solidity
function calculatePendingRewards(address _user) public view override returns(uint256 pendingRewards_)
```

This function calculates the pending rewards for a user.

| Name   | Type    | Description             |
| ------ | ------- | ----------------------- |
| \_user | address | The address of the user |

**Function 6: getBracketPredictionFeeInfo**

```solidity
function getBracketPredictionFeeInfo() external view override returns(RegistrationFeeInfo memory)
```

This function returns the registration fee information for bracket predictions.


---

# 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://brkt-gg.gitbook.io/brkt.gg-whitepaper/3.3-paidpredictablecompetition.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.
