---
updatedAt: 2025-09-09T07:32:23.000Z
agentTools:
  projectIndex: https://docs.stake.fish/llms.txt
---

# Claiming Rewards

In this guide, you’ll learn how to help your customers claim their rewards from Fee Pool.

To collect rewards for a wallet, your customer needs to call the `collectReward` method from the Fee Pool smart contract.

# How to Call the Smart Contract?

To claim rewards, you’ll need to create a Web UI that enables your customers to connect their wallet and call the Fee Pool smart contract. Only the customer can claim their rewards using this method.

Example (using `viem` library):

```javascript
import { createWalletClient, custom, http } from 'viem'
import { hoodi } from 'viem/chains'
 
export const publicClient = createPublicClient({
  chain: hoodi,
  transport: http()
})
 
export const walletClient = createWalletClient({
  chain: hoodi,
  transport: custom(window.ethereum)
})
 
export const [account] = await walletClient.getAddresses()

const FEE_POOL_ADDRESS = "0xB7283db8e33769011154243e77FD536D23ed2deB"
const CLAIM_AMOUNT = 10000000  // wei

const { request } = await publicClient.simulateContract({
  account,
  address: FEE_POOL_ADDRESS,
  abi: [
    {
      "inputs": [
        {
          "internalType": "address payable",
          "name": "beneficiary",
          "type": "address"
        },
        {
          "internalType": "uint256",
          "name": "amountRequested",
          "type": "uint256"
        }
      ],
      "name": "collectReward",
      "outputs": [],
      "stateMutability": "nonpayable",
      "type": "function"
    },
  ],
  functionName: 'collectReward',
  args: [account, CLAIM_AMOUNT]
})
await walletClient.writeContract(request)

console.log("request", request)
```

# Fee Pool Smart Contract

Here you can find interface of the `collectReward` method in Solidity:

```sol
/**
 * @notice Allows a depositor (`msg.sender`) to collect their rewards from the pool.
 * @dev Emits a {ValidatorRewardCollected} event.
 * Requirements:
 * - The pool must be open for withdrawals (Pool is not currently open for withdrawal).
 * - `amountRequested` cannot exceed the available balance (Not enough pending rewards).
 * @param beneficiary The address that will receive the `amountRequested`. If not set, it defaults to `msg.sender`.
 * @param amountRequested The amount to send to the `beneficiary`. If 0, all pending rewards are sent.
 */
function collectReward(address payable beneficiary, uint256 amountRequested) external;
```

# Claiming Wallet Rewards on Etherscan

If you'd prefer not to write code to claim rewards, you can easily do so using Etherscan. Here’s a step-by-step guide using [stakefish's fee pool on Hoodi](https://hoodi.etherscan.io/address/0xB7283db8e33769011154243e77FD536D23ed2deB).

**Step 1: Open the Contract on Etherscan**

Navigate to the contract on Etherscan and select the ***Contract*** tab. Then, click on ***Write as Proxy*** to access the contract's write methods. Next, click ***Connect to Web3*** to enable interaction with the contract.

![Contract tab on Etherscan](https://files.readme.io/dc2c2838e6ea04f12cf529012fa7713676b4a39c67cb482260a339125124a6b8-Screenshot_2024-09-05_at_15.31.03.png)

**Step 2: Connect Your Wallet**

You’ll be prompted to connect your Web3 wallet. Follow the Etherscan instructions to connect your wallet. Once connected, the ***Connect to Web3*** button will turn green and display ***Connected - Web3\[your wallet address]***.

![Wallet connected](https://files.readme.io/e4525dd24127d44440630b964512aa789c52387312896b243a059a055e901c58-Screenshot_2024-09-05_at_15.36.29.png)

**Step 3: Use the`collectReward` Method**

In the list of contract methods, locate the `collectReward` function. Input the **beneficiary address** (this can be your wallet address or another recipient), enter the **amount** you want to claim (in wei), and click ***Write***.

![collectReward method](https://files.readme.io/de048d3def5ca9d7f3d37a458b6048f1b4e0965f26fe0574d1b8a728e0676ac8-Screenshot_2024-09-05_at_15.40.32.png)

If you want to claim all rewards, you can set the amount to `0`.

**Step 4: Confirm the Transaction in Your Wallet**

Once you click ***Write***, you’ll need to confirm the transaction in your wallet. Follow the prompts to authorize the transaction.

![Confirm transaction](https://files.readme.io/5bf9edfc0cf5c8081402fd68338bfacd7e937cf5569457dd2b64e92620b1ac70-Screenshot_2024-09-05_at_15.43.15.png)

**Step 5: Check the Status of Your Transaction**

After submitting the transaction, you can monitor its status by clicking ***View your transaction***.

![View transaction](https://files.readme.io/777eddfd3680df70fb2e06ff800c25feffe8382b99ebc168430d81ba91e883f0-Screenshot_2024-09-05_at_15.43.55.png)

This will take you to the transaction page on Etherscan, where you can see if the transaction has been successfully mined.

![Transaction status](https://files.readme.io/3e3bfcec4596debaf842531bed6097e047f6a914fb00f8e8a9ac5931f4fc5e53-Screenshot_2024-09-05_at_15.45.20.png)

Once your transaction is successful, the rewards will be transferred to the specified beneficiary address.