Methods
The operations that can be performed on the Delegations Manager contract are listed below.
Read Operations
Retrieve the number (length) of Delegations attached to the Delegations Manager.
Retrieve for each Delegation its data (DelegationData
struct).
Pass a range position(start
and offset
) and returns an array containing the DelegationsData
struct for each Delegation of the range.
Pass an array of Delegation addresses and retrieve for each Delegation its data (DelegationsData
struct).
Pass an array of microservices indices and retrieve for each Delegation its data (DelegationsData
struct).
Pass a Delegation address and retrieve if it exists (true), i.e. the address corresponds to a Delegation, or not (false), its index, and its specific Treasury address corresponding to the Organization.
Pass a Delegation address and retrieve its specific Treasury address corresponding to the Organization.
Pass a Delegation address and retrieve its data (DelegationData
struct).
Pass a Delegation index and retrieve its data (DelegationData
struct).
Retrieve the executor reward set for calling the split
function.
Pass an executor reward receiver address and retrieve the addresses of the receivers (executor address and all the Delegations addresses attached ) and the values they receives.
Retrieve the addresses of the Delegation that receive funds from the split
and the values they receives.
Pass a Factory address and retrieve if the Delegations cloned from it are allowed to attach themself to the Delegations Manager (true) or not (false).
Pass a Delegation address and retrieve if it's banned (true) or not (false).
Pass a Delegation address and a caller address and retrieve if the Delegation is allowed to attach itself to the Delegations Manager (true) or not (false). Look here for more info.
Retrieve the Collection addresses and the objectId of the supported token chosen by the Organization to which the Delegations Manager is attached.
Retrive the max number set (maxSize
) of Delegations that can be attached to the Delegations Manager.
Pass a delegation address and an address retriever and retrieve the total staked amount and the staked amount by the retriever address for that Delegation.
Retrieve the Insurance amount. If a _attachInsuranceRetriever was defined, the Insurance is retrived by the _attachInsuranceRetriever smart contract. If a _attachInsuranceRetriever was not defined, the insurance is the _attachInsurance parameter.
Write Operations
This function is called by a Delegation when it attaches itself to the Delegations Manager using the DelegationsManagerAttacherProposal
.
This function can be called to perform the split among the various Delegation. It takes as input the executor reward receiver address.
This function can be used to change the supported token chosen by the Organization to which the Delegations Manager is attached. It takes as input the new Collection address and objectId. The new token replaced the old one.
This function can be used to change the maxSize (maximum number of delegations that can be attached) previously set. It takes as input the new maxSize value and replaces the old one.
This function can be called by the Organization hosting the Delegations Manager to remove one or more Delegation
address(es).
This function can be called by the Organization to remove all the Delegations attached.
This function can be used to allow (true) / disallow (false) one or more Factory address(es).
This function can be used to ban one or more Delegation address(es).
This function can be used to pay the insurance, i.e. stake the required amount of token.
The delegationAddress
is the address of the Delegation address of the delegation for which you are staking tokens, amount
represents the amount you're staking, permitSignature
represents the data for the permit approval, retriever
represents the address that will take back the staked tokens when the Delegation is removed from the Organization. Pass as address(0)
to set the receiver as msg.sender.
This function can be used to give back the staked token amount. It can only be called by the previously set address retriever when the Delegation you are withdrawing for has already been removed. If the delegation has been banned, the staked tokens are automatically burned and therefore are no longer withdrawable.
The delegationAddress
represents the delegation for which you are withdrawing, receiver
represents the address receiving the tokens, data
represents the eventual data
to execute in case you're withdrawing ERC1155 (data is a parameter of the safeTransferFrom
of ERC1155).
This function can be called by the Organization hosting the DelegationsManager to change the insurance value if the insurance was internally defined by the _attachInsurance parameter. Look here for more info.
Last updated