Skip to content

Commit 88e96de

Browse files
committed
[Dashboard] Fix ContractCheckList (#5249)
## Problem solved Short description of the bug fixed or feature added <!-- start pr-codex --> --- ## PR-Codex overview This PR focuses on enhancing the `ContractChecklist` component by incorporating additional checks for ERC721 and ERC20 claim conditions, ensuring that the logic correctly reflects the type of contract being interacted with. ### Detailed summary - Added `isErc721` to the dependency array of `useMemo` for `hasERC721ClaimConditions`. - Added `isErc20` to the dependency array of `useMemo` for `hasERC20ClaimConditions`. - Updated the conditional check for `hasERC721ClaimConditions` to also verify `isErc721`. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
1 parent ccbf2d2 commit 88e96de

File tree

1 file changed

+5
-3
lines changed
  • apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/overview/components

1 file changed

+5
-3
lines changed

apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/overview/components/ContractChecklist.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,9 @@ function Inner({
105105
// writes
106106
ERC721Ext.isSetClaimConditionsSupported(functionSelectors),
107107
ERC721Ext.isResetClaimEligibilitySupported(functionSelectors),
108+
isErc721,
108109
].every(Boolean);
109-
}, [functionSelectors]);
110+
}, [functionSelectors, isErc721]);
110111

111112
const hasERC20ClaimConditions = useMemo(() => {
112113
return [
@@ -118,8 +119,9 @@ function Inner({
118119
// writes
119120
ERC20Ext.isSetClaimConditionsSupported(functionSelectors),
120121
ERC20Ext.isResetClaimEligibilitySupported(functionSelectors),
122+
isErc20,
121123
].every(Boolean);
122-
}, [functionSelectors]);
124+
}, [functionSelectors, isErc20]);
123125

124126
const claimConditions = useReadContract(
125127
isErc721 ? ERC721Ext.getClaimConditions : ERC20Ext.getClaimConditions,
@@ -233,7 +235,7 @@ function Inner({
233235
(erc20Supply.data || 0n) > 0n,
234236
});
235237
}
236-
if (hasERC721ClaimConditions) {
238+
if (hasERC721ClaimConditions && isErc721) {
237239
steps.push({
238240
title: "First NFT claimed",
239241
children: (

0 commit comments

Comments
 (0)