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

[erc721-with-landtype-multiplier] Add strategy erc721-with-landtype-multiplier #1529

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
erc721-with-landtype-multiplier
  • Loading branch information
monish-nagre committed Jul 15, 2024
commit 01103839c5d66f2e8a67d5978aeecd86b61d29d1
11 changes: 2 additions & 9 deletions src/strategies/erc721-with-landtype-multiplier/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export async function strategy(
): Promise<{ [address: string]: number }> {
const blockTag = typeof snapshot === 'number' ? snapshot : 'latest';

try {

// Step 1: Get the balance of each address
const balanceCalls = addresses.map((address: string) => [options.address, 'balanceOf', [address]]);
const balanceResponse = await multicall(network, provider, abi, balanceCalls, { blockTag });
Expand Down Expand Up @@ -64,7 +64,6 @@ export async function strategy(

// Parse token response
const tokenIds = tokenResponse.map((response: any) => BigNumber.from(response[0]).toString());
console.log('Token response:', tokenIds);

// Step 3: Get land type for each token ID
const landDataCalls: [string, string, [BigNumber]][] = tokenIds.map((tokenId: string) => [options.address, 'landData', [BigNumber.from(tokenId)]]);
Expand All @@ -87,12 +86,6 @@ export async function strategy(
tokenIndex++;
}
});

console.log('Voting power:', votingPower);

return votingPower;
} catch (error) {
return {};
}
}
}