@@ -22,29 +22,16 @@ const manualVaults: { [chain: string]: string[] } = {
2222 katana : [ ] ,
2323 polygon : [ ] ,
2424} ;
25- const registries : {
26- [ chain : string ] : { target : string ; fromBlock : number } ;
27- } = {
28- ethereum : {
29- target : "0xd40ecF29e001c76Dcc4cC0D9cd50520CE845B038" ,
30- fromBlock : 21176924 ,
31- } ,
32- arbitrum : {
33- target : "0xd40ecF29e001c76Dcc4cC0D9cd50520CE845B038" ,
34- fromBlock : 273947409 ,
35- } ,
36- base : {
37- target : "0xd40ecF29e001c76Dcc4cC0D9cd50520CE845B038" ,
38- fromBlock : 22344791 ,
39- } ,
40- katana : {
41- target : "0xd40ecF29e001c76Dcc4cC0D9cd50520CE845B038" ,
42- fromBlock : 2852031 ,
43- } ,
44- polygon : {
45- target : "0xd40ecF29e001c76Dcc4cC0D9cd50520CE845B038" ,
46- fromBlock : 64224620 ,
47- } ,
25+ const registries : string [ ] = [
26+ '0xff31A1B020c868F6eA3f61Eb953344920EeCA3af' ,
27+ '0xd40ecF29e001c76Dcc4cC0D9cd50520CE845B038'
28+ ] ;
29+ const fromBlocks : { [ chain : string ] : number } = {
30+ ethereum : 21176924 ,
31+ arbitrum : 273947409 ,
32+ base : 22344791 ,
33+ katana : 2852031 ,
34+ polygon : 64224620 ,
4835} ;
4936interface TokenKeys {
5037 symbol : string ;
@@ -136,18 +123,17 @@ export async function fetchAllEndorsedVaults(
136123 chain : string ,
137124 block : number | undefined ,
138125) : Promise < VaultKeys [ ] > {
139- const { target } = registries [ chain ] ;
140-
141126 // Call getAllEndorsedVaults to get all vault addresses
142- const allEndorsedVaults = await call ( {
127+ const allEndorsedVaults = await multiCall ( {
143128 abi : abiRegistry . getAllEndorsedVaults ,
144- target,
129+ calls : registries . map ( ( target : string ) => ( { target } ) ) ,
145130 chain : chain as any ,
146131 block,
132+ permitFailure : true
147133 } ) ;
148134
149135 // Flatten the 2D array to get all vault addresses
150- const vaultAddresses : string [ ] = allEndorsedVaults . output . flat ( ) ;
136+ const vaultAddresses : string [ ] = allEndorsedVaults . output . map ( ( r : any ) => r . output ) . flat ( 4 ) . filter ( ( v : string ) => v != null ) ;
151137
152138 // Add manual vaults if any
153139 vaultAddresses . push ( ...manualVaults [ chain as keyof typeof manualVaults ] ) ;
0 commit comments