Use forwarders to allow app interoperability and governance.
How does it work?
The ACL allows Aragon apps to be interoperable by creating and managing permissions.
A Forwarder is a contract that, given some conditions, will pass along a certain action to other contract(s).
Example
A Token Manager app may send an action to the Voting app so if a vote passes the Voting app can withdraw funds from the Finance app.
This is possible thanks to Forwarders.
Below is an extract of our Voting app and is all the code required to make it a Forwarder:
pragmasolidity0.4.24;import"@aragon/os/contracts/apps/AragonApp.sol";import"@aragon/os/contracts/common/IForwarder.sol";contractVotingisIForwarder, AragonApp{/** * @notice Creates a vote to execute the desired action, and casts a support vote * @dev IForwarder interface conformance * @param_evmScript Start vote with script */functionforward(bytes_evmScript)public{require(canForward(msg.sender, _evmScript));_newVote(_evmScript,"",true);}functioncanForward(address_sender,bytes_evmCallScript)publicviewreturns(bool){returncanPerform(_sender, CREATE_VOTES_ROLE,arr());}functionisForwarder()publicpurereturns(bool){returntrue;}}
canForward checks if a caller canPerform the action CREATE_VOTES_ROLE. If it can, it means the caller can create a vote.
forward checks if a caller canForward, and if it can, it creates a new vote with an _evmScript.
This _evmScript is the action that will be executed if the voting passes, which can be withdrawing some funds from a Finance app, for example, but it can be any other action. The action is abstracted and doesn't need to be known in advance.