From c9862c091509694909e9cd6fab2eca4b0689629e Mon Sep 17 00:00:00 2001 From: Ed Zynda Date: Thu, 19 Sep 2024 08:49:49 +0200 Subject: [PATCH] More fixes (#31) * Update config stuff * Add more logging * move hooks to only run on the server * move sqlite deps out of client * use older version of bun... * bump version * Add better handling for unknown selectors * Allow removing of unknown selectors --- src/routes/diamond/[address]/EditFacet.svelte | 31 ++++++++++++------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/src/routes/diamond/[address]/EditFacet.svelte b/src/routes/diamond/[address]/EditFacet.svelte index 6fbd91e..08fd020 100644 --- a/src/routes/diamond/[address]/EditFacet.svelte +++ b/src/routes/diamond/[address]/EditFacet.svelte @@ -22,6 +22,8 @@ parseAbi, zeroAddress, type WriteContractReturnType, + type AbiItem, + type AbiFunction, } from 'viem' import type { Chain } from 'viem/chains' import ConnectWallet from './ConnectWallet.svelte' @@ -263,6 +265,13 @@ } } } + + const getFunctionSelector = (m: AbiFunction) => { + if (m.name.indexOf('unknown_') > -1) { + return m.name.split('_')[1] + } + return toFunctionSelector(m) + }
@@ -364,10 +373,10 @@
@@ -375,12 +384,12 @@
- {toFunctionSelector(m)} + {getFunctionSelector(m)} {m.name}
@@ -423,23 +432,23 @@ - r.includes(toFunctionSelector(m)), + r.includes(getFunctionSelector(m)), )} />
- r.includes(toFunctionSelector(m)), + r.includes(getFunctionSelector(m)), )} class="flex items-center p-1 rounded-md bg-opacity-90" > - {toFunctionSelector(m)} + {getFunctionSelector(m)} {m.name}