I have been using this code to create Gnosis safe programmatically:
const ethAdapter = new EthersAdapter({ethers, signerOrProvider: signerWallet}); //3
const safeFactory = await SafeFactory.create({ ethAdapter }); //4
const safeSdk: Safe = await safeFactory.deploySafe({ safeAccountConfig: { threshold: 2, owners: ['0x...', '0x...', '0x..'] }});
But today, in a few attempts to create Gnosis Safes on Goerli, I got this error:
cannot estimate gas; transaction may fail or may require manual gas limit [ See: https://links.ethers.org/v5-errors-UNPREDICTABLE_GAS_LIMIT ] (reason="execution reverted: Create2 call failed", method="estimateGas", transaction={"from":"0x12A244d6137dFE45B85F92185C524340D8CdD60f","to":"0xa6B71E26C5e0845f74c812102Ca7114b6a896AB2","data":"0x1688f0b90000000000000000000000003e5c63644e683549055b9be8653de26e0b4cd36e0000000000000000000000000000000000000000000000000000000000000060b1073742015cbcf5a3a4d9d1ae33ecf619439710b89475f92e2abd2117e90f900000000000000000000000000000000000000000000000000000000000000164b63e800d0000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000140000000000000000000000000f48f2b2d2a534e402487b3ee7c18c33aec0fe5e4000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000012a244d6137dfe45b85f92185c524340d8cdd60f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","accessList":null}, error={"code":-32603,"message":"execution reverted: Create2 call failed","data":{"originalError":{"code":3,"data":"0x08c379a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000013437265617465322063616c6c206661696c656400000000000000000000000000","message":"execution reverted: Create2 call failed"}},"docUrl":"https://docs.cloud.coinbase.com/wallet-sdk/docs/errors?version=3.7.0&code=-32603&method=eth_estimateGas&message=execution+reverted%3A+Create2+call+failed"}, code=UNPREDICTABLE_GAS_LIMIT, version=providers/5.7.2)
I double checked to make sure there is fund in my wallet. Any pointer toward how I may solve/debug this issue will be much appreciated.