This guide explains the use cases for Keeper utility contracts and specifically for the
EthBalanceMonitor contract. This Keeper contract monitors and funds Ethereum addresses that developers might need to top up frequently based on a configurable threshold. As a result, nodes are funded automatically.
After deploying the contract, developers can go to keepers.chain.link to register Upkeep and run the contract. To take full advantage of the Keepers automation infrastructure, read all of the documentation to understand the features of Chainlink Keepers.
Table of Contents
EthBalanceMonitor is ownable, pausable, and Keeper-compatible:
KeeperCompatibleInterfaceis necessary to create Keeper-compatible contracts. To learn more about the
KeeperCompatibleInterfaceand its uses and functions, refer to Making Keeper-compatible Contracts.
️ Note on Owner Settings
Aside from certain features listed below, only owners can withdraw funds and pause or unpause the contract. If the contract is paused or unpaused, it will affect
Functions with an asterisk (
*) denote features that only the owner can change. Click on each function to learn more about its parameters and design patterns:
|Addresses to watch minimum balance and how much to top it up.|
|Updates the |
|Updates the global minimum period between top ups.|
|Used by |
Below are the feed functions in
|Read Function Name||Description|
|View function used in |
|Views the |
|Views the global minimum period between top ups.|
|Views addresses to watch minimum balance and how much to top it up.|
|Provides information about the specific target address, including the last time it was topped up. This function is external only.|
|The list of addresses to watch||(not applicable)|
|The minimum balances for each address||5000000000000000000 (5 ETH)|
|The amount to top up each address||5000000000000000000 (5 ETH)|
Only the owner can
setWatchList. Each of the parameters should be set with distinct requirements for each address.
|Address that requires updating in |
performUpkeep, which is a global setting.
KeeperRegistry addresses can be found on the Keepers app. However, only the owner can set a new
KeeperRegistry after deployment.
|Minimum wait period (in seconds) for addresses between funding||3600 (1 hour)|
period denotes the length of time between top ups for a specific address. This is a global setting that prevents draining of funds from the contract if the private key for an address is compromised or if a gas spike occurs. However, only the owner can set a different minimum wait period after deployment.
|List of addresses to fund (addresses must be pre-approved)|
Any address can trigger the
topUp function. This is an intentional design pattern that shows how easy it is to make an existing contract Keeper-compatible while maintaining an open interface. All validations are performed before the funding is triggered. If the conditions are not met, any attempt to top up will revert.