IGelatoAutomateAdapter
Title: IGelatoAutomateAdapter
Author: Modified from Gelato (https://github.com/gelatodigital/automate)
Interface for the GelatoAutomateAdapter Diamond facet — Gelato Automate (Web3 Functions) task management. Establishes the automation/keeper family.
Lets a Diamond create, track, and cancel Gelato Automate tasks. Gelato executes a task through
a task-creator-specific dedicated msg.sender; consumer exec entrypoints must gate on it via
the library's requireDedicatedMsgSender guard. Task creation/cancellation are admin-gated.
Functions
getConfig
Returns the current Automate configuration.
function getConfig() external view returns (address automate, address dedicatedMsgSender);Returns
| Name | Type | Description |
|---|---|---|
| automate | address | The Gelato Automate contract. |
| dedicatedMsgSender | address | The dedicated msg.sender Gelato execs through. |
isTask
Returns whether taskId is tracked by this adapter.
function isTask(bytes32 taskId) external view returns (bool);Parameters
| Name | Type | Description |
|---|---|---|
| taskId | bytes32 | The task ID to query. |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | bool |
setConfig
Sets or replaces the Automate configuration.
Caller must hold DEFAULT_ADMIN_ROLE. Reverts GelatoAutomateInvalidConfig on a zero field.
function setConfig(address automate, address dedicatedMsgSender) external;Parameters
| Name | Type | Description |
|---|---|---|
| automate | address | The Gelato Automate contract. |
| dedicatedMsgSender | address | The dedicated msg.sender Gelato execs through (derived off-chain via the OpsProxyFactory for this diamond). |
createTask
Creates and tracks a Gelato Automate task.
Caller must hold DEFAULT_ADMIN_ROLE.
function createTask(
address execAddress,
bytes calldata execDataOrSelector,
IGelatoAutomate.ModuleData calldata moduleData,
address feeToken
) external returns (bytes32 taskId);Parameters
| Name | Type | Description |
|---|---|---|
| execAddress | address | The contract Gelato will call when the task runs. |
| execDataOrSelector | bytes | The calldata (or selector) to run. |
| moduleData | IGelatoAutomate.ModuleData | The modules configuring how/when the task triggers. |
| feeToken | address | The fee token (address(0) for native; off-chain via 1Balance otherwise). |
Returns
| Name | Type | Description |
|---|---|---|
| taskId | bytes32 | The Automate-assigned task ID. |
cancelTask
Cancels and untracks a Gelato Automate task.
Caller must hold DEFAULT_ADMIN_ROLE. Reverts GelatoAutomateTaskNotFound if untracked.
function cancelTask(bytes32 taskId) external;Parameters
| Name | Type | Description |
|---|---|---|
| taskId | bytes32 | The task to cancel. |
Events
GelatoAutomateConfigSet
Emitted when the Automate configuration is updated.
event GelatoAutomateConfigSet(address automate, address dedicatedMsgSender);Parameters
| Name | Type | Description |
|---|---|---|
| automate | address | The Gelato Automate contract. |
| dedicatedMsgSender | address | The dedicated msg.sender Gelato execs through. |
TaskCreated
Emitted when a task is created.
event TaskCreated(bytes32 indexed taskId, address execAddress);Parameters
| Name | Type | Description |
|---|---|---|
| taskId | bytes32 | The Automate-assigned task ID. |
| execAddress | address | The contract Gelato will call when the task runs. |
TaskCancelled
Emitted when a task is cancelled.
event TaskCancelled(bytes32 indexed taskId);Parameters
| Name | Type | Description |
|---|---|---|
| taskId | bytes32 | The cancelled task ID. |
Errors
GelatoAutomateNotConfigured
Automate has not been configured (automate or dedicatedMsgSender is zero).
error GelatoAutomateNotConfigured();GelatoAutomateInvalidConfig
setConfig was called with a zero automate or dedicatedMsgSender address.
error GelatoAutomateInvalidConfig();GelatoAutomateOnlyDedicatedMsgSender
An exec entrypoint was called by an address other than the dedicated msg.sender.
error GelatoAutomateOnlyDedicatedMsgSender(address caller);Parameters
| Name | Type | Description |
|---|---|---|
| caller | address | The unauthorised caller. |
GelatoAutomateTaskNotFound
The given task ID is not tracked by this adapter.
error GelatoAutomateTaskNotFound(bytes32 taskId);Parameters
| Name | Type | Description |
|---|---|---|
| taskId | bytes32 | The unknown task ID. |
GelatoAutomateTaskExists
A task with the given ID is already tracked.
error GelatoAutomateTaskExists(bytes32 taskId);Parameters
| Name | Type | Description |
|---|---|---|
| taskId | bytes32 | The duplicate task ID. |