Skip to content

Commit

Permalink
feat: get polygon log (#253)
Browse files Browse the repository at this point in the history
  • Loading branch information
jpsains authored Jun 7, 2024
1 parent 011fd5f commit fbd40ad
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/adapters-library/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ const ConfigSchema = z
ethereum: z.boolean().default(true),
optimism: z.boolean().default(true),
bsc: z.boolean().default(false),
polygon: z.boolean().default(false),
polygon: z.boolean().default(true),
fantom: z.boolean().default(false),
base: z.boolean().default(true),
arbitrum: z.boolean().default(true),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,24 @@ export class CustomJsonRpcProvider extends JsonRpcProvider {
throw new NotSupportedUnlimitedGetLogsBlockRange()
}

if (this.chainId === Chain.Polygon) {
const transferEventSignature = ethers.id(
'Transfer(address,address,uint256)',
)

const transferFilter = {
fromBlock: 0,
toBlock: 'latest',
topics: [
transferEventSignature,
'0x0000000000000000000000000000000000000000000000000000000000000000',
ethers.zeroPadValue(address, 32), // to address
],
}

return this.getLogs(transferFilter)
}

const transferEventSignature = ethers.id(
'Transfer(address,address,uint256)',
)
Expand Down

0 comments on commit fbd40ad

Please sign in to comment.