Error while deploying Gnosis Safe


I’m working on adding support for Harmony to OpenZeppelin Defender and we require a deterministic deployment for the Gnosis Safe contracts, so I’m running the official safe-deployments tool but I’m facing a weird error related to how hardhat is crafting the transaction for the contract deployer.

This is the output I’m receiving:

sending eth to create2 contract deployer address (0x3fab184622dc19b6109349b94811493bf2a45362) (tx: 0x36b6642fd596266c66a59afd52954ad5bd8e8e12e2037ee36075b5ddd395d839)...
deploying create2 deployer contract (at 0x4e59b44847b379578588920ca78fbf26c0b4956c) using deterministic deployment ( unexpected error occurred:

Error: ERROR processing /Users/ernestognw/Documents/safe-contracts/src/deploy/deploy_accessors.ts:
ProviderError: blockchain chain id:2, given 0: invalid chain id for signer
    at HttpProvider.request (/Users/ernestognw/Documents/safe-contracts/node_modules/hardhat/src/internal/core/providers/http.ts:46:19)
    at LocalAccountsProvider.request (/Users/ernestognw/Documents/safe-contracts/node_modules/hardhat/src/internal/core/providers/accounts.ts:142:34)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at DeploymentsManager.executeDeployScripts (/Users/ernestognw/Documents/safe-contracts/node_modules/hardhat-deploy/src/DeploymentsManager.ts:1011:17)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
error Command failed with exit code 1.
info Visit for documentation about this command.

I did my research and this is leading me to this line in your core repo.
I’m not exactly following what’s happening but it’s an issue with the node chainId. The configuration I’m using works perfectly with any other chain.

btw, this happens with every endpoint listed on your API Docs, both for testnet and mainnet.

I’d appreciate any clue :slight_smile:

1 Like

We have the hypothesis that it’s because the deterministic-deployment-proxy is using a single-use address to create the same deployer address, which needs to replay a transaction for all the networks where the gnosis contracts are being deployed.

The error might be because the Harmony core node is enforcing EIP-155. If that’s the case, I’d love to confirm :slight_smile:

1 Like

Indeed it was EIP-155 enforcing.

Here are the docs on how to workaround this problem

This can be closed