Keep3r V2
  • Introduction
  • Core
    • Jobs
    • Keepers
  • Roles
    • Governance
    • Slasher
    • Disputer
  • Tokenomics
    • Keep3r Liquidity Pools
    • Job Payment Mechanisms
      • Credit Mining
      • Token Payments
  • CLI
    • Overview
  • Technical
    • peripherals
      • IKeep3rJobFundableLiquidity
      • IKeep3rJobs
      • IKeep3rJobOwnership
      • IKeep3rKeeperFundable
      • IKeep3rJobMigration
      • IKeep3rJobManager
      • IKeep3rKeeperDisputable
      • IKeep3rJobWorkable
      • IKeep3rParameters
      • IGovernable
      • IKeep3rKeepers
      • IKeep3rRoles
      • IKeep3rAccountance
      • IKeep3rJobFundableCredits
      • IKeep3rDisputable
      • IKeep3rJobDisputable
    • external
      • IKeep3rV1Proxy
      • IKeep3rGovernance
      • IMasterChefV2
      • IWeth9
      • IKeep3rV1
    • IKeep3rHelper
    • IPairManager
    • IPairFactory
    • IUniV3PairManager
    • IKeep3r
  • Registry
  • Github
  • Keep3r V1 Docs
Powered by GitBook
On this page
  • Add Tokens To Job
  • Withdraw Tokens From Job
  • Pay Keepers With Token Credits

Was this helpful?

  1. Tokenomics
  2. Job Payment Mechanisms

Token Payments

PreviousCredit MiningNextOverview

Last updated 3 years ago

Was this helpful?

Jobs as well can top-up their credits with ERC20 tokens, and then use them to reward keepers.

Add Tokens To Job

Anyone can add token credits to a job by approving a transfer of an ERC20 token and then calling:

/// @notice Add credit to a job to be paid out for work
/// @param _job The address of the job being credited
/// @param _token The address of the token being credited
/// @param _amount The amount of credit being added
function addTokenCreditsToJob(
  address _job,
  address _token,
  uint256 _amount
) external;

This function will give the job token credits in a 1:1 relation to the transferred ERC20 tokens. Job token credit balance can be checked calling:

/// @notice The current token credits available for a job
/// @return _amount The amount of token credits available for a job
function jobTokenCredits(address _job, address _token) external view returns (uint256 _amount);

The only way of adding KP3R credits to a job is by . Trying to add KP3R tokens by using addTokenCreditsToJob will revert.

Withdraw Tokens From Job

A job owner can withdraw tokens credits from a job by calling:

/// @notice Withdraw credit from a job
/// @param _job The address of the job from which the credits are withdrawn
/// @param _token The address of the token being withdrawn
/// @param _amount The amount of token to be withdrawn
/// @param _receiver The user that will receive tokens
function withdrawTokenCreditsFromJob(
  address _job,
  address _token,
  uint256 _amount,
  address _receiver
) external;

This function can revert if:

  • Job is disputed

  • Token credits were added to the job at most 1 minute before trying to withdraw

Pay Keepers With Token Credits

In order to reward keepers for their work with token credits jobs can call:

/// @notice Implemented by jobs to show that a keeper performed work
/// @dev Pays the keeper that performs the work with a specific token
/// @param _token The asset being awarded to the keeper
/// @param _keeper Address of the keeper that performed the work
/// @param _amount The reward that should be allocated
function directTokenPayment(
  address _token,
  address _keeper,
  uint256 _amount
) external;

Credit Mining