【发布时间】:2022-12-12 13:48:27
【问题描述】:
我正在尝试通过 thirdweb 在我的下一个应用程序中使用我的合同。但是我收到错误 “错误:合约不是 nft-drop”。 当我转到 thirdweb 仪表板并复制并粘贴完全相同的代码时,我仍然收到错误。我怎样才能解决这个问题?
代码
import { useContract } from '@thirdweb-dev/react'
export default function Component() {
const { contract } = useContract("<My contract address>", "nft-drop")
// Now you can use the nft drop contract in the rest of the component
}
我正在使用来自 thirdweb react 文档 https://portal.thirdweb.com/sdk/interacting-with-contracts/nft-drop#getting-the-contract-in-your-application 的 useContract 钩子
但是我仍然收到错误,我该如何解决?
【问题讨论】: