Skip to content
Lattice

GelatoAutomateAdapter

Git Source

Inherits: IGelatoAutomateAdapter

Title: GelatoAutomateAdapter

Authors: David Dada <daveproxy80@gmail.com> (https://github.com/dadadave80), Modified from Gelato (https://github.com/gelatodigital/automate)

Diamond facet for Gelato Automate (Web3 Functions) task management.

Stateless delegator — all logic and storage live in GelatoAutomateAdapterLib.

This facet handles the create/track/cancel layer only. Gelato executes a created task through a task-creator-specific dedicated msg.sender; consumer exec entrypoints must gate on it via the library's requireDedicatedMsgSender guard.

Notes:

  • lattice-version: 0.1.0
  • lattice-source: Gelato

Functions

getConfig

Returns the current Automate configuration.

function getConfig() external view virtual override returns (address automate, address dedicatedMsgSender);

Returns

NameTypeDescription
automateaddressThe Gelato Automate contract.
dedicatedMsgSenderaddressThe dedicated msg.sender Gelato execs through.

isTask

Returns whether taskId is tracked by this adapter.

function isTask(bytes32 taskId) external view virtual override returns (bool);

Parameters

NameTypeDescription
taskIdbytes32The task ID to query.

Returns

NameTypeDescription
<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 virtual override;

Parameters

NameTypeDescription
automateaddressThe Gelato Automate contract.
dedicatedMsgSenderaddressThe 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 virtual override returns (bytes32 taskId);

Parameters

NameTypeDescription
execAddressaddressThe contract Gelato will call when the task runs.
execDataOrSelectorbytesThe calldata (or selector) to run.
moduleDataIGelatoAutomate.ModuleDataThe modules configuring how/when the task triggers.
feeTokenaddressThe fee token (address(0) for native; off-chain via 1Balance otherwise).

Returns

NameTypeDescription
taskIdbytes32The 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 virtual override;

Parameters

NameTypeDescription
taskIdbytes32The task to cancel.

exportSelectors

ERC-8153 selector export: this facet's cuttable selectors, tightly packed (4 bytes each).

Excludes exportSelectors() itself (0x0ef22643) - it is never cut into a diamond. Order matches forge inspect GelatoAutomateAdapter methodIdentifiers (alphabetical by signature); kept in exact parity by ExportSelectorsParityTest. Chunks: cancelTask(bytes32) 0xee8ca3b5 createTask(address,bytes,(uint8[],bytes[]),address) 0x3323b467 getConfig() 0xc3f909d4 isTask(bytes32) 0x0d04218f setConfig(address,address) 0xb602024b

function exportSelectors() external pure virtual returns (bytes memory selectors);

Returns

NameTypeDescription
selectorsbytes