Team
Last updated
Last updated
Inherits: Initializable, ContextUpgradeable, StateAware, Patchable, Safe, ITeam
Author: Daniel Yamagata & Jerry Qi & Naveen Ailawadi
A base contract that coordinates a group of people making decisions, such as a Treasury or Department. Teams directly inherit from Safe, making them capable of executing arbitrary transactions given the proper authorization by its signers.
Safe does not implement upgrade-friendly storage. Therefore, it is of utter importance that all upgradeable contracts that inherit from 'Team' use ERC7201 namespaced storage to prevent potential storage collisions. Some may be curious why we are not creating a '$' var when accessing ERC7201 storage. This is because Safe and the other dependencies used take up an enormous amount of contract size. Therefore, we are heavily optimizing for contract size rather than readability or gas efficiency
Reverts if the caller is not a child
Reverts if the caller is not a child or 'this'
Initializes the Safe's state and sets the guard
Parameters
_owners
address[]
The initial signers/owners
_threshhold
uint256
The initial threshold
initGuard
address
The guard to set
A function to execute multiple tranctions atomically via the Team's Safe fuctionality.
The 'target' of the call is 'this' but the function selector of each 'transaction' must be 'execTransaction' The function, itself, is not pausable or freezable. However, 'execTransaction' is freezable, meaning this function will revert if the protocol state is frozen or if the implementation is frozen.
Parameters
transactions
bytes[]
Returns
<none>
bool[]
An array of booleans that indicate whether or not each transaction was successful Each element of the array should be 'true', since any call to this function will revert if any of the transactions fail
Same as safe's execTransaction, except uses the 'freezable' modifier
Safe modules have been disabled, since they could arbitrarily change the signers of a team
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
owners
bytes4
params
bytes
The abi-encoded parameters to pass to the function
A function to swap the guard of a team contract.
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
Removes 'childToRemove' from the '_children' set. Will revert if 'childToRemove' is not in the '_children' set
Returns all children as an address array
Returns the 'solvency' of this as defined by the DataTypes.Solvency enum
Returns the parent of 'this'. If 'this' is a department or module, returns the team that directly controls 'this'. If 'this' is the Treasury, returns the sentinel parent, which is address(0x1)
Returns
<none>
address
The parent, which is either the treasury, a department, a module, or the sentinel parent
Returns the name of 'this', which is a string
Reverts if the company state is not solvent
Returns true if the caller is a 'child'
Reverts if the caller is not a 'child' of 'this'
Reverts if the caller is not 'this' or a 'child' of 'this'
Reverts if the company state is not liquidating
ERC165 support
Overridden 'upgradeToAndCall' from UUPSUpgradeable Validates that the 'data' is not to manage the owners and threshold, set the guard, or enable modules '_authorizeUpgrade()' has been overridden in MezzUUPSUpgradeable such that this can only be called by the Mezz Migrator
Overridden '_authorizePatch' from Patchable. Validates 'data' is not used to manage the owners, threshold,
Overridden '_authorizePatch' from Patchable. Validates 'data' is not used to manage the owners, threshold, set the guard, or enable modules
The transactions to execute. Each transaction must be an encoded version of 'execTransaction'. . If any other function selector is passed, the transaction will revert. It should be noted that the operation type of the transaction must be a call, since delegate calls have been disabled via Mezz Guards On a frontend, '0' must be passed to indicate a 'Call'. .
.