Department
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.
State Variables
DepartmentStorageLocation
Functions
_getDepartmentStorage
constructor
onlyAncestor
onlyAncestorOrAuthorized
The msg.sender must be 'this' or an ancestor
init
Standardized init function that all departments must inherit
Parameters
__Department_init
Sets the initial state for a department and validates inputs
manageOwners
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
swapGuard
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
insertChild
Inserts 'childToInsert' to the '_children' set. 'childToInsert' must support the module or department interface. Will revert if 'childToInsert' is already in the '_children' set
spend
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
getParent
Returns
treasury
Returns the treasury as an ITreasury interface
name
Returns the name of 'this', which is a string
supportsInterface
ERC165 support
_validateCallerIsAncestor
Reverts if the caller is not an ancestor
_validateCallerIsTeamOrAncestor
Reverts if the caller is not an ancestor or address(this)
upgradeToNewerVersion
Upgrades 'this' to a newer version via the MezzMigrator
Only callable by 'this' or an ancestor
_authorizePatch
Access control for 'resetToPatchedLatestVersion()'. Validation of 'data' is completd in Team.sol
Structs
DepartmentStorage
Last updated