Skip to content

Add Automatic Contract Checks to V2 Vaults #555

@rossgalloway

Description

@rossgalloway

We already have automatic checks for V3 vaults that confirm the registries and other key contracts. We also have checks for the veYFI gauges. It would be beneficial to extend these checks to also confirm V2 contract addresses are correct.

Flow for the existing checks:

  • In the /scripts folder there is a script called runAddressChecks that checks contracts pulled from RPC calls against a constants file with contract addresses. This script is run on every dev run (yarn start). https://github.com/yearn/yearn-devdocs/tree/master/scripts
  • The constants.ts file is located in /src/ethereum and contains important addresses and info. This is where V2 vault registry contracts would live. See the addresses here: https://docs.yearn.fi/developers/addresses/v2-contracts and here: https://docs.yearn.fi/developers/wallet-integration#getting-v2-yvaults-manually
    • Vault Registry
    • Release registry
    • Health Check
    • Factory Contract
      Unlike V3, these are not the same for all chains, so they need to be added per chain. Ignore Fantom, as it is dead.
  • There are v3Calls.ts and v3Checks.ts files in /src/ethereum which can be used as a reference for the flow for the V2 calls and checks. The calls file makes RPC calls to get the addresses from registry contracts and ENS names. The checks file then compares those against the constants file.
  • The scripts file will then need to be updated to accept the V2 checks.

To be considered:

  • There isn't much to check since most v2 registries don't have ENS names and don't come from other contracts. So maybe this isn't super useful? or maybe It would be good to give all these registries ENS names that can be resolved, and if the registries change then we also change the ENS.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions