Skip to content

Commit

Permalink
change local address resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
icyfry committed May 12, 2024
1 parent eeda128 commit 402ce67
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions dapp/src/utils/web3utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,30 @@ export class Web3Utils {
public fundmeContract!: Contract<any>;

async getCryptozombiesBroadcastLocal(): Promise<any> {
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<any> {
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;
}

Expand Down Expand Up @@ -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);
});
Expand Down

0 comments on commit 402ce67

Please sign in to comment.