Manage the Insurance parameter
As described in the DelegationsManager page, the Insurance, i.e. the amount of token that a Delegation must have staked in order to attach itself to the DelegationsManager can be managed in two different ways:
- 1.defining the insurance amount inside the DelegationsManager contract -> setting the
_attachInsuranceparameter when initializing the DelegationsManager.
- 2.retrieving the insurance amount from an external smart contract -> setting the
_attachInsuranceRetrieverparameter when initializing the DelegationsManager.
If you initialize an
_attachInsuranceparameter is not taken into account even if populated.
_attachInsuranceRetrievercan only be defined when initializing the DelegationsManager and it can't be modified later.
If you initialize the
_attachInsuranceRetrieverit can be modified later using the
function setAttachInsurance(uint256 value) external returns (uint256 oldValue);
_attachInsuranceRetrieversmart contract must implement a
get()view function that returns the insurance amount in the form of
_attachInsuranceRetrieverallows you to save the insurance amount as a parameter in the State Manager of the Organization (at the Root or Governance layer) and have the
get ()method of the
_attachInsuranceRetrieverretrieve the value by reading it from the State Manager.
In this case, the value of the insurance parameter can be modified by:
- a Root level Proposal that overwrites the value in the State Manager, if the insurance variable is saved in the State Manager at Root level.
- a subDAO Proposal that overwrites the value in the State Manager, if the insurance variable is saved in the State Manager at Governance level and if there is a Proposal Model, surveyless or survey, to do so. The Proposal to change the value of a variable saved in the state manager can be found here.
Here, you can find an example of a
_attachInsuranceRetrieversmart contract that retrieves the insurance amount from the State Manager at the Governance layer.