|
| 1 | +// SPDX-License-Identifier: MIT |
| 2 | +pragma solidity >=0.7.6 <0.9; |
| 3 | + |
| 4 | +interface IAgentPing { |
| 5 | + /** |
| 6 | + * Agent bot liveness check. |
| 7 | + * @param agentVault the agent vault whose owner bot to ping |
| 8 | + * @param sender the account that triggered ping; helps bot decide whether it is important to answer |
| 9 | + * @param query off-chain defined id of the query |
| 10 | + */ |
| 11 | + event AgentPing( |
| 12 | + address indexed agentVault, |
| 13 | + address indexed sender, |
| 14 | + uint256 query); |
| 15 | + |
| 16 | + /** |
| 17 | + * Response to agent bot liveness check. |
| 18 | + * @param agentVault the pinged agent vault |
| 19 | + * @param owner owner of the agent vault (management address) |
| 20 | + * @param query repeated `query` from the AgentPing event |
| 21 | + * @param response response data to the query |
| 22 | + */ |
| 23 | + event AgentPingResponse( |
| 24 | + address indexed agentVault, |
| 25 | + address indexed owner, |
| 26 | + uint256 query, |
| 27 | + string response); |
| 28 | + |
| 29 | + /** |
| 30 | + * Used for liveness checks, simply emits AgentPing event. |
| 31 | + * @param _agentVault the agent vault whose owner bot to ping |
| 32 | + * @param _query off-chain defined id of the query |
| 33 | + */ |
| 34 | + function agentPing( |
| 35 | + address _agentVault, |
| 36 | + uint256 _query |
| 37 | + ) external; |
| 38 | + |
| 39 | + /** |
| 40 | + * Used for liveness checks, the bot's response to AgentPing event. |
| 41 | + * Simply emits AgentPingResponse event identifying the owner. |
| 42 | + * NOTE: may only be called by the agent vault owner |
| 43 | + * @param _agentVault the pinged agent vault |
| 44 | + * @param _query repeated `_query` from the agentPing |
| 45 | + * @param _response response data to the query |
| 46 | + */ |
| 47 | + function agentPingResponse( |
| 48 | + address _agentVault, |
| 49 | + uint256 _query, |
| 50 | + string memory _response |
| 51 | + ) external; |
| 52 | +} |
0 commit comments