Keep3r Network: Setting up a contract to act as a job

Andre Cronje
Oct 28, 2020

Define an interface for Keep3rV1

interface IKeep3rV1 {
function isKeeper(address) external returns (bool);
function worked(address keeper) external;

Set the Keep3rV1 instance

IKeep3rV1 public constant KP3R = IKeep3rV1(0x1cEB5cB57C4D4E2b2433641b95Dd330A33185A44);

Add the following modifier

modifier upkeep() {
require(KP3R.isKeeper(msg.sender), "_msg");

Set the modifier on the functions you would like to be managed by keepers;

function liquidate(address _collateral, address _reserve, uint _repay, address _user) external upkeep {

And you are done. Now simply add the contract as a job in and you can get keepers to execute transactions for you.

To learn more;