gnosisguild / zodiac-module-reality

A Zodiac module that uses Reality.eth as an oracle for triggering execution on a Safe.
GNU Lesser General Public License v3.0
101 stars 52 forks source link

Deterministic setup with template #71

Closed asgeir-s closed 1 year ago

asgeir-s commented 2 years ago

Deterministic Deployment Helper functions Related to https://github.com/gnosis/zodiac-safe-app/issues/94. This contract contains helper functions that can be used to deploy the RealityModule to a deterministic address even though the template ID is unknown at the deployment time.

The contracts consist of multiple deployment and configuration functions that each have their pros and cons. The reason to provide multiple alternatives is that different circumstances will favor different versions.


Usage of the createTemplate function via delegatecall: In this scenario, we deploy the module as normal (just set the templateId to 0). Then create a subsequent delegated call from the safe to createTemplate function. This will create a new template and set the new templateId in one transaction. Kind of like createTemplateAndChangeOwner but without the need to change the owner (the safe will already be the owner) and call via delegated call: Pros:

Cons:

Usage of the createTemplateAndChangeOwner function directly: Pros:

Cons:

Usage of the deployWithEncodedParams function directly: Pros:

Cons:

Usage of the deployWithTemplate function directly: Pros:

Cons:

github-actions[bot] commented 2 years ago

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

asgeir-s commented 2 years ago

I have read the CLA Document and I hereby sign the CLA

coveralls commented 2 years ago

Pull Request Test Coverage Report for Build 3060447398


Totals Coverage Status
Change from base Build 2963537893: 0.0%
Covered Lines: 107
Relevant Lines: 107

💛 - Coveralls