Checkers
Checker serves as a link between the terms and execution of smart contracts. His purpose? Check the conditions and determine whether automation should be performed.
Examples
CheckerBase.sol
The basic contract for any checker. Implements the logic to get the correct checker ID for each address. There is an implementation example in the CheckerBase.sol contract, which shows how to properly inherit CheckerBase. Checkers uses msg.sender for automation AccessControl.
CheckerAaveHF.sol
An example of the implementation of a checker that checks HealthFactor in the Aave pool. The testing and basic principles of CheckerAaveHF.sol are developed in the CheckerAaveHF.t.sol file.
CheckerTime.sol
An example of the implementation of a checker that performs a time check. For example, you want to do automation no more than once an hour. The testing and basic principles of CheckerTime.sol are developed in the CheckerTime.t.sol file.
How to create a checker
Сreate your own Checker in a few simple steps:
Inherit the basic contract for Checker, then define the data structure required for check:
Write a function for initialization that will accept the conditions for check:
Write the main function to check:
Learn more about how this example works:
Checker workflow:
Last updated