Last updated
Last updated
Inherits: ITreasury, Team
Author: Daniel Yamagata & Naveen Ailawadi
A Safe-like contract whose signers are a company's board of directors. A Mezzanine company resembles a tree data structure. The 'Treasury' is the root node of the tree, while 'departments' and 'modules' are internal and leaf nodes. A treasury should hold nearly all assets of a company. Funds can be spent recursively by departments and modules given there are sufficcient approvals and balances. The entirety of a company can be queried either directly from the treasury or via a tree traversal algorithm
Returns the address of the company's capital stack
Returns the address of the company's delegate registry
Returns the address of the denomination asset
All debt by the company will be recorded in terms of the denomination asset This value is immutable
Returns the address of the company's common shares
A treasury will only have a single set of common shares
Returns the address of the Governor
The Governor is able to manage the signers of the Treasury
Returns the address of the Token Timelock
Used by Mezz Shares to issue and vest shares atomically
Returns the address of the Payroll Manager
The Payroll Manager is a shortbound ERC721 contract that manages the payroll of employees. It is able to arbitrarily spend money and common shares from the treasury without approvals. It is controlled by the board of directors (i.e. the Treasury) and a set of admins, who are set by the board
Returns true if the treasury is adding an asset, false otherwise. A callback used by the capital stack to prevent the treasury from arbitrarily adding an asset to the capital stack
Returns true if the treasury is removing an asset, false otherwise. A callback used by the capital stack to prevent the treasury from arbitrarily removing an asset from the capital stack
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.
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
Deploys and initializes a new governor. Sets the new governor accordingly
Changes the current governor to a new one associated with 'governorCoreId' A treasury cannot change its governor to one with the same core ID
Parameters
Returns
Deploys an asset with 'assetCoreId' via the Mezz Deployer and adds it to the seniority level with 'seniorityLevelIndex' in the capital stack. If the asset supports the Mezz Shares interface, adds it to the company's shares. Adds a document to the Document Registry with 'assetDocumentName' and 'assetDocumentUri'. The 'owner' of the document will be the capital stack. The name and URI can be updated retroactively at any time.
Parameters
Removes an asset from the capital stack. The 'removable()' function of 'assetToRemove()' must return true for this function to succeed. The conditions for removal are bespoke to each asset. For example, the total supply of a share class must be zero for it to be removed. If 'assetToRemove' supports the Mezz Shares interface, it will be removed from the company's shares. The document associated with the asset will be updated to null
Transfers an 'amount' of an 'asset' to the payroll module. Only callable by the payroll module. The asset must either be a whitelisted denomination asset or the company's common shares. Returns the amount of the asset paid to the recipient, inclusive of ERC20 transfer fees.
This function bypasses all of the treasury's ERC20 allowances. This was designed in a manner to prevent the board from needing to manually setting approvals for payroll
Parameters
Returns
Transfers 'amount' of asset to the caller, who must be a child. Sends any set fees for the treasury implementation to the fee controller
Returns the coreId of the implementation as a bytes32
The core ID is the keccak256 hash of the contract name followed by a version under the following syntax: "mezzanine.coreId.ContractName.vX" For example, the core ID of the 2nd version of the Treasury would be the following: keccak256(abi.encodePacked("mezzanine.coreId.Treasury.v2"))
Returns the version of the implementation as a uint256
Returns the name of 'this', which is a string
Returns the symbol for the company
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
Returns the addresses for the company's share classes as an address array
Returns true if 'sharesToCheck' is a valid share class for the company, false otherwise
Parameters
Returns the summation of the outstanding supply for all share classes. This does not include any vesting or treasury shares
Returns the summation of the fully diluted supply for all share classes. This includes authorized, vesting, and treasury shares
Access control for 'resetToPatchedLatestVersion()'. Validation of 'data' is completd in Team.sol
ERC165 support