DelegationsManager
Contract Name
GitHub
Deployed Contract Address
Contract Implemented
Initialization Data
DelegationsManager
Coming soon
Coming soon
IDelegationsManager, LazyInitCapableElement
maxSize, _treasuryManagerModelAddress, flusherKey, executorRewardPercentage, _collection, _objectId, allowedFactories, disallowedDelegations and LazyInitCapableElement init data
To support Delegations, an Organization must have a DelegationsManager as an active component.
A DelegationsManager allows:
  • Delegations to link themselves to an Organization
  • Organization to remove or ban Delegations
  • Calculate and manage the apportioning of funds among an Organization's active delegations
  • Organization to blacklist Delegation Factories
Without a DelegationsManager, an organization cannot have Delegations.
A Delegation may be attached to more than one Delegation at the same time.

Delegations Manager Initialization

The following parameters must be passed when initializing the DelegationsManager:
1
function _lazyInit(bytes memory lazyInitData) internal override returns (bytes memory lazyInitResponse) {
2
3
(maxSize, _treasuryManagerModelAddress, lazyInitResponse) = abi.decode(lazyInitData, (uint256, address, bytes));
4
5
(executorRewardPercentage, _collection, _objectId, lazyInitResponse) = abi.decode(lazyInitResponse, (uint256, address, uint256, bytes));
6
7
(_attachInsurance, _attachInsuranceRetriever, flusherKey, lazyInitResponse) = abi.decode(lazyInitResponse, (uint256, address, bytes32, bytes));
8
9
if(lazyInitResponse.length > 0) {
10
(address[] memory allowedFactories, address[] memory bannedDelegations) = abi.decode(lazyInitResponse, (address[], address[]));
11
12
for(uint256 i = 0; i < allowedFactories.length; i++) {
13
factoryIsAllowed[allowedFactories[i]] = true;
14
}
15
for(uint256 i = 0; i < bannedDelegations.length; i++) {
16
isBanned[bannedDelegations[i]] = true;
17
}
18
}
19
lazyInitResponse = "";
20
}
Copied!
  • uint256 maxSize -> it represents the maximum number of Delegations that can be attached to a DelegationsManager
  • address _treasuryManagerModelAddress -> this is the address of the treasuryManager model contract to clone for each Delegation that links itself to an Organization via a DelegationsManager
And:
  • uint256 executorRewardPercentage -> this represents the percentage of the DelegationsManager's balance that the caller--AKA, the msg.sender--of the splitTreasury function of the DelegationsManager receives as a reward for the call.
  • address _collection -> this represents the Item and ERC1155 Collection address that is supported for voting on all Proposals of the specific Organization; for ERC20 tokens, pass it as empty.
  • uint256 _objectId -> this represents, for the _collection, the object id of the specific ERC1155 and Item token of the Collection supported. For ERC20 tokens, the address must be first converted in a uint parameter, and then passed in this object id one (and, as mentioned above, the collection address must be passed as empty).
And:
  • uint256 _attachInsurance -> it represents the insurance, i.e. the amount of token (defined by collection and objectId) that a delegation has to stake before it can attach itself. Any address can stake for a delegation, more info on the next page.
  • address _attachInsuranceRetriever -> it represents the smart contract address to query for the insurance amount. If _attachInsuranceRetriever is populated, the previous parameter _attachInsurance is not taken into account.
    Defining the insurance externally can be useful to change it by voting a specific subDAO for example. Here for more info.
  • bytes32 flusherKey -> it represents the Organization Component key that receives remaining funds if the Delegations don't receive all the funds from the splitting operations. If it's passed as bytes32(0), the Organization Treasury Manager is automatically taken as a valid flusher.
And:
  • address[] allowedFactories-> this represents the addresses of the Factories of which the model contracts are the Delegations that can attach themselves to the Organization. See here for more info.
  • address[] disallowedDelegations-> this represents the addresses of blacklisted Delegations. See here for more info.