IChainlinkAutomationAdapter
Title: IChainlinkAutomationAdapter
Author: Modified from Chainlink (https://github.com/smartcontractkit/chainlink-evm)
Interface for the ChainlinkAutomationAdapter Diamond facet — Chainlink Automation (keepers), consumer side.
Implements the Chainlink AutomationCompatibleInterface consumer surface with a canonical
time-interval upkeep: checkUpkeep reports true once interval seconds have elapsed, and
performUpkeep (gated to the configured Automation forwarder) advances the counter and resets
the timer. The upkeep condition is re-validated inside performUpkeep — performData is never
trusted blindly.
DECISION (recorded): this ships the consumer-side compatible facet only. The optional
AutomationRegistrar/AutomationRegistry on-chain registration + LINK-funding surface is a
separate concern and intentionally left as a future follow-up.
Functions
getForwarder
Returns the configured Automation forwarder.
function getForwarder() external view returns (address);Returns
| Name | Type | Description |
|---|---|---|
| <none> | address |
getInterval
Returns the configured upkeep interval (seconds).
function getInterval() external view returns (uint256);Returns
| Name | Type | Description |
|---|---|---|
| <none> | uint256 |
getLastTimeStamp
Returns the timestamp of the last performed upkeep.
function getLastTimeStamp() external view returns (uint256);Returns
| Name | Type | Description |
|---|---|---|
| <none> | uint256 |
getCounter
Returns the number of upkeeps performed.
function getCounter() external view returns (uint256);Returns
| Name | Type | Description |
|---|---|---|
| <none> | uint256 |
checkUpkeep
Reports whether the upkeep should run.
Returns true once interval seconds have elapsed since the last upkeep. performData
echoes checkData.
function checkUpkeep(bytes calldata checkData) external view returns (bool upkeepNeeded, bytes memory performData);Parameters
| Name | Type | Description |
|---|---|---|
| checkData | bytes | Arbitrary data configured on the upkeep. |
Returns
| Name | Type | Description |
|---|---|---|
| upkeepNeeded | bool | True if performUpkeep should be called. |
| performData | bytes | The data to pass to performUpkeep. |
setConfig
Sets or replaces the Automation configuration and resets the upkeep timer.
Caller must hold DEFAULT_ADMIN_ROLE. Reverts ChainlinkAutomationInvalidConfig on a zero
forwarder or zero interval.
function setConfig(address forwarder, uint256 interval) external;Parameters
| Name | Type | Description |
|---|---|---|
| forwarder | address | The Automation forwarder allowed to call performUpkeep. |
| interval | uint256 | The minimum seconds between upkeeps. |
performUpkeep
Performs the upkeep. Gated to the configured forwarder.
Re-validates that interval seconds have elapsed (reverts ChainlinkAutomationConditionNotMet
otherwise), advances the counter, resets the timer, and emits UpkeepPerformed.
function performUpkeep(bytes calldata performData) external;Parameters
| Name | Type | Description |
|---|---|---|
| performData | bytes | The data returned by checkUpkeep (unused by the reference upkeep). |
Events
ChainlinkAutomationConfigSet
Emitted when the Automation configuration is updated.
event ChainlinkAutomationConfigSet(address forwarder, uint256 interval);Parameters
| Name | Type | Description |
|---|---|---|
| forwarder | address | The Automation forwarder allowed to call performUpkeep. |
| interval | uint256 | The minimum seconds between upkeeps. |
UpkeepPerformed
Emitted when an upkeep is performed.
event UpkeepPerformed(uint256 counter);Parameters
| Name | Type | Description |
|---|---|---|
| counter | uint256 | The new upkeep counter value. |
Errors
ChainlinkAutomationNotConfigured
Automation has not been configured (forwarder address is zero).
error ChainlinkAutomationNotConfigured();ChainlinkAutomationInvalidConfig
setConfig was called with a zero forwarder or zero interval.
error ChainlinkAutomationInvalidConfig();ChainlinkAutomationOnlyForwarder
performUpkeep was called by an address other than the configured forwarder.
error ChainlinkAutomationOnlyForwarder(address caller);Parameters
| Name | Type | Description |
|---|---|---|
| caller | address | The unauthorised caller. |
ChainlinkAutomationConditionNotMet
performUpkeep was called before the upkeep interval had elapsed.
error ChainlinkAutomationConditionNotMet();