---
# System prepended metadata

title: Disperse rewards on BASE chain

---

# Problem

The Sonne token can be staked in order to earn rewards for stakers.
At the moment Sonne is deployed on Optimism however it should be possible to claim rewards for others chains aswell.

# Solution

A claim contract could be deployed on BASE to disperse reward token to SONNE stakers.
To use the claim method of the contract a proof has to be provided that prooves that msg.sender has staked SONNE tokens on Optimism.

## Claim Smart Contract on base

A contract that can be used be any staker to claim their rewards on BASE chain without the need of doing a OP transaction. 

```solidity=
function claim (Proof _proof) external payable {
    //Check if proof is part of the StateRoot committed 
    //Check if msg.senders address is included in the proof
    //Subtract msg.senders balance
    //Send rewards to msg.sender
}
```

## Compute Merkle Proof

A TypeScript function that used the eth_getProof method to compute a merkle proof for the target contract and returns the input argument for the claim function

# Open question 

## Purpose
What is the benefit of using BASE instead of Optimism for rewards distribution ?

## Frequency
Shall the rewards beeing dispersed once (like an AirDrop) or based on the time a user has staked Sonne on OP (like Sushi MasterChef)

## Accounting
How should the balance of the user be tracked on BASE? 

## Kind of stateRoot

To proof the validity of a merkle tree it's root has to be compared to a trusted stateRoot. In case of Optimism the Sequencer posts a StateRoot on L1 that can be used to proof that the root of the merkle tree was part of the storage of a given Optimism block.

We've to do some research how to access the stateRoot from BASE. 

