Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
f9e6a73
Using legacy claim functions pre-Saturn
0xfornax Sep 15, 2025
df7b233
Merge branch 'master' into v11-claim-rewards
0xfornax Sep 18, 2025
38aa23e
Adjust v11 interval for devnet
0xfornax Sep 19, 2025
351dfc4
UserETH -> SmoothingPoolETH
0xfornax Sep 19, 2025
806f2de
Fix rewards tree dir
0xfornax Sep 19, 2025
b2cb245
Add GetTotalProtocolDaoEth
0xfornax Sep 19, 2025
95665b6
smoothingPoolEthRewards -> nodeOperatorSmoothingPoolEthRewardsAndVote…
0xfornax Sep 19, 2025
307ef2f
Add GetTotalSmoothingPoolBalance() as the SmoothingPoolETH
0xfornax Sep 19, 2025
67c804a
Merge remote-tracking branch 'origin/master' into v11-claim-rewards
0xfornax Sep 20, 2025
078bc7b
Fix adding voter share to SmoothingPoolEth
0xfornax Sep 22, 2025
16807fa
Removing CID as it's not present on 1.4 contracts
0xfornax Sep 22, 2025
c98d309
Subtract oDAO rewards only in case node operators had rewards, otherw…
0xfornax Sep 22, 2025
c4b509c
Fallback when fetching rewards events
0xfornax Sep 23, 2025
b2386d3
Fix tests
0xfornax Sep 23, 2025
146e746
Embed git metadata into docker images
thomaspanf Sep 23, 2025
32ea377
Add devnet houston RocketRewardsPool address to config
thomaspanf Sep 24, 2025
b326eef
Adjust the Validator proof format
0xfornax Sep 25, 2025
603eb8b
Adjust the WithdrawalProof format
0xfornax Sep 25, 2025
192dff2
Match cli flag to enable saturn
thomaspanf Sep 25, 2025
9ada5a8
Add saturn check for Saturn multicalls
0xfornax Sep 25, 2025
4734c6e
Update megapoolV1EncodedAbi
thomaspanf Sep 25, 2025
83728fb
Add megapool validators to the total validator count when calculating…
thomaspanf Sep 28, 2025
4dd8c79
Fix maxAmount calc in withdraw-rpl cli
thomaspanf Sep 28, 2025
5714726
Check if bond reductions are enabled
0xfornax Sep 29, 2025
aef06e2
Add saturn check to bond reductions
0xfornax Sep 29, 2025
9bccf8d
Merge branch 'master' into v11-claim-rewards
0xfornax Sep 30, 2025
9d21060
Pretty print days and hours for UnstakingPeriodDuration in withdraw-r…
thomaspanf Sep 30, 2025
6255219
Fix the maxAmount calc for megapool staked RPL
thomaspanf Sep 30, 2025
461f63d
Rename field RplStake to TotalRplStake
thomaspanf Sep 30, 2025
b400e7e
Pretty print days and hours for UnstakingPeriodDuration in node status
thomaspanf Sep 30, 2025
a73857a
Merge branch 'master' into v11-claim-rewards
0xfornax Oct 1, 2025
cc35162
Add provision express tickets node task
thomaspanf Oct 7, 2025
8308de1
Add provision express tickets message to node status
thomaspanf Oct 7, 2025
56d9bad
Fix typo
0xfornax Oct 9, 2025
462735f
Prompt users about unprovisioned tickets before closing minipools
thomaspanf Oct 12, 2025
f5d00d2
Using different rewards struct for Houston and Saturn
0xfornax Oct 13, 2025
fe4e497
Merge branch 'v11-claim-rewards' of github.com:rocket-pool/smartnode …
0xfornax Oct 13, 2025
30cff7a
Merge branch 'master' into v11-claim-rewards
0xfornax Oct 16, 2025
f6da8c9
Version bump
0xfornax Oct 16, 2025
abdcfe1
Get megapool validator info when creating network state for a node, l…
thomaspanf Oct 23, 2025
9fdacce
Merge branch 'master' into v11-claim-rewards
0xfornax Oct 27, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 90 additions & 0 deletions bindings/legacy/v1.3.1/rewards/distributor-mainnet.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
package rewards

import (
"fmt"
"math/big"
"sync"

"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/common"
"github.com/rocket-pool/smartnode/bindings/rocketpool"
)

