Skip to content

Instantly share code, notes, and snippets.

@andrecronje
Created March 28, 2021 06:10
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/ff1aba5624682fc2c3c27859f0997993 to your computer and use it in GitHub Desktop.
Save andrecronje/ff1aba5624682fc2c3c27859f0997993 to your computer and use it in GitHub Desktop.

New job: CrvStrategyKeep3rJob https://etherscan.io/address/0x02027bDA2425204f152B8aa35Fb78687D65E1AF5#code // Important! use callStatic for all methods (even 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 CrvStrategyKeep3rJob.callStatic.strategies(); for (const strategy of strategies) { const workable = await CrvStrategyKeep3rJob.callStatic.workable(strategy); console.log({ strategy, workable }); if (!workable) continue; await CrvStrategyKeep3rJob.connect(keeper).callStatic.work(strategy); await CrvStrategyKeep3rJob.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