1

Is there documentation anywhere on how to create a gnosis safe programmatically with detailed information on how to construct parameters?

Here's what I tried in Remix (which i know is the incorrect approach):

  1. Compiled+Deployed GnosisSafe.sol
  2. Called the setup function with the following parameters:
["0xAb8483F64d9C6d1EcF9b849Ae677dD3315835cb2", "0x4B20993Bc481177ec7E8f571ceCaE8A9e22C02db"],1,0x0000000000000000000000000000000000000000,"0x",0x0000000000000000000000000000000000000000,0x0000000000000000000000000000000000000000,0x0000000000000000000000000000000000000000,0x0000000000000000000000000000000000000000

The error that I got:

The transaction has been reverted to the initial state.
Reason provided by the contract: "GS200".

So this fails because the contract threshold is set to 1 when I deploy GnosisSafe.sol. I think it's because I'm supposed to use createProxyWithNonce in GnosisSafeProxyFactory.sol to create a new safe.

But I'm not sure which contracts to deploy, and how to construct the parameters it expects (_singleton, initializer, saltNonce).

Help here would be greatly appreciated! 🙏

1 Answer 1

2

You don’t need to deploy GnosisSafe.sol or proxy factory. There are already singletons deployed. You can check the addresses here: https://github.com/safe-global/safe-deployments/tree/main/src/assets/v1.3.0

You can check unit tests here: https://github.com/safe-global/safe-contracts/blob/v1.3.0/test/factory/ProxyFactory.spec.ts https://github.com/safe-global/safe-contracts/blob/v1.3.0/test/core/GnosisSafe.Setup.spec.ts

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.