diff --git a/src/modules/utils/index.ts b/src/modules/utils/index.ts index 9a65696..aa9d737 100644 --- a/src/modules/utils/index.ts +++ b/src/modules/utils/index.ts @@ -56,7 +56,7 @@ export class UtilsModule extends BaseModule { // Check on-chain if user owns NFT by calling contract with web3 let balance = BigInt(0); - const provider = new ethers.JsonRpcProvider(); + const provider = new ethers.JsonRpcProvider(rpcURL); if (contractType === 'ERC721') { const contract = new ethers.Contract(contractAddress, ERC721ContractABI, provider); balance = BigInt(await contract.balanceOf(walletAddress)); diff --git a/src/modules/utils/ownershipABIs.ts b/src/modules/utils/ownershipABIs.ts index ed4ee7d..da24ffe 100644 --- a/src/modules/utils/ownershipABIs.ts +++ b/src/modules/utils/ownershipABIs.ts @@ -1,6 +1,6 @@ export const ERC721ContractABI = [ - "function balanceOf(address) view returns (uint)", + "function balanceOf(address owner) view returns (uint balance)", ] export const ERC1155ContractABI = [ - "function balanceOf(address, id) view returns (uint)", + "function balanceOf(address owner, uint id) view returns (uint balance)", ]