yearn / yearn-protocol

Yearn smart contracts
https://yearn.finance
GNU Affero General Public License v3.0
441 stars 211 forks source link

YRegistryV2.sol Abstract vault validation and info mapping to external contract. #58

Closed lbertenasco closed 3 years ago

lbertenasco commented 3 years ago

Work on PR #56 or directly on YRegistryV2.sol after PR is merged.

The idea is to merge addVault(address _vault) , addWrappedVault(address _vault) and addDelegatedVault(address _vault) into a single addVault(address _vault, string _type).

Where _type will be mapped to an external contract that will have all specifics on how to handle that type of vault/strategy.

We'd also need to add addType(string _type, address _wrapper) governance function.

IRegistryVault will need to have:

We might also want to create an abstract RegistryVault for v2 design so new vaults would implement this directly without the need for a wrapper.

Plus, we should talk with all contracts/backend/frontend teams to define what getVaultInfo should return :)

knarz commented 3 years ago

Cool, I could probably work on this. Who'd be best to chime in wrt data that should be returned?

lbertenasco commented 3 years ago

Cool, I could probably work on this. Who'd be best to chime in wrt data that should be returned?

@knarz You can find @x48 on discord and ping him about this. Doggie or me are also available if you need details on V2

ghost commented 3 years ago

@knarz this is a good starting point:

.vaultAddress
.vaultName
.vaultSymbol
.vaultVersion
.tokenAddress
.tokenName
.tokenSymbol
.tokenDecimals
.strategyAddress
.strategyName
.strategyVersion
.controllerAddress
.controllerName
.controllerVersion
.isWrapped
.isDelegated
ghost commented 3 years ago

@knarz also see #11

lbertenasco commented 3 years ago

@knarz and @x48-crypto : Doggie just created a Registry(feat/registry) branch on the V2 repo https://github.com/iearn-finance/yearn-vaults/compare/feat/registry Let's move there and build on top of that :)