From aae2bf477c44c13d14f8ae67a4d8a2c97f63c40e Mon Sep 17 00:00:00 2001 From: Avedith Date: Wed, 22 Mar 2023 20:48:25 +1000 Subject: [PATCH 1/3] Add void adapter --- projects/void/index.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 projects/void/index.js diff --git a/projects/void/index.js b/projects/void/index.js new file mode 100644 index 000000000000..dc413dd43a91 --- /dev/null +++ b/projects/void/index.js @@ -0,0 +1,24 @@ +const { sumTokens2 } = require('../helper/unwrapLPs'); + +const tokenReflectionsAwardAddress = "0x78cCb45a43731cf989C740e9cb31f3d192Bd0f8b" +const fantomTreasuryAddress = "0xf0a793024Ac47e421EB8c4673212dfCcE42f4a97" +const spookySwapLPAddress = "0xfC66Ac63D414d3CF3dcdDa9e60742F6E789205e3" + +async function fantomTvl(timestamp, block, chainBlocks) { + const balances = {}; + await sumTokens2({ + balances, + owners: [fantomTreasuryAddress, tokenReflectionsAwardAddress], + tokens: ["0x8D11eC38a3EB5E956B052f67Da8Bdc9bef8Abf3E", "0x0e249130b3545a2a287DE9f27d805CAB95f03DB9", "0x04068DA6C83AFCFA0e13ba15A6696662335D5B75", spookySwapLPAddress], + chain: 'fantom', + block: chainBlocks.fantom, + }) + return balances; +} + +module.exports = { + methodology: "Counting the LP tokens locked in the Fantom Treasury & counting the tokens locked in the Token Reflections Award contract", + fantom: { + tvl: fantomTvl, + } +} \ No newline at end of file From 45d0877f3e6d8d1c2302da703104b10d255586a4 Mon Sep 17 00:00:00 2001 From: Avedith Date: Wed, 22 Mar 2023 21:00:00 +1000 Subject: [PATCH 2/3] add void treasury --- projects/treasury/void.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 projects/treasury/void.js diff --git a/projects/treasury/void.js b/projects/treasury/void.js new file mode 100644 index 000000000000..7d44fd83825d --- /dev/null +++ b/projects/treasury/void.js @@ -0,0 +1,17 @@ +const { nullAddress, treasuryExports } = require("../helper/treasury"); + +const treasury = "0xf0a793024Ac47e421EB8c4673212dfCcE42f4a97"; + +module.exports = treasuryExports({ + fantom: { + owner: [treasury], + ownTokens: [ + "0x80F2B8CdbC470c4DB4452Cc7e4a62F5277Db7061", // VOID + ], + tokens: [ + nullAddress, + "0x8D11eC38a3EB5E956B052f67Da8Bdc9bef8Abf3E", // DAI + "0xfC66Ac63D414d3CF3dcdDa9e60742F6E789205e3", // SpookySwap VOID-DAI LP + ], + }, +}); \ No newline at end of file From 5e76014e8882ba196b3ed9f73d52e27edcd43aca Mon Sep 17 00:00:00 2001 From: g1nt0ki <99907941+g1nt0ki@users.noreply.github.com> Date: Wed, 22 Mar 2023 12:45:18 +0100 Subject: [PATCH 3/3] minor refactor --- projects/treasury/void.js | 3 ++- projects/void/index.js | 28 +++++++--------------------- 2 files changed, 9 insertions(+), 22 deletions(-) diff --git a/projects/treasury/void.js b/projects/treasury/void.js index 7d44fd83825d..57617017c391 100644 --- a/projects/treasury/void.js +++ b/projects/treasury/void.js @@ -1,10 +1,11 @@ const { nullAddress, treasuryExports } = require("../helper/treasury"); const treasury = "0xf0a793024Ac47e421EB8c4673212dfCcE42f4a97"; +const tokenReflectionsAwardAddress = "0x78cCb45a43731cf989C740e9cb31f3d192Bd0f8b" module.exports = treasuryExports({ fantom: { - owner: [treasury], + owners: [treasury, tokenReflectionsAwardAddress], ownTokens: [ "0x80F2B8CdbC470c4DB4452Cc7e4a62F5277Db7061", // VOID ], diff --git a/projects/void/index.js b/projects/void/index.js index dc413dd43a91..ec5904fe5f60 100644 --- a/projects/void/index.js +++ b/projects/void/index.js @@ -1,24 +1,10 @@ -const { sumTokens2 } = require('../helper/unwrapLPs'); - -const tokenReflectionsAwardAddress = "0x78cCb45a43731cf989C740e9cb31f3d192Bd0f8b" -const fantomTreasuryAddress = "0xf0a793024Ac47e421EB8c4673212dfCcE42f4a97" -const spookySwapLPAddress = "0xfC66Ac63D414d3CF3dcdDa9e60742F6E789205e3" - -async function fantomTvl(timestamp, block, chainBlocks) { - const balances = {}; - await sumTokens2({ - balances, - owners: [fantomTreasuryAddress, tokenReflectionsAwardAddress], - tokens: ["0x8D11eC38a3EB5E956B052f67Da8Bdc9bef8Abf3E", "0x0e249130b3545a2a287DE9f27d805CAB95f03DB9", "0x04068DA6C83AFCFA0e13ba15A6696662335D5B75", spookySwapLPAddress], - chain: 'fantom', - block: chainBlocks.fantom, - }) - return balances; -} module.exports = { - methodology: "Counting the LP tokens locked in the Fantom Treasury & counting the tokens locked in the Token Reflections Award contract", - fantom: { - tvl: fantomTvl, - } + fantom: { + tvl: () => 0, + staking: async (_, _1, _2, { api }) => { + const bal = await api.call({ abi: 'uint256:getTotalInvested', target: '0xe0d4ed2613f6c8737234d28d24b9c5d7f106bd28' }) + api.add('0x80F2B8CdbC470c4DB4452Cc7e4a62F5277Db7061', bal) + }, + } } \ No newline at end of file