From 557793c68c72904d7b79bb9210fd8daeec39ab38 Mon Sep 17 00:00:00 2001 From: Nick Towers Date: Thu, 16 Dec 2021 15:20:55 +0000 Subject: [PATCH 1/2] NT - 16.12.21 - Add gro protocol adapter --- projects/gro/abi.json | 28 ++++++++++++++++++++++++++++ projects/gro/index.js | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 projects/gro/abi.json create mode 100644 projects/gro/index.js diff --git a/projects/gro/abi.json b/projects/gro/abi.json new file mode 100644 index 00000000..dfb67474 --- /dev/null +++ b/projects/gro/abi.json @@ -0,0 +1,28 @@ +{ + "totalAssets": { + "inputs": [], + "name": "totalAssets", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + "totalSupply": { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + } +} diff --git a/projects/gro/index.js b/projects/gro/index.js new file mode 100644 index 00000000..582eeea6 --- /dev/null +++ b/projects/gro/index.js @@ -0,0 +1,35 @@ +// Adapter for Gro Protocol : https://gro.xyz + +const sdk = require("../../sdk"); +const groTokenAbi = require("./abi.json"); + +// Gro Protocol Token Addresses +const GVT = "0x3ADb04E127b9C0a5D36094125669d4603AC52a0c"; +const PWRD = "0xf0a93d4994b3d98fb5e3a2f90dbc2d69073cb86b"; + + +async function tvl(timestamp, ethBlock) { + let balances = {}; + + for (const token of [PWRD, GVT]) { + const current = await sdk.api.abi.call({ + target: token, + abi: groTokenAbi["totalSupply"], + block: ethBlock, + }); + sdk.util.sumSingleBalance(balances, token, current.output); + } + + return balances; +} + + +module.exports = { + name: 'Gro Protocol', + category: 'Assets', + token: 'GRO', + website: 'https://www.gro.xyz', + start: 1622204347, // 28-05-2021 12:19:07 (UTC) + tvl, +}; + From 3fa6882565455234b136c916f90fa89a4ecc55de Mon Sep 17 00:00:00 2001 From: Nick Towers Date: Thu, 16 Dec 2021 15:21:14 +0000 Subject: [PATCH 2/2] NT - 16.12.21 - Add gro protocol adapter --- projects/gro/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/projects/gro/index.js b/projects/gro/index.js index 582eeea6..abe2102d 100644 --- a/projects/gro/index.js +++ b/projects/gro/index.js @@ -29,6 +29,7 @@ module.exports = { category: 'Assets', token: 'GRO', website: 'https://www.gro.xyz', + chain: 'ethereum', start: 1622204347, // 28-05-2021 12:19:07 (UTC) tvl, };