PowersFactory_AddSafeDelegate
PowersFactory_AddSafeDelegate is a factory integration mandate that adds a delegate to a Gnosis Safe via the Allowance Module, using the result of a parent action.
Overview
Section titled “Overview”This mandate serves as a bridge between a “Factory” mandate (which produces a result, such as a newly deployed contract or a selected address) and a Safe’s Allowance Module. It allows an organization to automatically appoint a delegate based on the outcome of a previous action.
Specifically, it:
- Verifies the successful execution of a parent action.
- Retrieves the return data (an address) from that parent action.
- Adds that address as a delegate in the Safe’s Allowance Module.
Configuration
Section titled “Configuration”When adopting a PowersFactory_AddSafeDelegate instance, the following parameters are required:
factoryMandateId(uint16): The ID of the parent mandate that generates the delegate address.allowanceModule(address): The address of the Gnosis Safe Allowance Module.inputParams(string[]): The description of input parameters required by the parent mandate (used to compute the parent’s Action ID).
Proposing an Action
Section titled “Proposing an Action”When calling the mandate, the inputs provided must match the inputs expected by the parent factoryMandateId. These inputs are used to re-compute the parent’s Action ID to look up its result.
Execution Flow
Section titled “Execution Flow”-
Parent Validation
- Computes the
parentActionIdusing the provided calldata. - Verifies that the parent action state is
Fulfilled. - Retrieves the return data from the parent action.
- Computes the
-
Delegate Extraction
- Decodes the return data to obtain the
decodedAddress(the new delegate).
- Decodes the return data to obtain the
-
Safe Interaction
- Identifies the Safe Treasury address from the Powers contract.
- Constructs a signature (
v=1) authorizing the transaction as the Powers contract (owner). - Generates a call to
Safe.execTransaction. - The Safe executes a call to
allowanceModule.addDelegate(decodedAddress).
Technical Specifications
Section titled “Technical Specifications”Functions
Section titled “Functions”initializeMandate
Section titled “initializeMandate”function initializeMandate(...) public override- Initializes the mandate configuration.
- Sets the input parameter descriptions to match those provided in the configuration.
handleRequest
Section titled “handleRequest”function handleRequest(...) public view override returns (...)- Validates parent action fulfillment.
- Decodes the new delegate address.
- Constructs the Safe transaction to add the delegate.
Current Deployments
Section titled “Current Deployments”| Chain ID | Chain Name | Address |
|---|---|---|