Skip to content

Commit

Permalink
allow contractAddress as an opt when initializing sleuth
Browse files Browse the repository at this point in the history
  • Loading branch information
aryanbhasin committed Nov 27, 2024
1 parent 5401e91 commit dc88d09
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cli/sleuth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import { parse } from '../parser/pkg/parser';

interface Opts {
network?: string,
version?: number
version?: number,
contractAddress?: string
};

const defaultOpts = {
Expand Down Expand Up @@ -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();
}
Expand Down

0 comments on commit dc88d09

Please sign in to comment.