Open RedVeil opened 10 months ago
Task 1:
Create a deployVault
function that deploys a vault with an adapter and strategy (reference this function https://github.com/Popcorn-Limited/vaultcraft/blob/main/lib/vaults/deployVault.ts). Essentially just a wrapper around the contract write function
deployVault
and ruhums createVault
functiondeployVault
) given that you get all the data required for the call as input params as structs or already encoded.Task 2:
Create a deployVault
-function that only requires a chainId, asset, fees and strategyKey from the user and fetches + encodes all required data itself before deploying the vault.
getStrategyDefaults
in /pages/easy/basics.tsx (vaultcraft repo) to reuse the logic of fetching a strategy configencodeStrategyData
in /components/review/Review.tsx (vaultcraft repo) to reuse the logic of encoding or previously fetched strategy config.
The VaultFactory class should allow deployment for adapter and vaults. It should have a straight forward wrapper of the contract functions to deploy vault or adapter and more convience functions to get strategy defaults and encode data before actually deploying.
Use this PR as the basis: https://github.com/Popcorn-Limited/vaultcraft-sdk/pull/36 but move the function and test into a new VaultFactory class