Dispatch
Dispatch
Disabled
InvalidId
SetAgentRegistry
SetScannerRegistry
SetScannerPoolRegistry
AlreadyLinked
Link
constructor
initialize
function initialize(address __manager, address __agents, address __scanners, address __scannerPools) public
Initializer method, access point to initialize inheritance tree.
Name | Type | Description |
---|---|---|
__manager | address | address of AccessManager. |
__agents | address | address of AgentRegistry. |
__scanners | address | address of ScannerRegistry. |
__scannerPools | address | address of ScannerPoolRegistry. |
agentRegistry
scannerRegistry
scannerPoolRegistry
numAgentsFor
Get total agents linked to a scanner.
helper for external iteration.
Name | Type | Description |
---|---|---|
scannerId | uint256 | address of the scanner converted to uint256 |
Name | Type | Description |
---|---|---|
[0] | uint256 | total agents linked to a scanner |
numScannersFor
Get total scanners where an agent is running in.
helper for external iteration.
Name | Type | Description |
---|---|---|
agentId | uint256 | ERC721 token id of the agent. |
Name | Type | Description |
---|---|---|
[0] | uint256 | total scanners running an scanner |
agentAt
Get agentId linked to a scanner in certain position.
helper for external iteration.
Name | Type | Description |
---|---|---|
scannerId | uint256 | address of the scanner converted to uint256 |
pos | uint256 | index for iteration. |
Name | Type | Description |
---|---|---|
[0] | uint256 | ERC721 token id of the agent. |
agentRefAt
function agentRefAt(uint256 scannerId, uint256 pos) external view returns (bool registered, address owner, uint256 agentId, uint256 agentVersion, string metadata, uint256[] chainIds, bool enabled, uint256 disabledFlags)
Get data of an agent linked to a scanner at a certain position.
helper for external iteration.
Name | Type | Description |
---|---|---|
scannerId | uint256 | address of the scanner converted to uint256 |
pos | uint256 | index for iteration. |
Name | Type | Description |
---|---|---|
registered | bool | bool if agent exists, false otherwise. |
owner | address | address. |
agentId | uint256 | ERC721 token id of the agent. |
agentVersion | uint256 | agent version number. |
metadata | string | IPFS pointer for agent metadata. |
chainIds | uint256[] | ordered array of chainId were the agent wants to run. |
enabled | bool | bool if agent is enabled, false otherwise. |
disabledFlags | uint256 | 0 if not disabled, Permission that disabled the scnner otherwise. |
scannerAt
Get scannerId running an agent at a certain position.
helper for external iteration.
Name | Type | Description |
---|---|---|
agentId | uint256 | ERC721 token id of the scanner. |
pos | uint256 | index for iteration. |
Name | Type | Description |
---|---|---|
[0] | uint256 | ERC721 token id of the scanner. |
scannerRefAt
function scannerRefAt(uint256 agentId, uint256 pos) external view returns (bool registered, uint256 scannerId, address owner, uint256 chainId, string metadata, bool operational, bool disabled)
Get data of ascanner running an agent at a certain position.
helper for external iteration.
Name | Type | Description |
---|---|---|
agentId | uint256 | ERC721 token id of the agent. |
pos | uint256 | index for iteration. |
Name | Type | Description |
---|---|---|
registered | bool | true if scanner is registered. |
scannerId | uint256 | ERC721 token id of the scanner. |
owner | address | address. |
chainId | uint256 | that the scanner monitors. |
metadata | string | IPFS pointer for agent metadata. |
operational | bool | true if scanner is not disabled and staked over min, false otherwise. |
disabled | bool | true if disabled by ScannerPool or scanner itself. |
areTheyLinked
Returns true if scanner and agents are linked, false otherwise.
link
Assigns the job of running an agent to a scanner.
currently only allowed for DISPATCHER_ROLE (Assigner software). emits Link(agentId, scannerId, true) event.
Name | Type | Description |
---|---|---|
agentId | uint256 | ERC721 token id of the agent. |
scannerId | uint256 | address of the scanner converted to uint256 |
unlink
Unassigns the job of running an agent to a scanner.
currently only allowed for DISPATCHER_ROLE (Assigner software). emits Link(agentId, scannerId, false) event.
Name | Type | Description |
---|---|---|
agentId | uint256 | ERC721 token id of the agent. |
scannerId | uint256 | address of the scanner converted to uint256 |
setAgentRegistry
Sets agent registry address.
only DEFAULT_ADMIN_ROLE (governance).
Name | Type | Description |
---|---|---|
newAgentRegistry | address | agent of the new AgentRegistry. |
_setAgentRegistry
setScannerRegistry
Sets scanner registry address.
only DEFAULT_ADMIN_ROLE (governance).
Name | Type | Description |
---|---|---|
newScannerRegistry | address | agent of the new ScannerRegistry. |
setScannerPoolRegistry
Sets ScannerPool registry address.
only DEFAULT_ADMIN_ROLE (governance).
Name | Type | Description |
---|---|---|
newScannerPoolRegistry | address | agent of the new ScannerRegistry. |
agentHash
Method to hash the amount of scanners an agent is running in, and their status
method marked for deprecation in next version.
scannerHash
method used by Scanner Node software to know if their list of assigned agents has changed, their enabled state or version has changed so they can start managing changes (loading new agent images, removing not assigned agents, updating agents...).
Name | Type | Description |
---|---|---|
scannerId | uint256 | address of the scanner converted to uint256 |
Name | Type | Description |
---|---|---|
length | uint256 | amount of agents. |
manifest | bytes32 | keccak256 of list of agents, list of agentVersion and list of enabled states. |