TreasurySplitterManager
ITreasurySplitterManager
, LazyInitCapableElement
firstSplitBlock
, splitInterval
, _keys
, _percentages
, _flushKey
, flushExecutorRewardPercentage
, executorRewardPercentage
and LazyInitCapableElement
init dataโDelegationsManager
Treasury (from where they can then, in turn, be distributed to Delegations); to the InvestmentsManager
Treasury (from where they can, in turn, be used to carry out investments); to the Organization Treasury to store funds in order to manage future emergencies or to boost the development of new features and so on.TreasurySplitter
Manager is a LazyInitCapableElement
, and therefore must be initialized following the pattern explained here, passing these parameters:uint256 firstSplitBlock
-> this is the first block at which the splitTreasury
function can be called.uint256 splitInterval
-> this is how many blocks must pass between each execution of splitTreasury
.bytes32[] _keys
-> this parameter represents the receiver(s) of the split funds. This parameter must be passed as the key(s) of the receivers(s) Component(s). Multiple keys can be passed in the array.uint256[] _percentages
-> these are the percentage amounts of split funds to be distributed among the receivers listed in the above parameter.bytes32 _flushKey
-> this is where the funds are sent when a 'flush' is performed. This parameter represents the receiver of the flush call. This parameter must be passed as the key of the receiver Component.uint256 flushExecutorRewardPercentage
-> this is the percentage of the split funds that the flushERC20Tokens
function caller--AKA, the msg.sender
--will receive as a reward.uint256 executorRewardPercentage
-> this is the percentage of the split funds that the splitTreasury
function caller--AKA, the msg.sender
--will receive as a reward.splitTreasury
function:splitInterval
).executorReward
receiver address, which is msg.sender
unless the caller specifies otherwise. executorReward
is calculated as (the amount to be split x executorReward percentage)
.TreasurySplitter
is attached as a component. If no receivers have been set up (in the _keys
parameter during initialization of the TreasurySplitter
) to receive the split funds the entire amount is automatically sent to the Treasury Manager of the Organization to which the TreasurySplitter
is attached as a component.flushERC20Tokens
function is used to transfer all dormant ERC20 and ETH funds out from the Treasury Splitter in emergency situations or simply to transfer received ERC20 tokens out of the Splitter. The funds can be sent to:_flushKey
)TreasurySplitter
is attached as a component.flushExecutorReward
amount is calculated as (the amount to flush * flushExecutorReward percentage)
.address[] tokenAddresses
-> these are the addresses of the tokens to transfer. To transfer ETH, pass address(0)
.uint256[] values
-> this is the amount of each to transfer. The position of each value in the array corresponds to the same position in the tokenAddress
array.address executorRewardReceiver
-> this is the address of the receiver of the flushExecutorReward
.flushERC20Tokens
), receivers percentages, and executor reward cannot be changed once set. Therefore it is necessary to create a new version of the Splitter.