Skip to content

Commit d7a8bab

Browse files
sktbrdclaude
andcommitted
fix(poidh): use claim.onChainId for contract calls — fixes ClaimNotFound revert
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 764d18c commit d7a8bab

3 files changed

Lines changed: 5 additions & 2 deletions

File tree

src/components/bounties/BountyDetailView.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,7 @@ export function BountyDetailView({ initialBounty, chainId, bountyId }: BountyDet
566566
size="sm"
567567
variant="default"
568568
disabled={acceptClaimHook.isPending}
569-
onClick={() => acceptClaimHook.accept(bounty.onChainId, claim.id)}
569+
onClick={() => acceptClaimHook.accept(bounty.onChainId, claim.onChainId)}
570570
>
571571
{acceptClaimHook.isPending ? (
572572
<>
@@ -617,7 +617,7 @@ export function BountyDetailView({ initialBounty, chainId, bountyId }: BountyDet
617617
variant="outline"
618618
className="w-full"
619619
disabled={submitForVoteHook.isPending}
620-
onClick={() => submitForVoteHook.submit(bounty.onChainId, claim.id)}
620+
onClick={() => submitForVoteHook.submit(bounty.onChainId, claim.onChainId)}
621621
>
622622
{submitForVoteHook.isPending ? (
623623
<>

src/services/poidh.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ function mapClaims(rawClaims: unknown[]): PoidhClaim[] {
109109
return rawClaims.map((c: unknown) => {
110110
const claim = c as {
111111
id: number;
112+
onChainId?: number;
112113
bountyId: number;
113114
title?: string;
114115
description?: string;
@@ -118,6 +119,7 @@ function mapClaims(rawClaims: unknown[]): PoidhClaim[] {
118119
};
119120
return {
120121
id: claim.id,
122+
onChainId: claim.onChainId ?? claim.id,
121123
bountyId: claim.bountyId,
122124
name: claim.title || `Claim #${claim.id}`,
123125
description: claim.description || "",

src/types/poidh.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
export interface PoidhClaim {
22
id: number;
3+
onChainId: number;
34
bountyId: number;
45
name: string;
56
description: string;

0 commit comments

Comments
 (0)