1

I Everyone !

I'm currently trying to deploy a safe using hardhat and Safe Protocol Kit SDK

Basically what I did was:

  • Cloning the Smart contracts repo => Deploy them on hardhat local node
  • Using the playground/protocol-kit/deploy-safe.ts

I changed the parameters to link the SafeFactory.create to my local node using that configuration

    const contractNetworks: ContractNetworksConfig = {
    ['31337']: {
      safeSingletonAddress: '0xC0bF47e15F557dB6f9B0e4997B27C7CDd24fB3fF',
      safeProxyFactoryAddress: '0x7Ec60b29C1c201C7F1C97C42e3edbA3E8f905360',
      multiSendAddress: '0xa552810048f47Fd6B27D56e15F4e3eD2eF3c5882',
      multiSendCallOnlyAddress: '0xD205976DE203ecebBEfC388c1b058c77B9344A0e',
      fallbackHandlerAddress: '0xf02dfD5568bC2149b6b5a119eEdBd76b100C3E82',
      signMessageLibAddress: '0xF247a2e2F0F124303dE37f75db8E0F5bA79D54eB',
      createCallAddress: '0xB22D635D552eC95142E2Abe3FfB859eA7d7C0316',
      simulateTxAccessorAddress: '0x38710E559A67ef07bcF8EeA70B076ac8e756DE08'
    }
  }
  const safeFactory = await SafeFactory.create({ ethAdapter, contractNetworks })

The addresses here are of courses the ones that the

npm run deploy-all custom

generated

Until here, everything seems fine but during the

 const safe = await safeFactory.deploySafe({
    safeAccountConfig,
    callback
  })

I correctly get the Predicted deployed Safe address and the Tx but after that the transaction revert due to a

Error: SafeProxy was not deployed correctly

This error comes from SafeProxyFactoryEthersContract: line 62 and I can't know why this crash.

Is there a full documentation or tutorial explaining how to correctly locally deploy the safe contracts and create a safe using the SDK ?

Thanks a lot in advance :)

1 Answer 1

0

to use the SDK locally, you will first need to configure the Safe Transaction Service for your own network. To run the Safe Transaction Service locally, you can follow this guide.

Let me know if it solved the problem! Best, Louis

4
  • is this also needed for a simple test case to check if my new smart contracts are interoperable with safe wallet? i would love to test the ERC-1271 integration and precise message formats with it. Commented May 27 at 17:05
  • If you want to use your own custom network then yes; otherwise it should not be necessary 👍 Commented May 28 at 14:29
  • i do prefer to use the built-in ad hoc hardhat network for that. does that count as "my own custom network" ? Commented May 29 at 0:15
  • Yes it does! :) Commented May 29 at 8:32

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.