diff --git a/packages/adapters-library/src/config.ts b/packages/adapters-library/src/config.ts index 04b86cfc5..419227252 100644 --- a/packages/adapters-library/src/config.ts +++ b/packages/adapters-library/src/config.ts @@ -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), diff --git a/packages/adapters-library/src/core/provider/CustomJsonRpcProvider.ts b/packages/adapters-library/src/core/provider/CustomJsonRpcProvider.ts index 73f5547e4..64122504a 100644 --- a/packages/adapters-library/src/core/provider/CustomJsonRpcProvider.ts +++ b/packages/adapters-library/src/core/provider/CustomJsonRpcProvider.ts @@ -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)', )