# Implement CrvStrategyKeep3r

**URL:** <https://gov.yearn.fi/t/implement-crvstrategykeep3r/7808>\
**Category:** Keep3r\
**Created:** [8 November 2020 11:32 UTC](https://gov.yearn.fi/t/implement-crvstrategykeep3r/7808 "2020-11-08T11:32:02Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![bolo](https://dub1.discourse-cdn.com/flex013/user_avatar/gov.yearn.fi/bolo/32/2368_2.png) [@bolo](https://gov.yearn.fi/u/bolo)\
**Post date:** [8 November 2020 11:32 UTC](https://gov.yearn.fi/t/implement-crvstrategykeep3r/7808/1 "2020-11-08T11:32:02Z")

</div>

Hey there.

I have tried to implement the script for “CrvStrategyKeep3r”. Script below returns me this error

**2020-11-08T11:25:29.390Z AUTOTASK START**  
**2020-11-08T11:25:34.289Z INFO workable**  
**2020-11-08T11:25:34.291Z INFO TypeError: contract.harvest(…) is not a function**  
\*\* at Runtime.exports.handler (/var/task/index.js:25:92)\*\*  
\*\* at processTicksAndRejections (internal/process/task\_queues.js:97:5)\*\*  
**2020-11-08T11:25:34.327Z AUTOTASK COMPLETE**

```
    const { ethers } = require("ethers");
    const { DefenderRelaySigner } = require('defender-relay-client/lib/ethers');
    // Settings edited by user
    const ABI = [
      {"inputs":[{"internalType":"address","name":"_strategy","type":"address"}],"name":"calculateHarvest","outputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},
      {"inputs":[{"internalType":"address","name":"_strategy","type":"address"}],"name":"harvest","outputs":[],"stateMutability":"nonpayable","type":"function"}
      {"inputs":[{"internalType":"address","name":"_strategy","type":"address"}],"name":"workable","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}];

    exports.handler = async function(credentials) {
      const provider = ethers.getDefaultProvider("mainnet", { 
        etherscan: "XXXXX",
        alchemy: "BXXXXxH",
        infura: {
          projectId: "XXXXX",
          projectSecret: "XXXX",
        },
      });
      const signer = new DefenderRelaySigner(credentials, provider, { speed: 'fastest' });
      const contract = new ethers.Contract('0xd0aC37E3524F295D141d3839d5ed5F26A40b589D', ABI , signer);
      
      if (await contract.workable('0xC59601F0CC49baa266891b7fc63d2D5FE097A79D')) {
            console.log(" workable");
            var overrideOptions = {}
            try {
                const tx = await contract.harvest('0xC59601F0CC49baa266891b7fc63d2D5FE097A79D')(overrideOptions)
                console.log(tx.hash);
            } catch(error) {
              console.log(error)
            }

        } else {
           console.log(" not workable");
        }
    }

```

Any will be really appriciate.

Ty

---

<div class="post-metadata">

**Author:** ![andre.cronje](https://dub1.discourse-cdn.com/flex013/user_avatar/gov.yearn.fi/andre.cronje/32/2283_2.png) [@andre.cronje](https://gov.yearn.fi/u/andre.cronje)\
**Post date:** [8 November 2020 12:39 UTC](https://gov.yearn.fi/t/implement-crvstrategykeep3r/7808/2 "2020-11-08T12:39:47Z")

</div>

Hey @bolo, `harvest()` function call takes the `strategy` being harvested as its input parameter.

For example `harvest(yBUSD)` which is `harvest(0x112570655b32A8c747845E0215ad139661e66E7F)`

Will still write a default demo script on how to harvest these, will confirm which ones have been approved by yearn.

---

<div class="post-metadata">

**Author:** ![bolo](https://dub1.discourse-cdn.com/flex013/user_avatar/gov.yearn.fi/bolo/32/2368_2.png) [@bolo](https://gov.yearn.fi/u/bolo)\
**Post date:** [8 November 2020 12:53 UTC](https://gov.yearn.fi/t/implement-crvstrategykeep3r/7808/3 "2020-11-08T12:53:22Z")

</div>

> [@andre.cronje](#):
>
> Will still write a default demo script on how to harvest these, will confirm which ones have been approved by yearn.

sounds perfect. I will wait for the demo.

---

<div class="post-metadata">

**Author:** ![bolo](https://dub1.discourse-cdn.com/flex013/user_avatar/gov.yearn.fi/bolo/32/2368_2.png) [@bolo](https://gov.yearn.fi/u/bolo)\
**Post date:** [14 November 2020 08:00 UTC](https://gov.yearn.fi/t/implement-crvstrategykeep3r/7808/4 "2020-11-14T08:00:41Z")

</div>

I was able to find few strategies and run my script with success . ty for your help

> <https://gist.github.com/bolom/be24ff718bf59bb991f816595acd7e08>

---

<div class="post-metadata">

**Author:** ![bolo](https://dub1.discourse-cdn.com/flex013/user_avatar/gov.yearn.fi/bolo/32/2368_2.png) [@bolo](https://gov.yearn.fi/u/bolo)\
**Post date:** [20 November 2020 19:00 UTC](https://gov.yearn.fi/t/implement-crvstrategykeep3r/7808/5 "2020-11-20T19:00:20Z")

</div>

4 jobs done with profit. I am very happy 🥰

I will suggest everyone to have in minimum 0.7 in your wallet to avoid the out of gas error.

---

<div class="post-metadata">

**Author:** ![GSD](https://avatars.discourse-cdn.com/v4/letter/g/82dd89/32.png) [@GSD](https://gov.yearn.fi/u/GSD)\
**Post date:** [3 December 2020 01:44 UTC](https://gov.yearn.fi/t/implement-crvstrategykeep3r/7808/6 "2020-12-03T01:44:02Z")

</div>

AUTOTASK START  
2020-12-02T19:40:47.566Z INFO not workable StrategyCurve3CrvVoterProxy  
2020-12-02T19:40:47.837Z INFO not workable StrategyCurveBTCVoterProxy  
2020-12-02T19:40:48.109Z INFO not workable StrategyCurveYVoterProxy  
2020-12-02T19:40:48.388Z INFO not workable StrategyCurveBUSDVoterProxy  
2020-12-02T19:40:48.753Z INFO not workable StrategyCurveGUSDProxy  
2020-12-02T19:40:49.022Z INFO not workable StrategyCurveCompoundVoterProxy  
END RequestId: e78b74ef-0110-4bd2-a303-1c1e654cf517  
AUTOTASK COMPLETE

What’s wrong?
