1

I am developing a Safe Module and would like to use Hardhat to test it. However, I have been so far unable to deploy a Safe using Hardhat. Does anyone have experience doing this? Even when I set my chainId to a chain I know SafeFactory exists for, I experience the error of Invalid Safeproxyfactory Address.

1 Answer 1

2

We run some Safe tests using Hardhat Network in our project. Here is the example: safe.spec.ts#L212

You have to deploy 3 contracts:

  • GnosisSafeProxyFactory.sol
  • GnosisSafe.sol
  • MultiSend.sol

Then you provide the addresses and the ABIs for Hardhat chainId to gnosis SDK

import { SafeFactory } from '@gnosis.pm/safe-core-sdk'

// Initialize the Adapter and provide the deployed contract infos

const safeFactory = await SafeFactory.create({
    ethAdapter,
    contractNetworks: {
        [client.chainId + '']: {
            multiSendAddress: multiSendContract.address,
            multiSendAbi: multiSendAbi,

            safeMasterCopyAddress: safeContract.address,
            safeMasterCopyAbi: safeAbi,

            safeProxyFactoryAbi: proxyFactoryAbi,
            safeProxyFactoryAddress: proxyFactoryContract.address
        }
    }
});

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.