// Check if the given node has already claimed rewards for the given interval
func IsClaimed(rp *rocketpool.RocketPool, index *big.Int, claimerAddress common.Address, opts *bind.CallOpts) (bool, error) {
rocketDistributorMainnet, err := getRocketDistributorMainnet(rp, opts)
if err != nil {
return false, err
}
isClaimed := new(bool)
if err := rocketDistributorMainnet.Call(opts, isClaimed, "isClaimed", index, claimerAddress); err != nil {
return false, fmt.Errorf("error getting rewards claim status for interval %s, node %s: %w", index.String(), claimerAddress.Hex(), err)
}
return *isClaimed, nil
}

// Get the Merkle root for an interval
func MerkleRoots(rp *rocketpool.RocketPool, interval *big.Int, opts *bind.CallOpts) ([]byte, error) {
rocketDistributorMainnet, err := getRocketDistributorMainnet(rp, opts)
if err != nil {
return nil, err
}
bytes := new([32]byte)
if err := rocketDistributorMainnet.Call(opts, bytes, "merkleRoots", interval); err != nil {
return nil, fmt.Errorf("error getting Merkle root for interval %s: %w", interval.String(), err)
}
return (*bytes)[:], nil
}

// Estimate claim rewards gas
func EstimateClaimGas(rp *rocketpool.RocketPool, address common.Address, indices []*big.Int, amountRPL []*big.Int, amountETH []*big.Int, merkleProofs [][]common.Hash, opts *bind.TransactOpts) (rocketpool.GasInfo, error) {
rocketDistributorMainnet, err := getRocketDistributorMainnet(rp, nil)
if err != nil {
return rocketpool.GasInfo{}, err
}
return rocketDistributorMainnet.GetTransactionGasInfo(opts, "claim", address, indices, amountRPL, amountETH, merkleProofs)
}

// Claim rewards
func Claim(rp *rocketpool.RocketPool, address common.Address, indices []*big.Int, amountRPL []*big.Int, amountETH []*big.Int, merkleProofs [][]common.Hash, opts *bind.TransactOpts) (common.Hash, error) {
rocketDistributorMainnet, err := getRocketDistributorMainnet(rp, nil)
if err != nil {
return common.Hash{}, err
}
tx, err := rocketDistributorMainnet.Transact(opts, "claim", address, indices, amountRPL, amountETH, merkleProofs)
if err != nil {
return common.Hash{}, fmt.Errorf("error claiming rewards: %w", err)
}
return tx.Hash(), nil
}

// Estimate claim and restake rewards gas
func EstimateClaimAndStakeGas(rp *rocketpool.RocketPool, address common.Address, indices []*big.Int, amountRPL []*big.Int, amountETH []*big.Int, merkleProofs [][]common.Hash, stakeAmount *big.Int, opts *bind.TransactOpts) (rocketpool.GasInfo, error) {
rocketDistributorMainnet, err := getRocketDistributorMainnet(rp, nil)
if err != nil {
return rocketpool.GasInfo{}, err
}
return rocketDistributorMainnet.GetTransactionGasInfo(opts, "claimAndStake", address, indices, amountRPL, amountETH, merkleProofs, stakeAmount)
}

// Claim and restake rewards
func ClaimAndStake(rp *rocketpool.RocketPool, address common.Address, indices []*big.Int, amountRPL []*big.Int, amountETH []*big.Int, merkleProofs [][]common.Hash, stakeAmount *big.Int, opts *bind.TransactOpts) (common.Hash, error) {
rocketDistributorMainnet, err := getRocketDistributorMainnet(rp, nil)
if err != nil {
return common.Hash{}, err
}
tx, err := rocketDistributorMainnet.Transact(opts, "claimAndStake", address, indices, amountRPL, amountETH, merkleProofs, stakeAmount)
if err != nil {
return common.Hash{}, fmt.Errorf("error claiming rewards: %w", err)
}
return tx.Hash(), nil
}

// Get contracts
var rocketDistributorMainnetLock sync.Mutex

func getRocketDistributorMainnet(rp *rocketpool.RocketPool, opts *bind.CallOpts) (*rocketpool.Contract, error) {
rocketDistributorMainnetLock.Lock()
defer rocketDistributorMainnetLock.Unlock()
return rp.GetContract("rocketMerkleDistributorMainnet", opts)
}
Loading
Loading