From 727872a1d62db19b2e7353c954bbeb61fd9a854d Mon Sep 17 00:00:00 2001 From: waynebruce0x Date: Fri, 27 Dec 2024 12:00:54 +0000 Subject: [PATCH] zoth --- projects/zoth/index.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 projects/zoth/index.js diff --git a/projects/zoth/index.js b/projects/zoth/index.js new file mode 100644 index 000000000000..5719feac64ef --- /dev/null +++ b/projects/zoth/index.js @@ -0,0 +1,16 @@ +const vaultManagers = { + ethereum: "0x2f52C3664Ff2b12A1A8Bc7B6020C7E92DBa781aE", +} + +Object.keys(vaultManagers).forEach(chain => { + module.exports[chain] = { + tvl: async (api) => { + const { details } = await api.call({ abi, target: vaultManagers[chain], }) + details.map(({ collateralAddress, subVaultAddress }) => { + api.add(collateralAddress, subVaultAddress) + }) + } + } +}) + +const abi = { "inputs": [], "name": "getAllSubVaults", "outputs": [{ "internalType": "address[]", "name": "collaterals", "type": "address[]" }, { "components": [{ "internalType": "string", "name": "integrationType", "type": "string" }, { "internalType": "address", "name": "collateralAddress", "type": "address" }, { "internalType": "address", "name": "subVaultAddress", "type": "address" }, { "internalType": "uint256", "name": "price", "type": "uint256" }, { "internalType": "uint256", "name": "ltv", "type": "uint256" }, { "internalType": "bool", "name": "isActive", "type": "bool" }, { "internalType": "uint256", "name": "registeredAt", "type": "uint256" }, { "internalType": "uint256", "name": "lastUpdatedAt", "type": "uint256" }, { "internalType": "enum DataTypes.TokenType", "name": "tokenType", "type": "uint8" }], "internalType": "struct DataTypes.CollateralDetails[]", "name": "details", "type": "tuple[]" }], "stateMutability": "view", "type": "function" } \ No newline at end of file