Skip to content

Commit 1023c57

Browse files
authored
resolv (#18517)
1 parent d19d35e commit 1023c57

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

projects/resolv/index.js

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,28 @@
11
const { staking } = require('../helper/staking')
2+
const ADDRESSES = require('../helper/coreAssets.json')
23

34
const tokens = [
45
'0x66a1E37c9b0eAddca17d3662D6c05F4DECf3e110', // USR
56
'0x4956b52aE2fF65D74CA2d61207523288e4528f96' // RLP
67
]
78

89
module.exports = {
10+
methodology: 'Counts total supply of USR and RLP tokens, subtracting 80M minted in hack.',
911
ethereum: {
10-
tvl: async () => {
11-
throw new Error(`Resolve adapter needs fixing`) }, // api.add(tokens, await api.multiCall({ calls: tokens, abi: 'erc20:totalSupply' })),
12+
misrepresentedTokens: true,
13+
tvl: async (api) => {
14+
if (api.timestamp > 1777106021) throw new Error('Resolv error - has the hack been resolved?')
15+
if (api.timestamp > 1774137600) {
16+
api.add(ADDRESSES.ethereum.USDC, (await api.call({ target: tokens[0], abi: 'erc20:totalSupply' })) / 10 **12)
17+
// Subtract 80M after hack
18+
// https://etherscan.io/tx/0x41b6b9376d174165cbd54ba576c8f6675ff966f17609a7b80d27d8652db1f18f
19+
// https://etherscan.io/tx/0xfe37f25efd67d0a4da4afe48509b258df48757b97810b28ce4c649658dc33743
20+
api.add(ADDRESSES.ethereum.USDC, -8e13)
21+
api.add(tokens[1], await api.call({ target: tokens[1], abi: 'erc20:totalSupply' }))
22+
} else {
23+
api.add(tokens, await api.multiCall({ calls: tokens, abi: 'erc20:totalSupply' }))
24+
}
25+
},
1226
staking: staking('0xFE4BCE4b3949c35fB17691D8b03c3caDBE2E5E23', '0x259338656198eC7A76c729514D3CB45Dfbf768A1'),
1327
}
1428
}

0 commit comments

Comments
 (0)