BespokeAction_Advanced
BespokeAction_Advanced is an executive mandate that enables the execution of a custom function call on a target contract, allowing for complex parameter composition.
Overview
Section titled “Overview”This mandate is designed for situations where a function call requires a mix of static parameters (pre-defined at deployment) and dynamic parameters (provided by the user at execution time). It allows you to “sandwich” the user’s input between two blocks of static data.
Configuration
Section titled “Configuration”When adopting a BespokeAction_Advanced instance, the following parameters are required:
TargetContract(address): The address of the contract to call.TargetFunction(bytes4): The function selector (first 4 bytes of the hash) of the function to call.staticParamsBefore(bytes): Encoded data to place before the user’s input.dynamicParams(string[]): UI hints describing the dynamic parameters the user should provide.staticParamsAfter(bytes): Encoded data to place after the user’s input.
Proposing an Action
Section titled “Proposing an Action”When calling the mandate, the input (provided as mandateCalldata) represents the dynamic parameters.
Execution Flow
Section titled “Execution Flow”-
Parameter Assembly
- The mandate concatenates the components in this order:
TargetFunction(Selector)staticParamsBeforemandateCalldata(User input)staticParamsAfter
- The mandate concatenates the components in this order:
-
Execution
- Calls the
TargetContractwith the assembled data.
- Calls the
Technical Specifications
Section titled “Technical Specifications”Functions
Section titled “Functions”initializeMandate
Section titled “initializeMandate”function initializeMandate(...) public override- Initializes the contract, selector, and parameter blocks.
- Sets input parameters to the provided
dynamicParams.
handleRequest
Section titled “handleRequest”function handleRequest(...) public view override returns (...)- Performs the concatenation:
abi.encodePacked(targetFunction, staticParamsBefore, mandateCalldata, staticParamsAfter).
Current Deployments
Section titled “Current Deployments”| Chain ID | Chain Name | Address |
|---|---|---|