Skip to content

Commit

Permalink
feat: add claim check after generation
Browse files Browse the repository at this point in the history
  • Loading branch information
shrimalmadhur committed Sep 18, 2024
1 parent 11fe204 commit 001438c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ require (
github.com/Layr-Labs/eigenlayer-contracts v0.3.2-mainnet-rewards
github.com/Layr-Labs/eigenlayer-rewards-proofs v0.2.10
github.com/Layr-Labs/eigenpod-proofs-generation v0.0.14-stable.0.20240730152248-5c11a259293e
github.com/Layr-Labs/eigensdk-go v0.1.10
github.com/Layr-Labs/eigensdk-go v0.1.11
github.com/blang/semver/v4 v4.0.0
github.com/consensys/gnark-crypto v0.12.1
github.com/ethereum/go-ethereum v1.14.5
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ github.com/Layr-Labs/eigenpod-proofs-generation v0.0.14-stable.0.20240730152248-
github.com/Layr-Labs/eigenpod-proofs-generation v0.0.14-stable.0.20240730152248-5c11a259293e/go.mod h1:T7tYN8bTdca2pkMnz9G2+ZwXYWw5gWqQUIu4KLgC/vM=
github.com/Layr-Labs/eigensdk-go v0.1.10 h1:VWXSoJ0Vm2ZEfSPgftOgmek3xwXKRmeKrNFXfMJJlko=
github.com/Layr-Labs/eigensdk-go v0.1.10/go.mod h1:XcLVDtlB1vOPj63D236b451+SC75B8gwgkpNhYHSxNs=
github.com/Layr-Labs/eigensdk-go v0.1.11 h1:ZTOPKGoOyzKfi7DbYI2azMECcjmK2sRtHoPpjCq1MBc=
github.com/Layr-Labs/eigensdk-go v0.1.11/go.mod h1:XcLVDtlB1vOPj63D236b451+SC75B8gwgkpNhYHSxNs=
github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY=
github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU=
github.com/Microsoft/hcsshim v0.11.4 h1:68vKo2VN8DE9AdN4tnkWnmdhqdbpUFM8OF3Airm7fz8=
Expand Down
10 changes: 10 additions & 0 deletions pkg/rewards/claim.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,16 @@ func Claim(cCtx *cli.Context, p utils.Prompter) error {
TokenLeaves: convertClaimTokenLeaves(claim.TokenLeaves),
}

logger.Info("Validating claim proof...")
ok, err := elReader.CheckClaim(&bind.CallOpts{Context: ctx}, elClaim)
if err != nil {
return err
}
if !ok {
return errors.New("failed to validate claim")
}
logger.Info("Claim proof validated successfully")

if config.Broadcast {
eLWriter, err := common.GetELWriter(
config.ClaimerAddress,
Expand Down

0 comments on commit 001438c

Please sign in to comment.