Team
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
State Variables
TeamStorageLocation
Functions
_getTeamStorage
constructor
onlyChild
Reverts if the caller is not a child
onlyChildOrThis
Reverts if the caller is not a child or 'this'
__Team_init
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
execMultipleTransactions
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
execTransaction
Same as safe's execTransaction, except uses the 'freezable' modifier
execTransactionFromModule
Safe modules have been disabled, since they could arbitrarily change the signers of a team
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
owners
bytes4
params
bytes
The abi-encoded parameters to pass to the function
swapGuard
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
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
removeChild
Removes 'childToRemove' from the '_children' set. Will revert if 'childToRemove' is not in the '_children' set
getChildren
Returns all children as an address array
getSolvency
Returns the 'solvency' of this as defined by the DataTypes.Solvency enum
getParent
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
name
Returns the name of 'this', which is a string
_validateSolvent
Reverts if the company state is not solvent
_isCallerChild
Returns true if the caller is a 'child'
_validateCallerIsChild
Reverts if the caller is not a 'child' of 'this'
_validateCallerIsChildOrThis
Reverts if the caller is not 'this' or a 'child' of 'this'
_validateLiquidating
Reverts if the company state is not liquidating
supportsInterface
ERC165 support
upgradeToAndCall
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
_authorizePatch
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
Structs
TeamStorage
Last updated