Skip to content

[BUG]: Incorrect TNT contract address extraction after Factory deployment #42

@dhruvi-16-me

Description

@dhruvi-16-me

Bug Description

When creating a new TNT via the Factory, the frontend derives the deployed TNT contract address from transaction logs without properly decoding the TNTCreated event.

Additionally, there is a fallback mechanism that slices the transaction hash to construct an address:

0x${txHash.slice(2, 42)}

This fallback does not guarantee a valid deployed contract address and may produce incorrect results.

As a result, the TNT address stored or displayed after creation may be invalid or incorrect.

Steps to Reproduce

  1. Navigate to the Create TNT page.

  2. Connect a wallet on Scroll Sepolia.

  3. Deploy a new TNT via the UI.

  4. Observe how the frontend determines the deployed TNT address.

  5. Inspect the logic extracting the address from logs.

  6. Notice that:

    • log.data is treated directly as the address without ABI decoding.
    • A fallback derives an address from the transaction hash.

Logs and Screenshots

No runtime exception is necessarily thrown, but the address extraction logic is incorrect.

Relevant logic pattern:

newTNTAddress = log.data;

Fallback:

newTNTAddress = `0x${txHash.slice(2, 42)}`

This does not guarantee a valid contract address.

Environment Details

No response

Impact

High - Major feature is broken

Code of Conduct

  • I have joined the Discord server and will post updates there
  • I have searched existing issues to avoid duplicates

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions