Skip to content

Commit

Permalink
Merge pull request #7 from compound-finance/aryan/allow-contract-addr…
Browse files Browse the repository at this point in the history
…ess-opts-constructor

allow `contractAddress` as an opt when initializing sleuth
  • Loading branch information
hayesgm authored Nov 27, 2024
2 parents 5401e91 + dc88d09 commit 0d329a0
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 0d329a0

Please sign in to comment.