File tree Expand file tree Collapse file tree 2 files changed +39
-0
lines changed Expand file tree Collapse file tree 2 files changed +39
-0
lines changed Original file line number Diff line number Diff line change
1
+ {
2
+ "getOracle" : " function getOracle(address token) external view returns (address)" ,
3
+ "latestAnswer" : " function latestAnswer() external view override returns (int256)"
4
+ }
Original file line number Diff line number Diff line change
1
+ const abi = {
2
+ "getOracle" : "function getOracle(address token) external view returns (address)" ,
3
+ "latestAnswer" : "function latestAnswer() external view override returns (int256)"
4
+ }
5
+
6
+ // TODO: instead of hardcoding the contract addresses, pull the list from the events
7
+ // of the factory contract that deploys them. Like this we won't need a new PR for each
8
+ // new project tokenized
9
+ const tokens = [
10
+ "0x35b5129e86EBE5Fd00b7DbE99aa202BE5CF5FA04" , // Champfleury Contract ( vision87.com )
11
+ ] . map ( i => i . toLowerCase ( ) )
12
+
13
+
14
+ // `api` is an injected `sdk.ChainApi` object with which you can interact with
15
+ // a given chain through `call/multiCall/batchCall` method based on your need,
16
+ // also stores tvl balances
17
+ async function tvl ( api ) {
18
+
19
+ const supplies = await api . multiCall ( { abi : 'erc20:totalSupply' , calls : tokens } )
20
+
21
+ supplies . forEach ( ( supply , i ) => {
22
+ api . add ( tokens [ i ] , supply )
23
+ } ) ;
24
+
25
+ return api . getBalances ( )
26
+ }
27
+
28
+ const chains = [ "base" ]
29
+
30
+ chains . forEach ( chain => {
31
+ module . exports [ chain ] = {
32
+ tvl
33
+ }
34
+ } )
35
+
You can’t perform that action at this time.
0 commit comments