AgentRegistryEnumerable
AgentRegistryEnumerable
_allAgents
_chainAgents
getAgentCount
Agent count.
Helper for external iteration.
| Name | Type | Description |
|---|---|---|
| [0] | uint256 | total amount of registered agents. |
getAgentByIndex
Agent id at index in _allAgents array.
Helper for external iteration.
| Name | Type | Description |
|---|---|---|
| index | uint256 | of agent in _allAgents array. |
| Name | Type | Description |
|---|---|---|
| [0] | uint256 | agentId at index. |
getAgentCountByChain
Registered agent count by chainId.
Helper for external iteration.
| Name | Type | Description |
|---|---|---|
| [0] | uint256 | agent total registered by chainId. |
getAgentByChainAndIndex
Agent id at index, by chainId
Helper for external iteration.
| Name | Type | Description |
|---|---|---|
| chainId | uint256 | where the agent was registered. |
| index | uint256 | of agent in _chainAgents[chainId] array. |
| Name | Type | Description |
|---|---|---|
| [0] | uint256 | agentId at index for that chainId. |
_beforeAgentUpdate
function _beforeAgentUpdate(uint256 agentId, string newMetadata, uint256[] newChainIds) internal virtual
hook fired before agent creation or update.
stores agent in _allAgents if it wasn't there, manages agent arrays by chain.
| Name | Type | Description |
|---|---|---|
| agentId | uint256 | ERC721 token id of the agent to be created or updated. |
| newMetadata | string | IPFS pointer to agent's metadata JSON. |
| newChainIds | uint256[] | ordered list of chainIds where the agent wants to run. |