From 402ce67064c66faa6667bed6148e1a7f430e270f Mon Sep 17 00:00:00 2001 From: Jonathan Le Brun <42697488+icyfry@users.noreply.github.com> Date: Sun, 12 May 2024 19:52:14 +0200 Subject: [PATCH] change local address resolution --- dapp/src/utils/web3utils.ts | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/dapp/src/utils/web3utils.ts b/dapp/src/utils/web3utils.ts index 4ad2c0f..d9ae3ef 100644 --- a/dapp/src/utils/web3utils.ts +++ b/dapp/src/utils/web3utils.ts @@ -21,14 +21,30 @@ export class Web3Utils { public fundmeContract!: Contract; async getCryptozombiesBroadcastLocal(): Promise { + console.log(process.env.NODE_ENV); if (process.env.NODE_ENV !== 'development') throw new Error("Not in development mode"); - cryptozombiesBroadcastLocal = await import('../../../contracts/broadcast/DeployZombieOwnership.s.sol/31337/run-latest.json'); + cryptozombiesBroadcastLocal = { + transactions: [ + { + "contractName": "ZombieOwnership", + "contractAddress": "" + } + ] + }; + return fundmeBroadcastLocal; return cryptozombiesBroadcastLocal; } async getFundmeBroadcastLocal(): Promise { if (process.env.NODE_ENV !== 'development') throw new Error("Not in development mode"); - fundmeBroadcastLocal = await import('../../../contracts/broadcast/DeployFundMe.s.sol/31337/run-latest.json'); + fundmeBroadcastLocal = { + transactions: [ + { + "contractName": "FundMe", + "contractAddress": "" + } + ] + }; return fundmeBroadcastLocal; } @@ -86,7 +102,7 @@ export class Web3Utils { this.ethereum.request({ method: 'eth_requestAccounts' }); this.web3js = new Web3(this.ethereum); - this.web3js.eth.getAccounts().then((accounts) => { + this.web3js.eth.getAccounts().then((accounts: any[]) => { this.account = this.web3js.utils.toChecksumAddress(accounts[0]); console.log("Account: " + this.account); });