relative beginner to both Solidity and Gnosis here, so please bear with me :)

I have the following contract:

contract MyCustomWallet is GnosisSafe {
    using GnosisSafeMath for uint256;
    constructor(...args) {
         ... set up GnosisSafe
         ... deploy and add several modules and guards

In an ideal world, I would like the contract to be shown in the Gnosis UI and a custom UI that I'm making.

What would be the best way to go about deploying something like this? Would it be through a GnosisSafeProxyFactory?

1 Answer 1


If the goal is to deploy a Safe with custom modules and guards, you don't necessarily need a separate contract to do that. When deploying a Safe, there's a distinct initializer parameter to setup modules during the creation:


With the guard, it's a little more complicated because it's not possible to set up one at the creation time, but you can trigger a separate transaction after the creation or create a custom factory contract.

It is not possible to extend the singleton contract (contract that holds the logic for the Safe) and keep the UI compatibility because it will result in different singleton, and we currently only index Safes that are using singleton contracts by the Safe project

  • you can use the initializer also to add a guard
    – Richard
    Commented Jan 27, 2022 at 11:16
  • Thanks for the info! Just a few more questions from my end:
    – David Lee
    Commented Jan 28, 2022 at 15:43
  • Hi @Richard! How would you use the initializer to add a guard? addGuard can be called only from a GnosisSafe instance itself, which means we need to add its own address and delegatecall data to the initializer data. The address needs to be predicted and included into the data affecting the address generation. Is that possible?
    – Utgarda
    Commented Oct 16, 2023 at 9:09

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.