0

I'm currently trying to figure out which packages to use and how to structure/conceptualize the code flow for the following context:

I have a custom React UI that I am planning to have in order to do read/transfer tasks to the Gnosis Safe. One can either deploy the safe straight from this UI, or connect an existing safe. There are 3 main pieces of functionality:

  1. Reading the vault information (assets present, owners, etc.) and displaying to user
  2. Initiating transfers manually
  3. Initiating transfers from some event

I'm assuming that I want to utilize the IAvatar interface and Module.sol when coming up with the contract. Will probably want to create Module Factory and a Safe Factory in the case that we want to deploy right from there. My specific questions:

  1. Am I creating both the IAvatar and Module contracts myself, or am I creating a Module and interacting with an external contract that implements it, or something else?

  2. In displaying data for the user in the UI, should I utilize safe-core-sdk/ethers multisend for the "read" tasks while the contract code handles the "write" tasks? Or is that not the right thinking here?

In general, my main question would be how would one go about structuring this in the best way using the tools available? What would be the code flow there? I'm thinking safe-core-sdk be used to deploy safe from UI, and then the sdk enables a custom module here? Or would the deployment of a safe all be handled on the Zodiac/smart contract side? Would there be a way to where I wouldn't even have to deploy a module?

Relevant links:

Safe Ethers Adapter

Safe Core SDK

Zodiac IAvatar interface

1 Answer 1

1

The 3 main pieces of functionality can be done using the Safe Core SDK and the Safe Service Client, following this guide. The Safe Core SDK allows to get some data of a Safe directly from the blockchain, to execute transactions and to deploy new Safes. The Safe Service Client is used to comunicate with the Transaction Service to collect the signatures from the owners and to access all the data (hisotric and pending transactions, current transaction confirmations, etc.) showed in the Web UI.

Answering to your second question, these SDKs allow to read and write data to you Gnosis Safe contract, so they are a good solution to implement in your front-end in case you want to interact with it programatically.

Regarding your first question, as long as you have your module address and are able to encode the transaction you want to send to it, it can be executed by the Safe Core SDK, but you need to handle the encoding by yourself.

You are right when you say that the SDK can deploy a new Safe and enable an existing module, however, the deployment of the module (if it's a new one) is not handled by the SDK.

If you are still having questions regarding Zodiac, I recommend you joining their Discord channel and ask more specific questions there.

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.