From dc88d0926a1a1bfa6682c4d9f14cc7aec9a3ba4e Mon Sep 17 00:00:00 2001 From: Aryan Bhasin Date: Wed, 27 Nov 2024 15:13:50 -0300 Subject: [PATCH] allow contractAddress as an opt when initializing sleuth --- cli/sleuth.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cli/sleuth.ts b/cli/sleuth.ts index d3c4eff..5d63512 100644 --- a/cli/sleuth.ts +++ b/cli/sleuth.ts @@ -7,7 +7,8 @@ import { parse } from '../parser/pkg/parser'; interface Opts { network?: string, - version?: number + version?: number, + contractAddress?: string }; const defaultOpts = { @@ -90,7 +91,7 @@ export class Sleuth { this.provider = provider; this.network = opts.network ?? defaultOpts.network; this.version = opts.version ?? defaultOpts.version; - this.sleuthAddr = getContractAddress({ from: sleuthDeployer, nonce: this.version - 1 }); + this.sleuthAddr = opts.contractAddress ?? getContractAddress({ from: sleuthDeployer, nonce: this.version - 1 }); this.sources = []; this.coder = new AbiCoder(); }