# Get Started with the Protocol Fee System (/docs/protocols/protocol-fee/guides/getting-started)

Follow a complete step-by-step flow to call `Firepit.release()` in the Uniswap Protocol Fee system.

In the current version of the Uniswap Protocol Fee system, participants can call `Firepit.release()` when releasable asset value exceeds the required UNI amount.

The simplest way to interact with the system is calling [`Firepit.release()`](/docs/protocols/protocol-fee/overview#release) from a wallet.

> [!NOTE]
> It is possible to interact with the `Firepit` contract via a custom smart contract to enable:
> 
>   * slippage / balance checks
>   * Uniswap v3 Fee [collection](/docs/protocols/protocol-fee/guides/best-practices#collect-uniswap-v3-fees)
>   * Uniswap v2 LP Token [redemptions](/docs/protocols/protocol-fee/guides/read-asset-balances#uniswap-v2-pool-protocol-fees)
>   * UNI token flash loans

## Step 1: Acquire a Sufficient Amount of UNI
The `Firepit` contract requires integrators to hold a minimum amount of UNI to call `release()`.
Participants can view the `threshold` by calling [`Firepit.threshold()`](/docs/protocols/protocol-fee/overview#threshold)

```solidity
uint256 threshold = IFirepit(address(0x0D5Cd355e2aBEB8fb1552F56c965B867346d6721)).threshold();
```

```bash
cast call 0x0D5Cd355e2aBEB8fb1552F56c965B867346d6721 "threshold()(uint256)" --rpc-url <RPC_URL>
```

## Step 2: Approve the Firepit to Spend UNI
Because the `Firepit` contract transfers UNI to `address(0xdead)`, integrating addresses **must first approve** the contract to spend their UNI

> [!WARNING]
> Integrators should assess the risks of max approving the `Firepit` contract

```solidity
IERC20(0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984).approve(
    0x0D5Cd355e2aBEB8fb1552F56c965B867346d6721,
    type(uint256).max
);
```

```bash
cast send 0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984 \
    "approve(address,uint256)(bool)" \
    --rpc-url <RPC_URL> \
    0x0D5Cd355e2aBEB8fb1552F56c965B867346d6721 \
    115792089237316195423570985008687907853269984665640564039457584007913129639935
```

## Step 3: Read the Nonce
The `Firepit` contract uses a `nonce` as a safety mechanism to avoid malicious front-running. The value provided to `release(...)` must be equal
to the value in contract storage

```solidity [solidity]
uint256 nonce = IFirepit(address(0x0D5Cd355e2aBEB8fb1552F56c965B867346d6721)).nonce();
```

```bash
cast call 0x0D5Cd355e2aBEB8fb1552F56c965B867346d6721 "nonce()(uint256)" --rpc-url <RPC_URL>
```

## Step 4: Call Firepit.release()
Once the value of the assets exceeds the value of the UNI tokens, integrators should call [`Firepit.release()`](/docs/protocols/protocol-fee/overview#release)

```solidity
uint256 _nonce = IFirepit(address(0x0D5Cd355e2aBEB8fb1552F56c965B867346d6721)).nonce();

Currency[] memory _assets = new Currency[](3);
_assets[0] = Currency.wrap(address(0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48)); // USDC
_assets[1] = Currency.wrap(address(0xdAC17F958D2ee523a2206206994597C13D831ec7)); // USDT
_assets[2] = Currency.wrap(address(0x0000000000000000000000000000000000000000)); // ETH

IFirepit(address(0x0D5Cd355e2aBEB8fb1552F56c965B867346d6721)).release(_nonce, _assets, 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045);
```

```bash
cast send 0x0D5Cd355e2aBEB8fb1552F56c965B867346d6721 "release(uint256,address[],address)" --rpc-url <RPC_URL> \
    <CURRENT_NONCE> <ASSET_ADDRESSES> <RECEIVER_ADDRESS>

# example: release USDC, USDT, and ETH to vitalik.eth
cast send 0x0D5Cd355e2aBEB8fb1552F56c965B867346d6721 "release(uint256,address[],address)" --rpc-url <RPC_URL> \
    0 \
    0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48,0xdAC17F958D2ee523a2206206994597C13D831ec7,0x0000000000000000000000000000000000000000 \
    0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045
```

## Verification
Confirm the `release` transaction is successful and inspect token transfers to verify UNI was burned and assets were released to the configured recipient.

## Where to Go Next
* [Read Asset Balances](/docs/protocols/protocol-fee/guides/read-asset-balances)
* [Best Practices](/docs/protocols/protocol-fee/guides/best-practices)
* [Deployments](/docs/protocols/protocol-fee/deployments)
