Skip to content

Commit

Permalink
Fixes a bug that causes ERC-721 contracts without metadata to not work.
Browse files Browse the repository at this point in the history
We were only checking whether the `supportsInterface` call returned a value (rather than reverting), but we were failing to check the actual return value (a boolean).
  • Loading branch information
MicahZoltu authored Nov 22, 2023
1 parent d859470 commit 9c177aa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/ts/library/identifyTokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ export async function itentifyAddress(address: string, id: bigint, provider: Pro
address,
id,
owner: nftInterface.decodeFunctionResult('ownerOf', owner.returnData)[0],
name: hasMetadata.success ? nftInterface.decodeFunctionResult('name', name.returnData)[0] : undefined,
tokenURI: hasMetadata.success ? nftInterface.decodeFunctionResult('tokenURI', tokenURI.returnData)[0] : undefined,
name: hasMetadata.success && nftInterface.decodeFunctionResult('supportsInterface', hasMetadata.returnData)[0] ? nftInterface.decodeFunctionResult('name', name.returnData)[0] : undefined,
tokenURI: hasMetadata.success && nftInterface.decodeFunctionResult('supportsInterface', hasMetadata.returnData)[0] ? nftInterface.decodeFunctionResult('tokenURI', tokenURI.returnData)[0] : undefined,
})
}
} catch (error) {
Expand Down

0 comments on commit 9c177aa

Please sign in to comment.