@@ -151,7 +151,8 @@ export function SendTransaction({
151151 { data && data !== '0x' && (
152152 < TransactionDataListItem
153153 chainId = { chainId }
154- address = { to }
154+ from = { from }
155+ to = { to }
155156 data = { data }
156157 provider = { provider }
157158 />
@@ -330,12 +331,14 @@ async function sign(
330331
331332export function TransactionDataListItem ( {
332333 chainId,
333- address,
334+ from,
335+ to,
334336 data,
335337 provider,
336338} : {
337339 chainId : string ;
338- address : string ;
340+ from : string ;
341+ to : string ;
339342 data : string ;
340343 provider : ethers . JsonRpcProvider | undefined ;
341344} ) : ReactNode {
@@ -344,7 +347,7 @@ export function TransactionDataListItem({
344347 const { chainService} = useEntrances ( ) ;
345348
346349 const [ decoded , addresses , verified ] = useAsyncValue (
347- ( ) => decodeTransactionData ( address , data , provider ) ,
350+ ( ) => decodeTransactionData ( from , to , data , provider ) ,
348351 [ data , provider ] ,
349352 ) ?? [ data , [ ] , undefined ] ;
350353
@@ -430,21 +433,22 @@ export function TransactionDataListItem({
430433const SIGNATURE_HASH_BYTE_LIKE_LENGTH = 10 ;
431434
432435async function decodeTransactionData (
433- address : string ,
436+ from : string ,
437+ to : string ,
434438 data : string ,
435439 provider : ethers . JsonRpcProvider | undefined ,
436440) : Promise < [ decoded : string , addresses : string [ ] , verified : boolean ] > {
437441 if ( data . length < SIGNATURE_HASH_BYTE_LIKE_LENGTH ) {
438442 return [ data , [ ] , false ] ;
439443 }
440444
441- let decoded = await decodeBySourceCode ( address , data ) ;
445+ let decoded = await decodeBySourceCode ( to , data ) ;
442446 let verified = true ;
443447
444448 if ( decoded === null ) {
445449 // Could be a proxy.
446450
447- const implAddress = await getImplementationAddress ( address ) ;
451+ const implAddress = await getImplementationAddress ( to ) ;
448452
449453 if ( implAddress ) {
450454 decoded = await decodeBySourceCode ( implAddress , data ) ;
@@ -476,7 +480,7 @@ async function decodeTransactionData(
476480 . replace ( / ^ \[ / , '(' )
477481 . replace ( / \] $ / , ')' ) ;
478482
479- const addresses = extractAddressesFromDecodedTransaction ( decoded , address ) ;
483+ const addresses = extractAddressesFromDecodedTransaction ( decoded , [ from , to ] ) ;
480484
481485 return [ decodedData , addresses , verified ] ;
482486
@@ -543,7 +547,7 @@ async function decodeTransactionData(
543547 }
544548
545549 async function getImplementationAddress (
546- address : string ,
550+ contractAddress : string ,
547551 ) : Promise < string | undefined > {
548552 if ( ! provider ) {
549553 return undefined ;
@@ -553,7 +557,7 @@ async function decodeTransactionData(
553557 const implSlot =
554558 '0x360894A13BA1A3210667C828492DB98DCA3E2076CC3735A920A3CA505D382BBC' ;
555559
556- const impl = await provider . getStorage ( address , implSlot ) ;
560+ const impl = await provider . getStorage ( contractAddress , implSlot ) ;
557561
558562 const implAddress = `0x${ impl . slice ( - 40 ) } ` ;
559563
0 commit comments