Skip to content

Commit

Permalink
Removing commented out code
Browse files Browse the repository at this point in the history
  • Loading branch information
bengriffin1 committed Apr 4, 2024
1 parent 1673b36 commit ceea22d
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 69 deletions.
2 changes: 0 additions & 2 deletions src/modules/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,9 @@ export class UtilsModule extends BaseModule {
const provider = new ethers.JsonRpcProvider();
if (contractType === 'ERC721') {
const contract = new ethers.Contract(contractAddress, ERC721ContractABI, provider);
// const contract = new web3.eth.Contract(ERC721ContractABI, contractAddress);
balance = BigInt(await contract.balanceOf(walletAddress));
} else {
const contract = new ethers.Contract(contractAddress, ERC1155ContractABI, provider);
// const contract = new web3.eth.Contract(ERC1155ContractABI, contractAddress);
balance = BigInt(await contract.balanceOf(walletAddress, tokenId));
}
if (balance > BigInt(0)) {
Expand Down
56 changes: 1 addition & 55 deletions src/modules/utils/ownershipABIs.ts
Original file line number Diff line number Diff line change
@@ -1,60 +1,6 @@
// // Reduced ABI for ERC1155 with just balanceOf
// export const ERC1155ContractABI = [
// {
// "constant": true,
// "inputs": [
// {
// "name": "_owner",
// "type": "address"
// },
// {
// "name": "_id",
// "type": "uint256"
// }
// ],
// "name": "balanceOf",
// "outputs": [
// {
// "name": "",
// "type": "uint256"
// }
// ],
// "payable": false,
// "stateMutability": "view",
// "type": "function"
// }
// ];

// // Reduced ABI for ERC721 with just balanceOf
// export const ERC721ContractABI = [
// {
// "constant": true,
// "inputs": [
// {
// "name": "_owner",
// "type": "address"
// },
// {
// "name": "_id",
// "type": "uint256"
// }
// ],
// "name": "balanceOf",
// "outputs": [
// {
// "name": "",
// "type": "uint256"
// }
// ],
// "payable": false,
// "stateMutability": "view",
// "type": "function"
// }
// ];

export const ERC721ContractABI = [
"function balanceOf(address) view returns (uint)",
]
export const ERC1155ContractABI = [
"function balanceOf(address, id) view returns (uint)",
]
]
9 changes: 1 addition & 8 deletions test/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
{
"extends": "../config/tsconfig.test.json",
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"strict": true,
"skipLibCheck": true,
"esModuleInterop": true,
}
"extends": "../config/tsconfig.test.json"
}
5 changes: 1 addition & 4 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
{
"extends": "./config/tsconfig.base.json",
"compilerOptions": {
"esModuleInterop": true,
}
"extends": "./config/tsconfig.base.json"
}

0 comments on commit ceea22d

Please sign in to comment.