IAgentSecured

Git Source

Functions

openDispute

Local AgentManager should call this function to indicate that a dispute between a Guard and a Notary has been opened.

function openDispute(uint32 guardIndex, uint32 notaryIndex) external;

Parameters

NameTypeDescription
guardIndexuint32Index of the Guard in the Agent Merkle Tree
notaryIndexuint32Index of the Notary in the Agent Merkle Tree

resolveDispute

Local AgentManager should call this function to indicate that a dispute has been resolved due to one of the agents being slashed.

rivalIndex will be ZERO, if the slashed agent was not in the Dispute.

function resolveDispute(uint32 slashedIndex, uint32 rivalIndex) external;

Parameters

NameTypeDescription
slashedIndexuint32Index of the slashed agent in the Agent Merkle Tree
rivalIndexuint32Index of the their Dispute Rival in the Agent Merkle Tree

agentManager

Returns the address of the local AgentManager contract, which is treated as the "source of truth" for agent statuses.

function agentManager() external view returns (address);

inbox

Returns the address of the local Inbox contract, which is treated as the "source of truth" for agent-signed statements.

Inbox passes verified agent statements to IAgentSecured contract.

function inbox() external view returns (address);

agentStatus

Returns (flag, domain, index) for a given agent. See Structures.sol for details.

Will return AgentFlag.Fraudulent for agents that have been proven to commit fraud, but their status is not updated to Slashed yet.

function agentStatus(address agent) external view returns (AgentStatus memory);

Parameters

NameTypeDescription
agentaddressAgent address

Returns

NameTypeDescription
<none>AgentStatusStatus for the given agent: (flag, domain, index).

getAgent

Returns agent address and their current status for a given agent index.

Will return empty values if agent with given index doesn't exist.

function getAgent(uint256 index) external view returns (address agent, AgentStatus memory status);

Parameters

NameTypeDescription
indexuint256Agent index in the Agent Merkle Tree

Returns

NameTypeDescription
agentaddressAgent address
statusAgentStatusStatus for the given agent: (flag, domain, index)

latestDisputeStatus

Returns (flag, openedAt, resolvedAt) that describes the latest status of the latest dispute for an agent with a given index.

Will return empty values if agent with given index doesn't exist.

function latestDisputeStatus(uint32 agentIndex) external view returns (DisputeStatus memory);

Parameters

NameTypeDescription
agentIndexuint32Agent index in the Agent Merkle Tree

Returns

NameTypeDescription
<none>DisputeStatusLatest dispute status for the given agent: (flag, openedAt, resolvedAt)