Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing ABIs #126

Merged
merged 2 commits into from
Apr 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)",
]
Loading