Transaction Unwrapping
In certain scenarios the raw transaction data might not lend itself to be checked against the configured role permissions directly. An example are batch transactions through the MultiSend contract. Instead of scoping the data encoding the full batch of transactions, permissions should rather we checked individually for each call in the batch.
Transaction unwrapping can be configured as pre-processing step to be applied for specific target addresses. The unwrapping logic is implemented in adapter contracts.
MultiSendUnwrapper
The MultiSendUnwrapper
adapter contract at the official deployment address 0x93B7fCbc63ED8a3a24B59e1C3e6649D50B7427c0
can be used to support unwrapping of batch transaction through the MultiSend contract.
To enable multi-send unwrapping call the setTransactionUnwrapper
function as the owner of the Roles mod:
rolesMod.setTransactionUnwrapper(
address(TODO)), // offical MultiSendCallOnly deployment on mainnet
bytes4(keccak256('multiSend(bytes)'), // multiSend function selectot
address(0x93B7fCbc63ED8a3a24B59e1C3e6649D50B7427c0) // address of the MultiSendUnwrapper
)
Addresses of the official MultiSend deployments on all chains are listed at: [TODO]
Custom unwrappers
Custom transaction unwrapping logic can be implemented as contracts conforming to the ITransactionUnwrapper
interface.
interface ITransactionUnwrapper {
function unwrap(
address to,
uint256 value,
bytes calldata data,
Enum.Operation operation
) external view returns (UnwrappedTransaction[] memory result);
}