Skip to content

Dispatch

Dispatch

Disabled

error Disabled(string name)

InvalidId

error InvalidId(string name, uint256 id)

SetAgentRegistry

event SetAgentRegistry(address registry)

SetScannerRegistry

event SetScannerRegistry(address registry)

SetScannerPoolRegistry

event SetScannerPoolRegistry(address registry)

AlreadyLinked

event AlreadyLinked(uint256 agentId, uint256 scannerId, bool enable)
event Link(uint256 agentId, uint256 scannerId, bool enable)

constructor

constructor(address forwarder) public

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

function agentRegistry() public view returns (contract AgentRegistry)

scannerRegistry

function scannerRegistry() public view returns (contract ScannerRegistry)

scannerPoolRegistry

function scannerPoolRegistry() public view returns (contract ScannerPoolRegistry)

numAgentsFor

function numAgentsFor(uint256 scannerId) public view returns (uint256)

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

function numScannersFor(uint256 agentId) public view returns (uint256)

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

function agentAt(uint256 scannerId, uint256 pos) public view returns (uint256)

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

function scannerAt(uint256 agentId, uint256 pos) public view returns (uint256)

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

function areTheyLinked(uint256 agentId, uint256 scannerId) external view returns (bool)

Returns true if scanner and agents are linked, false otherwise.

function link(uint256 agentId, uint256 scannerId) public

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
function unlink(uint256 agentId, uint256 scannerId) public

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

function setAgentRegistry(address newAgentRegistry) public

Sets agent registry address.

only DEFAULT_ADMIN_ROLE (governance).

Name Type Description
newAgentRegistry address agent of the new AgentRegistry.

_setAgentRegistry

function _setAgentRegistry(address newAgentRegistry) private

setScannerRegistry

function setScannerRegistry(address newScannerRegistry) public

Sets scanner registry address.

only DEFAULT_ADMIN_ROLE (governance).

Name Type Description
newScannerRegistry address agent of the new ScannerRegistry.

setScannerPoolRegistry

function setScannerPoolRegistry(address newScannerPoolRegistry) external

Sets ScannerPool registry address.

only DEFAULT_ADMIN_ROLE (governance).

Name Type Description
newScannerPoolRegistry address agent of the new ScannerRegistry.

agentHash

function agentHash(uint256 agentId) external view returns (uint256 length, bytes32 manifest)

Method to hash the amount of scanners an agent is running in, and their status

method marked for deprecation in next version.

scannerHash

function scannerHash(uint256 scannerId) external view returns (uint256 length, bytes32 manifest)

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.

__gap

uint256[47] __gap