Skip to content

FIX: whitelist state issue#164

Merged
andreysobol merged 3 commits into
ltvprotocol:devfrom
vsevolod-zhuravlov:fix/whitelist-state-issue
Feb 12, 2026
Merged

FIX: whitelist state issue#164
andreysobol merged 3 commits into
ltvprotocol:devfrom
vsevolod-zhuravlov:fix/whitelist-state-issue

Conversation

@vsevolod-zhuravlov
Copy link
Copy Markdown
Contributor

No description provided.

Comment thread src/contexts/VaultContext.tsx Outdated
Comment thread src/contexts/VaultContext.tsx Outdated
setHasSignature(params.hasSignature);
setLastCheckedAddressForSignature(address);
// On first load, if we have params - consume them, if user switched accounts - strictly check
const shouldConsumeParams = !hasUsedInitialSignatureParams && params.hasSignature !== undefined;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • What is params.hasSignature and where does come from?
  • Why can't we just simply check signature from file for any address, without hasUsedInitialSignatureParams which exists only to become true?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. What is params.hasSignature and where does come from?

params.hasSignature comes from URL query parameters passed to the Vault page. When a user lands on the vault page via a special link (e.g., from an email or marketing campaign), the link contains pre-computed whitelist information:

/0x...?hasSignature=true&isWhitelisted=true
This allows the UI to immediately show the correct whitelist state without waiting for on-chain/config lookup.

  1. Why can't we just simply check signature from file for any address, without hasUsedInitialSignatureParams which exists only to become true?

We do check the signature from the config file for any address — but we need to know when to trust URL params vs. when to check the file.

When a user first lands on the page via a whitelisted link, the URL contains hasSignature=true. We want to use this immediately so the UI shows the correct state without delay. So on initial load, we trust params.hasSignature and set our state from it.

But here's the problem: if the user then switches their wallet to a different account, the URL params are still the same — they still say hasSignature=true for the original address. If we kept trusting the params, we'd incorrectly show that the new account is whitelisted when it might not be.

@Cycxyz Cycxyz self-requested a review February 4, 2026 12:19
Comment thread src/contexts/VaultContext.tsx Outdated
@andreysobol andreysobol merged commit bb177b9 into ltvprotocol:dev Feb 12, 2026
1 check passed
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.

3 participants