Skip to content

Instantly share code, notes, and snippets.

@andrecronje
Created March 28, 2021 06:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrecronje/57c503e87518a134fb1dff2efa29b747 to your computer and use it in GitHub Desktop.
Save andrecronje/57c503e87518a134fb1dff2efa29b747 to your computer and use it in GitHub Desktop.

New job: HarvestV2Keep3rJob https://etherscan.io/address/0x620bd1E1D1d845c8904aC03F6cd6b87706B7596b#code // Important! use callStatic for all methods (even workable and work) to avoid spending gas // only send work transaction if callStatic.work succeeded, // even if workable is true, the job might not have credits to pay and the work tx will revert const strategies = await HarvestV2Keep3rJob.callStatic.strategies(); for (const strategy of strategies) { const workable = await HarvestV2Keep3rJob.callStatic.workable(strategy); console.log({ strategy, workable }); if (!workable) continue; await HarvestV2Keep3rJob.connect(keeper).callStatic.work(strategy); await HarvestV2Keep3rJob.connect(keeper).work(strategy); console.log('worked!'); }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment