Skip to content

fix: correct contract index validation and wire up in Send page#1

Open
alez04 wants to merge 2 commits into
qubic:masterfrom
alez04:fix/contract-index-validation
Open

fix: correct contract index validation and wire up in Send page#1
alez04 wants to merge 2 commits into
qubic:masterfrom
alez04:fix/contract-index-validation

Conversation

@alez04
Copy link
Copy Markdown
Member

@alez04 alez04 commented May 24, 2026

Problem

Contract index validation in ValidateDestination() was capping out at 23, but mainnet already has 27 deployed contracts. The lower bound was also incorrect—indices start at 1, not 0.

Additionally, during this audit it was discovered that ValidateDestination() wasn't actually being utilized for the Send feature. The Send page had its own hardcoded length check (.Length != 60) that prevented contract indices from being entered, and AllowContractIndex was disabled on the input component.

Fix

  • Widened the accepted range to 1–1023 to match ScAuctions.razor and protocol specifications.
  • Wired up the Send page to support contract index inputs by enabling AllowContractIndex="true".
  • Added a ResolveIdentity helper to cleanly convert the input string (whether a 60-character address or a short contract index) into a valid QubicIdentity before signing.
  • Updated Send.razor to use the correct validation and resolution paths.

@alez04 alez04 changed the title Fix/contract index validation fix: correct contract index validation and wire up in Send page May 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant