From 822b4fd6ae4ae7dba2aeb396cf68a3711cc8b986 Mon Sep 17 00:00:00 2001 From: rogi-sh <46889545+rogi-sh@users.noreply.github.com> Date: Tue, 10 Dec 2024 17:54:03 +0100 Subject: [PATCH] Migrate Javsphere (JAV) to Base (#12653) Co-authored-by: igorshelkovenkov Co-authored-by: g1nt0ki <99907941+g1nt0ki@users.noreply.github.com> --- projects/javsphere/index.js | 43 ++++++++++++++++--------------------- 1 file changed, 18 insertions(+), 25 deletions(-) diff --git a/projects/javsphere/index.js b/projects/javsphere/index.js index 415910ea316c..1d17d51ada6b 100644 --- a/projects/javsphere/index.js +++ b/projects/javsphere/index.js @@ -1,32 +1,25 @@ -const { get } = require('../helper/http') const { staking } = require("../helper/staking.js"); -const {stakings} = require("../helper/staking"); -const vaultUrl = "https://mainnet.ocean.jellyfishsdk.com/v0/mainnet/address/df1q7zkdpw6hd5wzcxudx28k72vjvpefa4pyqls2grnahhyw4u8kf0zqu2cnz6/vaults"; -const ONE_YEAR_LOCKING_MAINNET = '0xD88Bb8359D694c974C9726b6201479a123212333' -const TWO_YEARS_LOCKING_MAINNET = '0xc5B7aAc761aa3C3f34A3cEB1333f6431d811d638' - -async function tvl(api) { - const tvls = await api.multiCall({ abi: 'uint256:currentTvl', calls: [ONE_YEAR_LOCKING_MAINNET, TWO_YEARS_LOCKING_MAINNET] }) - const dusdTVL = tvls.reduce((agg, i) => agg + i / 1e18, 0) - api.addCGToken('decentralized-usd', dusdTVL) -} - -async function defichainTvl(api) { - const { data: [vault] } = await get(vaultUrl) - const vaultTvl = +vault.collateralValue - +vault.loanValue - api.addCGToken('decentralized-usd', vaultTvl) -} +const STAKING_BASE = '0xE420BBb4C2454f305a3335BBdCE069326985fb5b' +const FREEZER_BASE = '0x03e225D2bd32F5ecE539005B57F9B94A743ADBFB' +const VESTING_BASE = '0x42a40321843220e9811A1385D74d9798436f7002' +const JAV_BASE = '0xEdC68c4c54228D273ed50Fc450E253F685a2c6b9' module.exports = { - methodology: `We count the total value locked in DUSD from all current products (dusd staking is a vault in defichain L1, - 1 year bond and 2 year bond are smart contracts on defimetachain L2. We also track staking and freezer of javsphers native token JAV). `, + methodology: `We count the total value locked from staking and freezer of javsphers native token JAV). `, + hallmarks: [ + [1733837635, "Migration to BASE"], + ], + base: { + tvl: () => { }, + staking: staking([STAKING_BASE, FREEZER_BASE], JAV_BASE), + vesting: staking(VESTING_BASE, JAV_BASE) + }, defichain_evm: { - tvl, - staking: stakings( ['0x4e15D4225623D07Adb43e9D546E57E1E6097e869', '0xF923f0828c56b27C8f57bc698c99543f63091E9A'], - '0x66F3Cf265D2D146A0348F6fC67E3Da0835e0968E'), - vesting: staking('0x7246ad1ac72715c5fd6c1FD7460A63afB8289104','0x66F3Cf265D2D146A0348F6fC67E3Da0835e0968E') - }, defichain: { - tvl: defichainTvl + tvl: () => { }, + staking: () => { }, + }, + defichain: { + tvl: () => { }, }, }