Contents
- IAutomationVault
- IAutomationVaultFactory
- IGelatoRelay
- IKeep3rBondedRelay
- IKeep3rRelay
- IOpenRelay
- IXKeeperMetadata
IAutomationVault
Functions
owner
Returns the owner address
function owner() external view returns (address _owner);
Returns
Name | Type | Description |
---|---|---|
_owner | address | The address of the owner |
NATIVE_TOKEN
Returns the address of the native token
function NATIVE_TOKEN() external view returns (address _nativeToken);
Returns
Name | Type | Description |
---|---|---|
_nativeToken | address | The address of the native token |
pendingOwner
Returns the pending owner address
function pendingOwner() external view returns (address _pendingOwner);
Returns
Name | Type | Description |
---|---|---|
_pendingOwner | address | The address of the pending owner |
getRelayData
Returns the approved relay callers and selectors for a specific relay and job
function getRelayData(address _relay)
external
returns (address[] memory _callers, IAutomationVault.JobData[] memory _jobsData);
Parameters
Name | Type | Description |
---|---|---|
_relay | address | The address of the relay |
Returns
Name | Type | Description |
---|---|---|
_callers | address[] | The array of approved relay callers |
_jobsData | IAutomationVault.JobData[] | The array of approved jobs and selectors |
relays
Returns the approved relays
function relays() external view returns (address[] memory _listRelays);
Returns
Name | Type | Description |
---|---|---|
_listRelays | address[] | The array of approved relays |
changeOwner
Propose a new owner for the contract
The new owner will need to accept the ownership before it is transferred
function changeOwner(address _pendingOwner) external;
Parameters
Name | Type | Description |
---|---|---|
_pendingOwner | address | The address of the new owner |
acceptOwner
Accepts the ownership of the contract
function acceptOwner() external;
withdrawFunds
Withdraws funds deposited in the contract
Only the owner can call this function
function withdrawFunds(address _token, uint256 _amount, address _receiver) external;
Parameters
Name | Type | Description |
---|---|---|
_token | address | The address of the token |
_amount | uint256 | The amount of tokens |
_receiver | address | The address of the receiver |
addRelay
Add a new relay to the automation vault with the desired callers, jobs and selectors
If the relay is valid, it can be passed with all the fields or only the necessary ones, passing the empty argument in the unwanted ones
function addRelay(address _relay, address[] calldata _callers, IAutomationVault.JobData[] calldata _jobsData) external;
Parameters
Name | Type | Description |
---|---|---|
_relay | address | The address of the relay |
_callers | address[] | The array of callers |
_jobsData | IAutomationVault.JobData[] | The array of job data |
deleteRelay
Revokes the approval of a specific relay
The callers, jobs and selectors will be deleted
function deleteRelay(address _relay) external;
Parameters
Name | Type | Description |
---|---|---|
_relay | address | The address of the relay |
modifyRelay
Modify the callers, jobs and selectors of a specific relay
If any of the arguments is empty, the data will be deleted
function modifyRelay(
address _relay,
address[] calldata _callers,
IAutomationVault.JobData[] calldata _jobsData
) external;
Parameters
Name | Type | Description |
---|---|---|
_relay | address | The address of the relay |
_callers | address[] | The array of callers |
_jobsData | IAutomationVault.JobData[] | The array of job data |
modifyRelayCallers
Modify the callers of a specific relay
If the array is empty, the data will be deleted
function modifyRelayCallers(address _relay, address[] calldata _callers) external;
Parameters
Name | Type | Description |
---|---|---|
_relay | address | The address of the relay |
_callers | address[] | The array of callers |
modifyRelayJobs
Modify the jobs and selectors of a specific relay
If the array is empty, the data will be deleted, also if the function selectors array is empty
function modifyRelayJobs(address _relay, IAutomationVault.JobData[] calldata _jobsData) external;
Parameters
Name | Type | Description |
---|---|---|
_relay | address | The address of the relay |
_jobsData | IAutomationVault.JobData[] | The array of job data |
exec
Executes a job and issues a payment to the fee data receivers
The function can be called with only execData, only feeData or both. The strategy of the payment will be different depending on which relay is calling the function
function exec(address _relayCaller, ExecData[] calldata _execData, FeeData[] calldata _feeData) external;
Parameters
Name | Type | Description |
---|---|---|
_relayCaller | address | The address of the relay caller |
_execData | ExecData[] | The array of exec data |
_feeData | FeeData[] | The array of fee data |
Events
ChangeOwner
Emitted when the owner is proposed to change
event ChangeOwner(address indexed _pendingOwner);
Parameters
Name | Type | Description |
---|---|---|
_pendingOwner | address | The address that is being proposed |
AcceptOwner
Emitted when the owner is accepted
event AcceptOwner(address indexed _owner);
Parameters
Name | Type | Description |
---|---|---|
_owner | address | The address of the new owner |
WithdrawFunds
Emitted when funds are withdrawn
event WithdrawFunds(address indexed _token, uint256 _amount, address indexed _receiver);
Parameters
Name | Type | Description |
---|---|---|
_token | address | The address of the token |
_amount | uint256 | The amount of tokens |
_receiver | address | The address of the receiver |
ApproveRelay
Emitted when a relay is approved
event ApproveRelay(address indexed _relay);
Parameters
Name | Type | Description |
---|---|---|
_relay | address | The address of the relay |
DeleteRelay
Emitted when a relay is deleted
event DeleteRelay(address indexed _relay);
Parameters
Name | Type | Description |
---|---|---|
_relay | address | The address of the relay |
ApproveRelayCaller
Emitted when a relay caller is approved
event ApproveRelayCaller(address indexed _relay, address indexed _caller);
Parameters
Name | Type | Description |
---|---|---|
_relay | address | The address of the relay |
_caller | address | The address of the caller |
ApproveJob
Emitted when job is approved
event ApproveJob(address indexed _job);
Parameters
Name | Type | Description |
---|---|---|
_job | address | The address of the job |
ApproveJobSelector
Emitted when job selector is approved
event ApproveJobSelector(address indexed _job, bytes4 indexed _functionSelector);
Parameters
Name | Type | Description |
---|---|---|
_job | address | The address of the job |
_functionSelector | bytes4 | The function selector |
JobExecuted
Emitted when a job is executed
event JobExecuted(address indexed _relay, address indexed _relayCaller, address indexed _job, bytes _jobData);
Parameters
Name | Type | Description |
---|---|---|
_relay | address | The relay address |
_relayCaller | address | The relay caller address |
_job | address | The address of the job |
_jobData | bytes | The data to execute the job |
IssuePayment
Emitted when a payment is issued
event IssuePayment(
address indexed _relay, address indexed _relayCaller, address indexed _feeRecipient, address _feeToken, uint256 _fee
);
Parameters
Name | Type | Description |
---|---|---|
_relay | address | The relay address |
_relayCaller | address | The relay caller address |
_feeRecipient | address | The recipient address which will receive the fee |
_feeToken | address | The address of the token |
_fee | uint256 | The amount of tokens |
NativeTokenReceived
Emitted when native token is received in the automation vault
event NativeTokenReceived(address indexed _sender, uint256 _amount);
Parameters
Name | Type | Description |
---|---|---|
_sender | address | The sender address |
_amount | uint256 | The amount of native token |
Errors
AutomationVault_RelayZero
Thrown when the the relay is the zero address
error AutomationVault_RelayZero();
AutomationVault_RelayAlreadyApproved
Thrown when the relay is already approved
error AutomationVault_RelayAlreadyApproved();
AutomationVault_NativeTokenTransferFailed
Thrown when ether transfer fails
error AutomationVault_NativeTokenTransferFailed();
AutomationVault_NotApprovedRelayCaller
Thrown when a not approved relay caller is trying to execute a job
error AutomationVault_NotApprovedRelayCaller();
AutomationVault_NotApprovedJobSelector
Thrown when a not approved job selector is trying to be executed
error AutomationVault_NotApprovedJobSelector();
AutomationVault_ExecFailed
Thrown when a job execution fails
error AutomationVault_ExecFailed();
AutomationVault_OnlyOwner
Thrown when the caller is not the owner
error AutomationVault_OnlyOwner();
AutomationVault_OnlyPendingOwner
Thrown when the caller is not the pending owner
error AutomationVault_OnlyPendingOwner();
Structs
ExecData
The data to execute a job
struct ExecData {
address job;
bytes jobData;
}
Properties
Name | Type | Description |
---|---|---|
job | address | The address of the job |
jobData | bytes | The data to execute the job |
FeeData
The data to issue a payment
struct FeeData {
address feeRecipient;
address feeToken;
uint256 fee;
}
Properties
Name | Type | Description |
---|---|---|
feeRecipient | address | The recipient address which will receive the fee |
feeToken | address | The address of the token |
fee | uint256 | The amount of tokens |
JobData
The data of a job
struct JobData {
address job;
bytes4[] functionSelectors;
}
Properties
Name | Type | Description |
---|---|---|
job | address | The address of the job |
functionSelectors | bytes4[] | The array of function selectors |
IAutomationVaultFactory
Functions
totalAutomationVaults
Get the total amount of automation vaults deployed by the factory
function totalAutomationVaults() external view returns (uint256 _totalAutomationVaults);
Returns
Name | Type | Description |
---|---|---|
_totalAutomationVaults | uint256 | The total amount of automation vaults deployed |
automationVaults
Get a certain amount of automation vaults deployed by the factory
function automationVaults(uint256 _startFrom, uint256 _amount) external view returns (address[] memory _list);
Parameters
Name | Type | Description |
---|---|---|
_startFrom | uint256 | Index from where to start retrieving automation vaults |
_amount | uint256 | Amount of automation vaults to retrieve |
Returns
Name | Type | Description |
---|---|---|
_list | address[] | The array of automation vaults |
deployAutomationVault
Deploy a new automation vault
function deployAutomationVault(
address _owner,
address _nativeToken,
uint256 _salt
) external returns (IAutomationVault _automationVault);
Parameters
Name | Type | Description |
---|---|---|
_owner | address | The address of the owner |
_nativeToken | address | The address of the native token |
_salt | uint256 | The salt to use for the automation vault deployment |
Returns
Name | Type | Description |
---|---|---|
_automationVault | IAutomationVault | The address of the automation vault deployed |
Events
DeployAutomationVault
Emitted when a new automation vault is deployed
event DeployAutomationVault(address indexed _owner, address indexed _automationVault);
Parameters
Name | Type | Description |
---|---|---|
_owner | address | The address of the owner |
_automationVault | address | The address of the automation vault deployed |
Errors
AutomationVaultFactory_Create2Failed
Thrown when the automation vault factory fails to deploy a new automation vault
error AutomationVaultFactory_Create2Failed();
IGelatoRelay
Functions
automate
Returns the automate contract of the gelato network
function automate() external view returns (IAutomate _automate);
Returns
Name | Type | Description |
---|---|---|
_automate | IAutomate | The address of the automate contract |
gelato
Returns the gelato contract of the gelato network
function gelato() external view returns (IGelato _gelato);
Returns
Name | Type | Description |
---|---|---|
_gelato | IGelato | The address of the gelato contract |
feeCollector
Returns the fee collector of the gelato network
function feeCollector() external view returns (address _feeCollector);
Returns
Name | Type | Description |
---|---|---|
_feeCollector | address | The address of the fee collector |
exec
Execute an automation vault which will execute the jobs and will manage the payment to the fee data receivers
function exec(IAutomationVault _automationVault, IAutomationVault.ExecData[] calldata _execData) external;
Parameters
Name | Type | Description |
---|---|---|
_automationVault | IAutomationVault | The automation vault that will be executed |
_execData | IAutomationVault.ExecData[] | The array of exec data |
Events
AutomationVaultExecuted
Emitted when an automation vault is executed
event AutomationVaultExecuted(
address indexed _automationVault,
address indexed _relayCaller,
IAutomationVault.ExecData[] _execData,
IAutomationVault.FeeData[] _feeData
);
Parameters
Name | Type | Description |
---|---|---|
_automationVault | address | The address of the automation vault |
_relayCaller | address | The address of the relay caller |
_execData | IAutomationVault.ExecData[] | The array of exec data |
_feeData | IAutomationVault.FeeData[] | The array of fee data |
IKeep3rBondedRelay
Inherits: IKeep3rRelay
Functions
automationVaultRequirements
Get the automation vault bonded requirements
function automationVaultRequirements(IAutomationVault _automationVault)
external
view
returns (address _bond, uint256 _minBond, uint256 _earned, uint256 _age);
Parameters
Name | Type | Description |
---|---|---|
_automationVault | IAutomationVault | The automation vault |
Returns
Name | Type | Description |
---|---|---|
_bond | address | The bond token being evaluated |
_minBond | uint256 | The minimum amount of bonded tokens |
_earned | uint256 | The minimum funds earned in the keepers lifetime |
_age | uint256 | The minimum keeper age required |
setAutomationVaultRequirements
Set the automation vault requirements when bonded job is required
Only the owner of the automation vault can set the requirements
function setAutomationVaultRequirements(
IAutomationVault _automationVault,
IKeep3rBondedRelay.Requirements memory _requirements
) external;
Parameters
Name | Type | Description |
---|---|---|
_automationVault | IAutomationVault | The automation vault that will be executed |
_requirements | IKeep3rBondedRelay.Requirements | The requirements needed when bonded job is required |
Events
AutomationVaultRequirementsSetted
Emitted when the automation vault requirements are setted
event AutomationVaultRequirementsSetted(
address indexed _automationVault, address _bond, uint256 _minBond, uint256 _earned, uint256 _age
);
Parameters
Name | Type | Description |
---|---|---|
_automationVault | address | The address of the automation vault |
_bond | address | The bond token being evaluated |
_minBond | uint256 | The minimum amount of bonded tokens |
_earned | uint256 | The minimum funds earned in the keepers lifetime |
_age | uint256 | The minimum keeper age required |
Errors
Keep3rBondedRelay_NotVaultOwner
Thrown when the caller is not the automation vault owner
error Keep3rBondedRelay_NotVaultOwner();
Keep3rBondedRelay_NotAutomationVaultRequirement
Thrown when the automation vault requirements are not setted
error Keep3rBondedRelay_NotAutomationVaultRequirement();
Keep3rBondedRelay_NotBondedKeeper
Thrown when the keeper doesn't meet the requirements set by the automation vault
error Keep3rBondedRelay_NotBondedKeeper();
Structs
Requirements
The requirements needed when bonded job is required
struct Requirements {
address bond;
uint256 minBond;
uint256 earned;
uint256 age;
}
Properties
Name | Type | Description |
---|---|---|
bond | address | |
minBond | uint256 | |
earned | uint256 | |
age | uint256 |
IKeep3rRelay
Functions
exec
Execute an automation vault which will execute the jobs and will manage the payment to the fee data receivers
The payment will be managed by keep3r network. The first and last exec data are assembled by the relay in order to be able to work with keep3r network
function exec(IAutomationVault _automationVault, IAutomationVault.ExecData[] calldata _execData) external;
Parameters
Name | Type | Description |
---|---|---|
_automationVault | IAutomationVault | The automation vault that will be executed |
_execData | IAutomationVault.ExecData[] | The array of exec data |
Events
AutomationVaultExecuted
Emitted when an automation vault is executed
event AutomationVaultExecuted(
address indexed _automationVault, address indexed _relayCaller, IAutomationVault.ExecData[] _execData
);
Parameters
Name | Type | Description |
---|---|---|
_automationVault | address | The address of the automation vault |
_relayCaller | address | The address of the relay caller |
_execData | IAutomationVault.ExecData[] | The array of exec data |
Errors
Keep3rRelay_NoExecData
Thrown when the exec data is empty
error Keep3rRelay_NoExecData();
Keep3rRelay_NotKeeper
Thrown when the caller is not a keeper
error Keep3rRelay_NotKeeper();
Keep3rRelay_Keep3rNotAllowed
Thrown when the exec data contains Keep3r V2
error Keep3rRelay_Keep3rNotAllowed();
IOpenRelay
Functions
GAS_BONUS
Returns the gas bonus
function GAS_BONUS() external view returns (uint256 _gasBonus);
Returns
Name | Type | Description |
---|---|---|
_gasBonus | uint256 | The value of the gas bonus |
GAS_MULTIPLIER
Returns the gas multiplier
function GAS_MULTIPLIER() external view returns (uint256 _gasMultiplier);
Returns
Name | Type | Description |
---|---|---|
_gasMultiplier | uint256 | The value of the gas multiplier |
BASE
Returns the base used for the payment calculation
function BASE() external view returns (uint32 _base);
Returns
Name | Type | Description |
---|---|---|
_base | uint32 | The value of the base |
exec
Execute an automation vault which will execute the jobs and will manage the payment to the fee data receivers
The payment will be calculated on the basis of several variables like the gas spent, the base fee, the gas bonus and the gas multiplier
function exec(
IAutomationVault _automationVault,
IAutomationVault.ExecData[] calldata _execData,
address _feeRecipient
) external;
Parameters
Name | Type | Description |
---|---|---|
_automationVault | IAutomationVault | The automation vault that will be executed |
_execData | IAutomationVault.ExecData[] | The array of exec data |
_feeRecipient | address | The address of the fee recipient |
Events
AutomationVaultExecuted
Emitted when an automation vault is executed
event AutomationVaultExecuted(
address indexed _automationVault,
address indexed _relayCaller,
IAutomationVault.ExecData[] _execData,
IAutomationVault.FeeData[] _feeData
);
Parameters
Name | Type | Description |
---|---|---|
_automationVault | address | The address of the automation vault |
_relayCaller | address | The address of the relay caller |
_execData | IAutomationVault.ExecData[] | The array of exec data |
_feeData | IAutomationVault.FeeData[] | The array of fee data |
Errors
OpenRelay_NoExecData
Thrown when the exec data is empty
error OpenRelay_NoExecData();
IXKeeperMetadata
Functions
automationVaultMetadata
Returns the metadata of the automation vault
function automationVaultMetadata(IAutomationVault _automationVault)
external
view
returns (string calldata _name, string calldata _description);
Parameters
Name | Type | Description |
---|---|---|
_automationVault | IAutomationVault | The automation vault |
Returns
Name | Type | Description |
---|---|---|
_name | string | The name of the automation vault |
_description | string | The description of the automation vault |
automationVaultsMetadata
Returns the metadata of the automation vault
function automationVaultsMetadata(IAutomationVault[] calldata _automationVault)
external
view
returns (IXKeeperMetadata.AutomationVaultMetadata[] memory _metadata);
Parameters
Name | Type | Description |
---|---|---|
_automationVault | IAutomationVault[] | The automation vaults |
Returns
Name | Type | Description |
---|---|---|
_metadata | IXKeeperMetadata.AutomationVaultMetadata[] | The metadata of the automation vault |
setAutomationVaultMetadata
Sets the metadata of the automation vault
function setAutomationVaultMetadata(
IAutomationVault _automationVault,
AutomationVaultMetadata calldata _automationVaultMetadata
) external;
Parameters
Name | Type | Description |
---|---|---|
_automationVault | IAutomationVault | The automation vault |
_automationVaultMetadata | AutomationVaultMetadata | The metadata of the automation vault |
Events
AutomationVaultMetadataSetted
Emitted when the metadata of an automation vault is set
event AutomationVaultMetadataSetted(IAutomationVault indexed _automationVault, string _name, string _description);
Parameters
Name | Type | Description |
---|---|---|
_automationVault | IAutomationVault | The automation vault |
_name | string | The name of the automation vault |
_description | string | The description of the automation vault |
Errors
XKeeperMetadata_OnlyAutomationVaultOwner
The caller is not the owner of the automation vault
error XKeeperMetadata_OnlyAutomationVaultOwner();
Structs
AutomationVaultMetadata
The metadata of the automation vault
struct AutomationVaultMetadata {
string name;
string description;
}
Properties
Name | Type | Description |
---|---|---|
name | string | |
description | string |