-
Notifications
You must be signed in to change notification settings - Fork 0
Model Info Mediation
Mediation provides a method to recover control of Model records in which the current set of administrators are unresponsive. When a Model record is first created, two to five mediators may be added by any of the users in the AdminList.
In order to enter mediation, the original owner of the record shall request mediation from each mediator on the MediatorList. The owner must supply a new AdminId to the mediators, and the mediators must securely prove the request is valid, and the new AdminId belongs to the owner. The methods in which this occurs is not defined in this SmartContract.
The model record shall enter the "MediationStateInMediation" state once the first mediator submits a new AdminId using the WriteMediatorAdmin API. The model record shall enter the "MediationStateReadyForNewAdmin" state once all mediators have assigned the same AdminId. At this point, the new AdminId may be used to go back to the "MediationStateNormal" by calling the ExitMediationState API.
WriteMediator
ReadMediatorList
WriteMediatorAdmin
ReadMediatorAdminList
ReadMediationState
ExitMediationState
The WriteMediator shall be called by any Admin on the AdminList to add/modify the list of mediators.
| Type | Name | Description |
|---|---|---|
| address | ModelId | ModelId for the model. |
| uint | Index | Mediator list index |
| address | MediatorId | Mediator ID to be added to the list |
| Type | Name | Description |
|---|---|---|
| bool | Status | True if successful |
var ModelId = "0xbd4d579e0819c4ab3d1b6d59b8429218fc923507";
var Index = 0;
var MediatorId = "0x1bbe4a661fdcb10ccc698ff484549555513684dc";
ModelInfo.WriteMediator(ModelId, Index, AdminId, {AdminId,gas:470000});
Return the list of Mediators for the Model record. Any user may call this function.
| Type | Name | Description |
|---|---|---|
| address | ModelId | ModelId for the model. |
| Type | Name | Description |
|---|---|---|
| address[] | MediatorList | List of mediators |
var ModelId = "0xbd4d579e0819c4ab3d1b6d59b8429218fc923507";
ModelInfo.ReadMediatorList(ModelId);
0x2ce23c3c4692079c1eba9ffce2b7175fa43d106e,0x0000000000000000000000000000000000000000,0x0000000000000000000000000000000000000000,0x0000000000000000000000000000000000000000,0x0000000000000000000000000000000000000000
The Mediator contained in the MediatorList shall be allowed to nominate a new Admin by writing the suggested AdminId to the MediatorAdminList corresponding to the Mediator's Index in the MediatorList. The list is cleared once the model record exits mediation.
| Type | Name | Description |
|---|---|---|
| address | ModelId | ModelId for the model. |
| uint | Index | Mediator list index |
| address | AdminId | Nominated AdminId from the mediator |
| Type | Name | Description |
|---|---|---|
| bool | Status | True if successful |
var ModelId = "0xbd4d579e0819c4ab3d1b6d59b8429218fc923507";
var Index = 0;
var AdminId = "0x1bbe4a661fdcb10ccc698ff484549555513684dc";
ModelInfo.WriteMediatorAdmin(ModelId, Index, AdminId, {MediatorId,gas:470000});
Return the list of AdminIds contained in the MediatorAdminList for the Model record. Any user may call this function.
| Type | Name | Description |
|---|---|---|
| address | ModelId | ModelId for the model. |
| Type | Name | Description |
|---|---|---|
| address[] | Adminlist | List of AdminIds |
var ModelId = "0xbd4d579e0819c4ab3d1b6d59b8429218fc923507";
ModelInfo.ReadMediatorAdminList(ModelId);
0x2ce23c3c4692079c1eba9ffce2b7175fa43d106e,0x0000000000000000000000000000000000000000,0x0000000000000000000000000000000000000000,0x0000000000000000000000000000000000000000,0x0000000000000000000000000000000000000000
Return the current Mediation State for the model record. Any user may call this function.
The defined states are:
| State | Description |
|---|---|
| 0 | MediationStateNormal |
| 1 | MediationStateInMediation |
| 2 | MediationStateReadyForNewAdmin |
| Type | Name | Description |
|---|---|---|
| address | ModelId | ModelId for the model. |
| Type | Name | Description |
|---|---|---|
| uint | MediationState | Current mediation state for the Model record |
var ModelId = "0xbd4d579e0819c4ab3d1b6d59b8429218fc923507";
ModelInfo.ReadMediatorState(ModelId);
0
Once all the mediators have submitted a new AdminId, and they all agree upon the same AdminId, then that AdminId may move the Model record back to "MediationStateNormal" through the ExitMediationState API.
| Type | Name | Description |
|---|---|---|
| address | ModelId | ModelId for the model. |
| Type | Name | Description |
|---|---|---|
| bool | Status | True if successful |
var ModelId = "0xbd4d579e0819c4ab3d1b6d59b8429218fc923507";
ModelInfo.ExitMediationState(ModelId,{AdminId,gas:470000});