UniswapV2Oracle has been replaced by UniswapV2SlidingOracle

UniswapV2Oracle has been replaced by UniswapV2SlidingOracle. Do we have to change the autotask code ?

1 Like

Hi @TheyCallMeSecond,

Welcome to the community :wave:

Yes, as new jobs are added/removed then you will need to update the autotask code to add and remove.

We will also need to update the example to change from UniswapV2Oracle to UniswapV2SlidingOracle.

The new job is UniswapV2SlidingOracle: https://keep3r.network/keep3r/job/0xCA2E2df6A7a7Cf5bd19D112E8568910a6C2D3885

2 Likes

The ABI constants for the new

UniswapV2SlidingOracle

did not change though ?

1 Like

Just change the name & contract address in your guide doc autotask code,right?

1 Like

Hi @Mash and @TheyCallMeSecond,

You would need to add the ABI and the Job and remove the old ABI and Job.

Existing example:

// ABIs for jobs and registry (contain only the methods needed, not the full ABIs of the contracts)
const ABIs = {
  UniswapOracleV2: [{"inputs":[],"name":"updateable","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"work","outputs":[],"stateMutability":"nonpayable","type":"function"}],
  HegicPoolKeep3r: [{"inputs":[],"name":"workable","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimRewards","outputs":[],"stateMutability":"nonpayable","type":"function"}],
  YearnV1EarnKeep3r: [{"inputs":[],"name":"work","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"workable","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}],
  Registry: [{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"keepers","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"bonding","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"bond","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"bondings","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"bonding","type":"address"}],"name":"activate","outputs":[],"stateMutability":"nonpayable","type":"function"}],
}

// Definition for all jobs to execute
const Jobs = [
  { name: 'UniswapOracleV2',   address: '0x127a2975c4E1c75f1ed4757a861bbd42523DB035', workableFn: 'updateable', workFn: 'work' },
  { name: 'HegicPoolKeep3r',   address: '0x5DDe926b0A31346f2485900C5e64c2577F43F774', workableFn: 'workable',   workFn: 'claimRewards' },
  { name: 'YearnV1EarnKeep3r', address: '0xe7F4ab593aeC81EcA754Da1B3B7cE0C42a13Ec0C', workableFn: 'workable',   workFn: 'work' },
];
1 Like

Thanks mate, but Where can I find new jobs ABI?

1 Like

I made it by myself, replaced the contact address, name and “updatable” to “workable”.
By the way, I am not confident with what I did. Is there anything else to change?

1 Like

Why updatable to workable???

1 Like

Because updatable is replace by workable in new contract, slidingOracle.

You can also find full details of autotask here.

This is the ABI from the etherscan:
,“name”:“workable”,“outputs”:[{“internalType”:“bool”,“name”:"",“type”:“bool”}],“stateMutability”:“view”,“type”:“function”},{“inputs”:

2 Likes

6 posts were split to a new topic: Request-Rate Exceeded

We have just updated the guide to reflect this change, after confirming with Andre that the UniswapV2SlidingOracle has replaced the previous one.

You can check out the new code here. Just edit your autotask, and replace the old code with the new one.

5 Likes

Thank you for the update!
I did not get an error but never got to work after a day of autotask, probably the code I modified was doing something wrong. I hope it works this time :slight_smile:

1 Like

Thanks for the update!

1 Like

@spalladino so the one in your doc is not correct.

1 Like

It seems the UniswapV2SlidingOracle job is at a different address according to https://docs.keep3r.network/registry.
I’ve just updated the docs to reflect the change. You will have to update your script as well.

0xca2e2df6a7a7cf5bd19d112e8568910a6c2d3885 => 0xd20b88Ca8bF84Ca829f7A9Cf0eC64e2bFE91c204

1 Like

craps I didn't check before to ask. sorry

1 Like

Hey, if you hadn’t asked I wouldn’t have noticed it and updated it! Thanks for bringing it up!

2 Likes

Hi @hiro, @TheyCallMeSecond, @Mash, @katmai,

The documentation has been updated to reflect the UniswapV2SlidingOracle address:
https://docs.openzeppelin.com/defender/guide-keep3r

You may want to check that you have the appropriate address:

Thanks @Bolo :pray:

A post was split to a new topic: Can we add a version to the autotask script in the documentation?