Skip to content

Commit

Permalink
merge error fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
anshulforyou committed Nov 20, 2023
1 parent 88798ad commit 06ea3d9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 39 deletions.
2 changes: 2 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ src
.prettierrc
tests
.github
jest.config.*
```
40 changes: 1 addition & 39 deletions src/providers/Safe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,43 +81,5 @@ class Safe {
}
return true;
}

async deploySafeSCW(): Promise<boolean> {
// Create a SafeFactory instance using the EthersAdapter
const safeFactory = await SafeFactory.create({
ethAdapter: this.ethAdapter,
});
const config = {
owners: [await this.signer.getAddress()],
threshold: 1,
};

const callback = (txHash: string): void => {
Logger.log('txHash ', txHash);
Logger.log('Safe Deployed Sucessfully');
};
try {
await safeFactory.deploySafe({
saltNonce: this.saltNonce.toString(),
safeAccountConfig: config,
callback,
});
} catch (error: any) {
if (
error instanceof Error &&
error.message.includes('execution reverted: Create2 call failed')
) {
// Handle the specific error message here
Logger.log('Safe is already deployed');
// Perform specific actions or additional logging based on this error
return true;
} else {
// Handle other errors if needed
Logger.error('An error occurred while deploying safe', error);
return false;
}
}
return true;
}
}
export default Safe;
export default Safe;

0 comments on commit 06ea3d9

Please sign in to comment.