Last updated
Last updated
Inherits: Team, IDepartment
Author: Daniel Yamagata & Jerry Qi & Naveen Ailawadi
A multi-signature wallet whose signers are determined by its ancestors. A department can transfer funds recursively from the treasury to themselves, given there is sufficient approvals and balances. An ancestor is a department or the treasury, which is higher in the organizational hierarchy than 'this'. Unlike the traditional definition, an 'ancestor' does not include 'this', itself.
The msg.sender must be 'this' or an ancestor
Standardized init function that all departments must inherit
Parameters
Sets the initial state for a department and validates inputs
A function to manage the signers of a Gnosis Safe.
Makes external, authorized calls on address(this) that are normally blocked by Mezz Guards. This function is overridden and access-controlled such that the caller must be a Treasury's governor or a department's ancestor Refer to Constants.sol for the given function selectors that can be used as an 'action'
Parameters
A function to swap the guard of a team contract. Deploys and initializes the guard via the Mezz Deployer.
Makes external, authorized calls on address(this) that are normally blocked by Mezz Guards. This function is overridden and access-controlled such that the caller must be a Treasury's governor or a department's ancestor
Inserts 'childToInsert' to the '_children' set. 'childToInsert' must support the module or department interface. Will revert if 'childToInsert' is already in the '_children' set
Recursively transfers an 'amount' of 'asset' from the treasury to the caller, who must be a descendant of the treasury Will revert if the treasury has insufficient funds or the ancestors of 'this' have insufficient approvals
Returns
Returns the treasury as an ITreasury interface
Returns the name of 'this', which is a string
ERC165 support
Reverts if the caller is not an ancestor
Reverts if the caller is not an ancestor or address(this)
Upgrades 'this' to a newer version via the MezzMigrator
Only callable by 'this' or an ancestor
Access control for 'resetToPatchedLatestVersion()'. Validation of 'data' is completd in Team.sol
initTreasury
address
The address of the treasury
_owners
address[]
The initial signers of the department's multisig
_threshhold
uint256
The initial threshold of the department's multisig
initGuard
address
The address of the guard contract, which should be deployed atomically with the department
initParent
address
The address of the department's parent
params
bytes
Any additional parameters that the department needs to initialize
functionSelector
bytes4
params
bytes
The abi-encoded parameters to pass to the function
<none>
address
The parent, which is either the treasury, a department, a module, or the sentinel parent