# PrizeFlush

The PrizeFlush contract helps capture interest from the PrizePool and move collected funds to a designated PrizeDistributor contract. When deployed, the destination, reserve addresses are set and used as static parameters during every "flush" execution. The parameters can be reset by the Owner if necessary. The protocol can charge a fee during the movement of the funds.

## Write methods description

### initialize()

Allows to initialize the contract during the deployment.

Parameters:

<table><thead><tr><th width="162.33333333333331">Name</th><th width="111">Type</th><th>Description</th></tr></thead><tbody><tr><td><strong>_owner</strong></td><td>address</td><td>An account that will become a new owner of a contract.</td></tr><tr><td><strong>_destination</strong></td><td>address</td><td>Address of the prizeDistributor contract.</td></tr><tr><td><strong>_reserve</strong></td><td>address</td><td>Reserve address.</td></tr><tr><td><strong>_prizePool</strong></td><td>address</td><td>PrizePool address.</td></tr></tbody></table>

### flush()

Migrate interest from PrizePool to PrizeDistributor and the protocolFeeRecipient in a single transaction. Captures interest, checkpoints data and transfers tokens to final destination.

Return:

<table><thead><tr><th width="126.33333333333331">Name</th><th width="92">Type</th><th>Description</th></tr></thead><tbody><tr><td><strong>_flushed</strong></td><td>bool</td><td><strong>true</strong> if operation is successful, <strong>false</strong> otherwise.</td></tr></tbody></table>

### setDestination()

Set global destination variable. PrizeDistributor contract that will receive the obtained yield.&#x20;

### setPrizePool()

Set global prizePool variable. PrizePool from where to get the yield from.

### setProtocolFeePercentage()

Set global protocolFeePercentage variable.

### setProtocolFeeRecipient()

Set global protocolFeeRecipient variable.

### setReserve()

Set global reserve variable.

### transferOwnership()

Transfers ownership of the contract to a \_pendingOwner. Can only be called by the current owner.

Parameters:

<table><thead><tr><th width="149.33333333333331">Name</th><th width="100">Type</th><th>Description</th></tr></thead><tbody><tr><td><strong>newOwner</strong></td><td>address</td><td>An account that will become the _pendingOwner.</td></tr></tbody></table>

### claimOwnership()

Allows the `pendingOwner` address to claim the owner role. This function is only callable by the `pendingOwner`.

### renounceOwnership()

Leaves the contract without owner. It will not be possible to call the owner's functions anymore. Can only be called by the current owner. The method does not take any parameters. Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.

### setManager()

Allows the owner to give the manager role to an address. The manager role has access to the functions with the modified `onlyOwner` or `onlyManagerOrOwner`.

Parameters:

<table><thead><tr><th width="167.33333333333331">Name</th><th width="102">Type</th><th>Description</th></tr></thead><tbody><tr><td><strong>_newManager</strong></td><td>address</td><td>An account that will become the new manager.</td></tr></tbody></table>

## Read methods description

### ONE\_AS\_FIXED\_POINT\_3()

Representation of 100% with 3 decimal places, used to split the obtained funds.

### getDestination()

Read global destination variable. It shows where the funds will be moved at the end.

### getPrizePool()

Read global prizePool variable. Pool from where to capture the award balance.

### getProtocolFeePercentage()

Read global ProtocolFeePercentage variable. Portion of the obtained yield that will be paid to the protocol as a fee.

### getProtocolFeeRecipient()

Read global ProtocolFeeRecipient variable. Address that will receive the protocolFee.

### getReserve()

Read global reserve variable. Contract that tracks funds earned over periods of time.

### owner()

Owner role that can be granted exclusive access to specific functions with the modifier **onlyOwner**.

### manager()

Manager role that can be granted exclusive access to specific functions with the modifier **onlyManager** or **onlyManagerOrOwner**.

### pendingOwner()

The address that can claim the owner role. It is used to transfer the owner.


---

# 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://docs.asymetrix.io/resources/developers-docs/prizeflush.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.
