Skip to content

Commit

Permalink
Merge pull request #126 from magiclabs/bengriffin1-fix-ethers-token-v…
Browse files Browse the repository at this point in the history
…alidation

Fixing ABIs
  • Loading branch information
bengriffin1 authored Apr 4, 2024
2 parents f22d2ad + 768131e commit 2302c1d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/modules/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
4 changes: 2 additions & 2 deletions src/modules/utils/ownershipABIs.ts
Original file line number Diff line number Diff line change
@@ -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)",
]

0 comments on commit 2302c1d

Please sign in to comment.