diff --git a/utils/common/protocolUtils.ts b/utils/common/protocolUtils.ts index 31bf03e..d942b2e 100644 --- a/utils/common/protocolUtils.ts +++ b/utils/common/protocolUtils.ts @@ -15,7 +15,11 @@ export class ProtocolUtils { this._provider = _provider; } - public async getCreatedSetTokenAddress (txnHash: string | undefined): Promise { + public async getCreatedSetTokenAddress( + txnHash: string | undefined, + fromBlockNumber?: string, + toBlockNumber?: string, + ): Promise { if (!txnHash) { throw new Error("Invalid transaction hash"); } @@ -24,9 +28,10 @@ export class ProtocolUtils { const iface = new ethers.utils.Interface(abi); const topic = ethers.utils.id("SetTokenCreated(address,address,string,string)"); + const logs = await this._provider.getLogs({ - fromBlock: "latest", - toBlock: "latest", + fromBlock: fromBlockNumber || "latest", + toBlock: toBlockNumber || "latest", topics: [topic], });