> For the complete documentation index, see [llms.txt](https://vibe-launchpad.gitbook.io/vibe/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://vibe-launchpad.gitbook.io/vibe/protocol/contracts/feehandler.md).

# FeeHandler

The `FeeHandler` contract handles all fees earned by the protocol. Additionally, the protocol's lottery mechanism also resides in this contract.

### Public Functions

#### collectETH

Called by users to collect ETH from the protocol. ETH can accrue to users in two ways:

1. A token creator has earned a portion of trading fees.
2. A user wins the lottery.

This function will transfer all accrued ETH to the caller.

```solidity
function collectETH() external returns (uint256 ethReceived)
```

#### buyTickets

Buy tickets for the ongoing lottery in exchange for ETH.

```solidity
function buyTickets() external payable
```

#### donateToPot

Donate ETH to the ongoing lottery.

```solidity
function donateToPot() external payable
```

#### commitCrowdEntropy

Commits one source of entropy for the specified `jackpotId`. Can be called by anyone.

```solidity
function commitCrowdEntropy(uint256 jackpotId) external
```

#### awardJackpot

Pays out the lottery to the winner for the specified `jackpotId`. Should only called by the protocol admin as users will not know the value of `adminEntropy`.

```solidity
function awardJackpot(uint256 jackpotId, bytes32 adminEntropy) external
```

#### forceAwardJackpot

Forcefully pays out the lottery to the winner for the specified `jackpotId`. Can be called by anyone if `awardJackpot()` is not called after an extended period of time.

```solidity
function forceAwardJackpot(uint256 jackpotId) external
```
