EIP712WithNonce
Dispatch
_agents
_scanners
version
scannerToAgents
agentToScanners
Disabled
InvalidId
AlreadyLinked
Link
constructor
initialize
function initialize(address __manager, address __router, address __agents, address __scanners) public
Initializer method, access point to initialize inheritance tree.
Name | Type | Description |
---|---|---|
__manager | address | address of AccessManager. |
__router | address | address of Router. |
__agents | address | address of AgentRegistry. |
__scanners | address | address of ScannerRegistry. |
agentRegistry
Getter for AgentRegistry.
Name | Type | Description |
---|---|---|
[0] | contract AgentRegistry | AgentRegistry. |
scannerRegistry
Getter for ScannerRegistry.
Name | Type | Description |
---|---|---|
[0] | contract ScannerRegistry | ScannerRegistry. |
numAgentsFor
Get total agents linked to a scanner.
helper for external iteration.
Name | Type | Description |
---|---|---|
scannerId | uint256 | ERC1155 token id of the scanner. |
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 | ERC1155 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 | ERC1155 token id of the scanner. |
pos | uint256 | index for iteration. |
Name | Type | Description |
---|---|---|
[0] | uint256 | ERC1155 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 | ERC1155 token id of the scanner. |
pos | uint256 | index for iteration. |
Name | Type | Description |
---|---|---|
registered | bool | bool if agent exists, false otherwise. |
owner | address | address. |
agentId | uint256 | ERC1155 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 | ERC1155 token id of the scanner. |
pos | uint256 | index for iteration. |
Name | Type | Description |
---|---|---|
[0] | uint256 | ERC1155 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 enabled, uint256 disabledFlags)
Get data of ascanner running an agent at a certain position.
helper for external iteration.
Name | Type | Description |
---|---|---|
agentId | uint256 | ERC1155 token id of the agent. |
pos | uint256 | index for iteration. |
Name | Type | Description |
---|---|---|
registered | bool | true if scanner is registered. |
scannerId | uint256 | ERC1155 token id of the scanner. |
owner | address | address. |
chainId | uint256 | that the scanner monitors. |
metadata | string | IPFS pointer for agent metadata. |
enabled | bool | true if scanner is enabled, false otherwise. |
disabledFlags | uint256 | 0 if not disabled, Permission that disabled the scnner otherwise. |
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 | ERC1155 token id of the agent. |
scannerId | uint256 | ERC1155 token id of the scanner. |
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 | ERC1155 token id of the agent. |
scannerId | uint256 | ERC1155 token id of the scanner. |
setAgentRegistry
Sets agent registry address.
only DEFAULT_ADMIN_ROLE (governance).
Name | Type | Description |
---|---|---|
newAgentRegistry | address | agent of the new AgentRegistry. |
setScannerRegistry
Sets scanner registry address.
only DEFAULT_ADMIN_ROLE (governance).
Name | Type | Description |
---|---|---|
newScannerRegistry | 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 | ERC1155 token id of the scanner. |
Name | Type | Description |
---|---|---|
length | uint256 | amount of agents. |
manifest | bytes32 | keccak256 of list of agents, list of agentVersion and list of enabled states. |