"Currently, the forwarder is mainly designed to pass isolated actions where the forwarder has little to no knowledge of the forwarded action. We will research potential ways to expand its usability by creating additional specifications for script execution. This will allow for more tightly coupled forwarder interactions where the forwarded call data can actually be leveraged and modified within the Forwarder contract."
The Dynamic forwarder interaction will require both helpers and a different contract for script execution. Since the current IEVMScriptExecutor.sol is already defined in AragonOS we should respect the current function - execScript(bytes script, bytes input, address[] blacklist) external returns (bytes) so we'll need to defined a DynamicCallScript contract with an unclaimed specID and EXECUTOR_TYPE = keccak256("DYNAMIC_CALLS_SCRIPT"). We will leverage the bytes input to pass in the modified data. We also need to create a DynamicForwarder contract to inherit from in order to create a struct we can have consistent and direct access to in our helper functions. In order to provide a smoother developer experience we need to add two main helpers to DynamicForwarder, one to parse data (parseScript(bytes script) internal pure returns(actionID) and one to convert the internal data back to bytes (encodeInput(uint256 actionID) internal pure) This way contracts can modify the struct provided for them through DynamicForwarder in place, and then just pass a reference to the helpers in order to parse the data from the initial call script into that struct, and compose the input data for execution from that struct.
These helpers should allow the code to follow a similar flow to what we're doing in the _executeVote function in dot voting. We'll likely need helpers similar to addDynamicElements addAddressesAndVotes _goToParamOffset addInfoString and addExternalIds with modifications to each to accommodate the difference in struct.
Take all the basic helpers that exist in dot voting and move them here, define the function signatures and the data structure. If any helpers make sense in the ScriptHelpers.sol file put them there, but if something has minimal re-use potential keep it in this contract.
Leverage the internal helpers in order to translate an action id (that maps into a specific ActionInformation struct) into a raw bytes object to pass into the executor as input
Translate the initial new vote flow, and the candidate extraction from dot-voting into a generalized function that will add all "candidate" information and dynamic parameters into the DynamicForwarderActionInformation struct. This should leverage the DynamicForwarder's internal helper functions.