ExternalAction_OnReturnValue
ExternalAction_OnReturnValue is an executive mandate that chains a previous action’s output into a cross-contract governance request. It retrieves the return data from a parent mandate’s execution and uses it as part of the calldata sent to an external Powers instance.
Overview
Section titled “Overview”This mandate combines the chaining behaviour of BespokeAction_OnReturnValue with the cross-contract routing of ExternalAction_Flexible. The target Powers address and mandate ID are provided at execution time, while the return data from a previously executed mandate is sandwiched between two static parameter blocks and forwarded as the calldata.
Configuration
Section titled “Configuration”When adopting an ExternalAction_OnReturnValue instance, the following parameters are required:
paramsBefore(bytes): Encoded data to place before the parent mandate’s return value in the forwarded calldata.Params(string[]): UI hints for any additional parameters the user provides at execution time (beyondPowersTargetandMandateIdTarget).parentMandateId(uint16): The ID of the mandate whose return data will be retrieved and forwarded.paramsAfter(bytes): Encoded data to place after the parent mandate’s return value in the forwarded calldata.
Proposing an Action
Section titled “Proposing an Action”When calling the mandate, the following inputs must be provided:
PowersTarget(address): The address of the external Powers contract to submit the request to.MandateIdTarget(uint16): The mandate ID on the target Powers contract.- Additional parameters as defined in
Params.
Execution Flow
Section titled “Execution Flow”-
Return Data Retrieval
- Recomputes the parent action ID using
parentMandateId, the currentmandateCalldata, andnonce. - Retrieves the return data from that action stored on the local Powers contract.
- Recomputes the parent action ID using
-
Calldata Assembly
- Concatenates:
paramsBefore + returnData + paramsAfter.
- Concatenates:
-
Request Submission
- Encodes a call to
IPowers.request(mandateIdTarget, assembledCalldata, nonce, "")and submits it toPowersTarget.
- Encodes a call to
Technical Specifications
Section titled “Technical Specifications”Functions
Section titled “Functions”initializeMandate
Section titled “initializeMandate”function initializeMandate(...) public override- Stores the static parameter blocks and parent mandate ID.
- Sets input parameters to
[address PowersTarget, uint16 MandateIdTarget]prepended to the configuredParams.
handleRequest
Section titled “handleRequest”function handleRequest(...) public view virtual override returns (...)- Retrieves the parent action’s return data.
- Assembles and returns the cross-contract request call.
Error Conditions
Section titled “Error Conditions”This mandate has no explicit error conditions. If the parent action has no return data or the target contract rejects the request, the transaction will fail at the external call level.
Current Deployments
Section titled “Current Deployments”| Chain ID | Chain Name | Address |
|---|---|---|