// 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 jobs = await Keep3rLiquidityManagerJob.callStatic.jobs(); for (const job of jobs) { const workable = await Keep3rLiquidityManagerJob.callStatic.workable(job); console.log({ job, workable }); if (!workable) continue; await Keep3rLiquidityManagerJob.connect(keeper).callStatic.work(job); await Keep3rLiquidityManagerJob.connect(keeper).work(job); console.log('worked!'); }
Created
March 26, 2021 09:48
-
-
Save andrecronje/3ca7869c6216e309f40de1684a6c4b84 to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment