Skip to content

fix(kyc): derive swissTaxResidence from the residence country instead of hardcoding true#679

Open
joshuakrueger-dfx wants to merge 1 commit into
RealUnitCH:developfrom
joshuakrueger-dfx:joshua/fix-657-p5f6-tax-residence
Open

fix(kyc): derive swissTaxResidence from the residence country instead of hardcoding true#679
joshuakrueger-dfx wants to merge 1 commit into
RealUnitCH:developfrom
joshuakrueger-dfx:joshua/fix-657-p5f6-tax-residence

Conversation

@joshuakrueger-dfx
Copy link
Copy Markdown
Collaborator

Addresses Issue #657 — Part 5, finding F6 (HIGH, compliance).

Problem

_onSubmit sent swissTaxResidence: true hardcoded on every KYC registration — the value flows into the EIP-712-signed registration payload, so every non-Swiss registrant cryptographically asserted Swiss tax residence.

Fix

Derive the flag from the selected residence (address) country: countryCtrl.value!.symbol == 'CH'.

⚠️ Review-Annahme (bitte bestätigen)

Wohnsitzland wird als Proxy für Steuersitz verwendet (Big-Brother-Architect-Empfehlung). Falls ein explizites "Schweizer Steuersitz?"-UI-Feld gewünscht ist (Grenzgänger/Auslandschweizer), wäre das ein Follow-up.

Tests (RED→GREEN, proven)

New widget regressions driving the address-step submit: CH ⇒ true, DE ⇒ false — the DE case fails on the old hardcoded value (verified). Suite 10/10 green, flutter analyze clean.

🤖 Big Brother fleet analysis + operator hand-finish. Ref #657.

… of hardcoding true

Every registration submit sent swissTaxResidence: true regardless of the user,
so every non-Swiss registrant signed an EIP-712 payload asserting Swiss tax
residence. Derive the flag from the selected residence (address) country
(symbol == 'CH') instead.

Note for review: residence country is used as the proxy for tax residence. If
product wants an explicit "Swiss tax resident?" question (e.g. for cross-border
cases), that is a follow-up UI change.

Regression: test/screens/kyc/steps/kyc_registration_page_test.dart
(CH => true, DE => false; the DE case fails on the old hardcoded value)

Issue RealUnitCH#657 — Part 5, finding F6 (HIGH, compliance).
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