Skip to content
This repository was archived by the owner on Jul 31, 2026. It is now read-only.

fix: disclose WitnessCreateContract 9,999 TRX burn fee (WPN-1719) - #382

Open
ulissesferreira wants to merge 3 commits into
mainfrom
ulissesferreira/wpn-1719-witness-create-fee-6ead
Open

fix: disclose WitnessCreateContract 9,999 TRX burn fee (WPN-1719)#382
ulissesferreira wants to merge 3 commits into
mainfrom
ulissesferreira/wpn-1719-witness-create-fee-6ead

Conversation

@ulissesferreira

@ulissesferreira ulissesferreira commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Explanation

When users sign a TRON WitnessCreateContract transaction (registering as a Super Representative candidate), MetaMask's Tron Snap confirmation UI only showed bandwidth fees (~0.291 TRX) and a generic "Unsupported contract for simulation" message. The protocol-enforced irreversible burn of 9,999 TRX (getAccountUpgradeCost) was omitted, so users could approve a transaction believing it cost only network fees.

This change:

  1. Includes getAccountUpgradeCost in fee calculation for WitnessCreateContract, so the Network fee line and insufficient-balance checks reflect the full protocol cost (chain parameter with a 9,999 TRX fallback when params are unavailable).
  2. Replaces the generic unsupported-simulation copy with an explicit Super Representative candidate disclosure that states the permanent 9,999 TRX burn.

References

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them
Open in Web Open in Cursor 

Include getAccountUpgradeCost in fee calculation for WitnessCreateContract
so Network fee and insufficient-balance checks reflect the irreversible
protocol burn. Replace the generic unsupported-simulation copy with Super
Representative candidate disclosure on confirmation.

Fixes WPN-1719
@ulissesferreira
ulissesferreira marked this pull request as ready for review July 29, 2026 09:04
@ulissesferreira
ulissesferreira requested a review from a team as a code owner July 29, 2026 09:04
The Check Changelog CI action requires Unreleased entries to reference
the current pull request, not the Jira ticket.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants