DelegateRegistry
Last updated
Last updated
Inherits: NoncesUpgradeable, StateAware, BoardControlled, Patchable, MezzEIP712, IDelegateRegistry
Author: Daniel Yamagata
A contract used to delegate voting power of a company's non-vesting and vesting shares. Delegates will receive the voting power of the delegator which can subsequently be used in governance
Invariant: the delegate of address(0) will always be address(0)
Initializes the delegate registry's state. Called atomically by the Mezz Deployer
Self-delegates 'account' under the following conditions:
account is not address(0)
The delegatee of 'account' is not set
The caller is a valid share class or the token timelock
'account' is an EOA or properly supports the 'IMezzSelfDelegator' interface
If any of these conditions are false, the function will make no changes to state and return
Updates the delegatee of the caller to 'newDelegatee' and updates the state of all share classes and the token timelock
Updates the delegatee of 'account' to 'newDelegatee' and updates the state of all share classes and the token timelock. A valid 'signature' for 'account' is required, otherwise this function will revert
Validate
Updates the voting power of 'newDelegate' for all shares and the Token Timelock. Runs in O(n) The number of shares that a company can have is limited to 15. This is reasonable, preventing the reversion of this function due to the block gas limit
Returns the delegatee for 'account' if it is set. Otherwise, returns address(0)
Returns the version of the implementation as a uint256
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 transaction hash for
ERC165 support
Upgrades 'this' to a newer version via the Mezz Migrator. Only callable by the Treasury, whose signers are the board of directors
Will revert if the protocol state is 'Paused' or 'Frozen'
Parameters
newVersion
uint256
The new version to upgrade to
data
bytes
The data to be passed to the new implementation, which likely should be a reinitializer function if used
Access control for 'resetToPatchedLatestVersion()'