Skip to content

Instantly share code, notes, and snippets.

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

New job: VaultKeep3rJob https://etherscan.io/address/0x4a479E4457841D2D2Ff86e5A5389300963880C10#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 vaults = await VaultKeep3rJob.callStatic.vaults(); for (const vault of vaults) { const workable = await VaultKeep3rJob.callStatic.workable(vault); console.log({ vault, workable }); if (!workable) continue; await VaultKeep3rJob.connect(keeper).callStatic.work(vault); await VaultKeep3rJob.connect(keeper).work(vault); console.log('worked!'); }

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