diff --git a/src/lib/utils.server.ts b/src/lib/utils.server.ts index 96a47ee..0b04a13 100644 --- a/src/lib/utils.server.ts +++ b/src/lib/utils.server.ts @@ -84,5 +84,5 @@ export const getFuncSigBySelector = async (selector: string): Promise => return data.result.function[selector][0].name } - return 'unknown()' + return `unknown_${selector}()` } diff --git a/src/routes/diamond/[address]/+page.server.ts b/src/routes/diamond/[address]/+page.server.ts index 84c13a5..f2a4249 100644 --- a/src/routes/diamond/[address]/+page.server.ts +++ b/src/routes/diamond/[address]/+page.server.ts @@ -102,6 +102,7 @@ const buildFacet = async ( const fileredAbi: Abi = facet.abi.filter((item) => { if (item.type !== 'function') return true + if (item.name.indexOf('unknown_') > -1) return true if (!item.outputs) { item.outputs = [] } diff --git a/src/routes/diamond/[address]/FacetsTable.svelte b/src/routes/diamond/[address]/FacetsTable.svelte index 601f3d8..69c8c06 100644 --- a/src/routes/diamond/[address]/FacetsTable.svelte +++ b/src/routes/diamond/[address]/FacetsTable.svelte @@ -70,17 +70,31 @@ - - {toFunctionSelector(m)} - - + {#if m.name.indexOf('unknown_') > -1} + + {m.name.split('_')[1]} + + + {:else} + + {toFunctionSelector(m)} + + + {/if} {/each} diff --git a/src/routes/diamond/[address]/json/+server.ts b/src/routes/diamond/[address]/json/+server.ts index 3c5f7ca..53e27e6 100644 --- a/src/routes/diamond/[address]/json/+server.ts +++ b/src/routes/diamond/[address]/json/+server.ts @@ -105,6 +105,11 @@ const buildFacet = async ( const fileredAbi: Abi = facet.abi.filter((item) => { if (item.type !== 'function') return true + if (item.name.indexOf('unknown_') > -1) { + if (selectors.includes(item.name.split('_')[1])) { + return true + } + } if (!item.outputs) { item.outputs = [] }