Skip to content

Commit

Permalink
feat: claim all claimable tokens if token addresses is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
gpabst committed Nov 25, 2024
1 parent 74bcf53 commit ab89bb0
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions pkg/rewards/claim.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,15 @@ func BatchClaim(
earnerAddr := gethcommon.HexToAddress(claimConfig.EarnerAddress)

var tokenAddrs []gethcommon.Address
for _, addr := range claimConfig.TokenAddresses {
tokenAddrs = append(tokenAddrs, gethcommon.HexToAddress(addr))

// Empty token addresses list will create a claim for all tokens claimable
// by the earner address.
if len(claimConfig.TokenAddresses) == 0 {
tokenAddrs = nil
} else {
for _, addr := range claimConfig.TokenAddresses {
tokenAddrs = append(tokenAddrs, gethcommon.HexToAddress(addr))
}
}

elClaim, _, _, err := generateClaimPayload(
Expand Down

0 comments on commit ab89bb0

Please sign in to comment.