Skip to content

🐛 app: allow kyc on account deploy#672

Merged
cruzdanilo merged 1 commit intomainfrom
funds
Jan 22, 2026
Merged

🐛 app: allow kyc on account deploy#672
cruzdanilo merged 1 commit intomainfrom
funds

Conversation

@dieguezguille
Copy link
Member

@dieguezguille dieguezguille commented Jan 22, 2026


Open with Devin

Summary by CodeRabbit

  • Bug Fixes
    • Fixed an issue preventing KYC verification during account deployment.

✏️ Tip: You can customize this high-level summary in your review settings.

@changeset-bot
Copy link

changeset-bot bot commented Jan 22, 2026

🦋 Changeset detected

Latest commit: c6a1241

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@gemini-code-assist
Copy link

Summary of Changes

Hello @dieguezguille, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses a bug where the application's 'getting started' flow incorrectly relied on the presence of funds (hasFunds) to determine user progression, specifically hindering the ability to complete KYC (Know Your Customer) if an account was not yet deployed. The changes refactor the relevant components to use an isDeployed status, ensuring that users can proceed with KYC once their account is deployed, independent of their fund balance. This improves the user onboarding experience by correctly sequencing the initial setup steps.

Highlights

  • Refactored GettingStarted Component Props: The GettingStarted component in src/components/home/GettingStarted.tsx has been updated to accept an isDeployed boolean prop instead of hasFunds. This aligns the component's logic with account deployment status rather than fund presence.
  • Updated Onboarding Step Logic: The internal logic within GettingStarted for marking the 'add-funds' step as complete and for determining when the component should render null now correctly uses the isDeployed status. This ensures that KYC can proceed even if funds are not yet present, as long as the account is deployed.
  • Home Component Integration: The Home component in src/components/home/Home.tsx no longer calculates usdBalance for the purpose of passing it to GettingStarted. Instead, it now passes the isDeployed status, derived from the presence of bytecode, to the GettingStarted component.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@coderabbitai
Copy link

coderabbitai bot commented Jan 22, 2026

Walkthrough

The changes modify the KYC onboarding flow to evaluate account deployment status instead of USD balance. The GettingStarted component's hasFunds prop is replaced with isDeployed, and conditional logic throughout is updated to check for bytecode presence rather than positive balance.

Changes

Cohort / File(s) Summary
Changeset entry
.changeset/lucky-fans-tease.md
Added patch release note for "@exactly/mobile" documenting KYC bug fix on account deploy.
Onboarding completion logic
src/components/home/GettingStarted.tsx
Updated component signature from hasFunds to isDeployed prop. Modified completion condition for "add-funds" step and early exit logic to depend on isDeployed instead of hasFunds. Updated effect dependencies accordingly.
Parent component integration
src/components/home/Home.tsx
Changed GettingStarted prop from hasFunds={usdBalance > 0n} to isDeployed={!!bytecode}, tying onboarding state to deployment status instead of balance.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Suggested reviewers

  • cruzdanilo
  • franm91
🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main change: allowing KYC to proceed on account deployment instead of requiring funds, which is the core modification across all three changed files.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch funds

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the onboarding flow to allow users to proceed with KYC verification once their account is deployed, rather than after they have added funds. This is accomplished by changing the GettingStarted component to depend on isDeployed instead of hasFunds. The changes are logical and correctly implemented in GettingStarted.tsx and Home.tsx. The removal of the unused usdBalance variable is also a good cleanup. I have one suggestion to improve the naming of the new prop for better code clarity and maintainability.

/>
)}
<GettingStarted hasFunds={usdBalance > 0n} hasKYC={KYCStatus === "ok"} />
<GettingStarted isDeployed={!!bytecode} hasKYC={KYCStatus === "ok"} />

Choose a reason for hiding this comment

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

medium

To improve clarity and component encapsulation, consider renaming the isDeployed prop to isAddFundsStepComplete. The GettingStarted component uses this prop to determine if the 'add-funds' step is complete. Using the name isDeployed leaks an implementation detail from the Home component (that deployment status determines the completion of the 'add-funds' step) into the GettingStarted component. A more abstract prop name would make GettingStarted more self-contained and its purpose clearer.

This change will require updating the prop definition and its usages within GettingStarted.tsx accordingly.

Suggested change
<GettingStarted isDeployed={!!bytecode} hasKYC={KYCStatus === "ok"} />
<GettingStarted isAddFundsStepComplete={!!bytecode} hasKYC={KYCStatus === "ok"} />

Copy link

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 3 additional flags.

Open in Devin Review

setSteps((previous) =>
previous.map((step) => {
if (step.id === "add-funds" && hasFunds) return { ...step, completed: true };
if (step.id === "add-funds" && isDeployed) return { ...step, completed: true };
Copy link

Choose a reason for hiding this comment

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

Bug: The "Add funds" step now completes when an account is deployed (!!bytecode), not when funds are added, allowing users to finish onboarding with a zero balance.
Severity: HIGH

Suggested Fix

Revert the completion condition for the "add-funds" step to check the user's balance (e.g., usdBalance > 0n). The new requirement to "allow kyc on account deploy" should be handled separately from the fund-adding step to ensure each step's completion criteria matches its stated purpose.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: src/components/home/GettingStarted.tsx#L67

Potential issue: The logic for completing the "add-funds" onboarding step was changed
from checking `usdBalance > 0n` to checking if the account has been deployed
(`!!bytecode`). This creates a mismatch with the UI, which still instructs the user to
"Add funds to account". A user's account can be deployed without any funds, which would
incorrectly mark this step as complete. Consequently, the `GettingStarted` component
would be hidden, and the user could finish the entire onboarding process without adding
the required funds for collateral.

Did we get this right? 👍 / 👎 to inform future reviews.

@sentry
Copy link

sentry bot commented Jan 22, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 61.05%. Comparing base (877636c) to head (c6a1241).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #672      +/-   ##
==========================================
+ Coverage   60.95%   61.05%   +0.10%     
==========================================
  Files         168      168              
  Lines        5273     5272       -1     
  Branches     1491     1491              
==========================================
+ Hits         3214     3219       +5     
+ Misses       1898     1892       -6     
  Partials      161      161              
Flag Coverage Δ
e2e 59.86% <100.00%> (+0.08%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@src/components/home/Home.tsx`:
- Line 196: The isDeployed prop currently uses !!bytecode which treats the
string "0x" as truthy; update the guard to explicitly detect non-empty on-chain
bytecode by checking the useBytecode result (bytecode) is not
null/undefined/empty and not exactly "0x" (e.g. isDeployed = Boolean(bytecode &&
bytecode !== "0x")). Locate the usage in Home.tsx where GettingStarted is
rendered and replace the !!bytecode check with an explicit bytecode !== "0x"
(and null/undefined) check so EOAs are not marked as deployed.

/>
)}
<GettingStarted hasFunds={usdBalance > 0n} hasKYC={KYCStatus === "ok"} />
<GettingStarted isDeployed={!!bytecode} hasKYC={KYCStatus === "ok"} />
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🌐 Web query:

wagmi useBytecode hook return value empty code EOA

💡 Result:

This is expected behavior. useBytecode calls eth_getCode under the hood; JSON‑RPC returns "0x" (or empty code) for externally owned accounts (EOAs), so useBytecode will return no bytecode for EOAs. [1][2]

Quick check (pseudo‑code):

  • if (!data || data === '0x') → address is EOA (no contract)
  • else → contract bytecode present

References:

  • wagmi useBytecode docs. [1]
  • eth_getCode: returns "0x" for EOAs. [2]
  • Discussion / ethers provider.getCode behavior (confirmation). [3]

🌐 Web query:

viem getBytecode function returns null or 0x for non-deployed accounts

💡 Result:

Short answer: That's expected.

Details:

  • eth_getCode (what viem calls getCode / getBytecode) returns empty bytecode for EOAs or addresses with no deployed contract — commonly shown as "0x" (or viem returns undefined for getCode). (viem.sh)
  • viem deprecated getBytecode in favor of getCode; use publicClient.getCode and check for undefined or '0x' to detect "no contract deployed". (newreleases.io)

If you want, paste the exact code you're calling and I’ll show the minimal check to distinguish deployed contracts from non-deployed accounts.

Citations:


🏁 Script executed:

grep -n "useBytecode\|GettingStarted" src/components/home/Home.tsx | head -20

Repository: exactly/exa

Length of output: 305


🏁 Script executed:

rg "useBytecode" src/ -A 3 -B 3

Repository: exactly/exa

Length of output: 23625


🏁 Script executed:

fd "Home.tsx" src/ --type f | xargs cat -n | grep -A 10 -B 10 "isDeployed"

Repository: exactly/exa

Length of output: 1057


Guard against useBytecode returning "0x" for accounts with no deployed contract.

When eth_getCode finds no contract code, it returns "0x" instead of null. This means !!bytecode is true for EOAs, incorrectly marking them as deployed. Check explicitly for non-empty code.

🔧 Proposed fix
-              <GettingStarted isDeployed={!!bytecode} hasKYC={KYCStatus === "ok"} />
+              <GettingStarted isDeployed={Boolean(bytecode && bytecode !== "0x")} hasKYC={KYCStatus === "ok"} />
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<GettingStarted isDeployed={!!bytecode} hasKYC={KYCStatus === "ok"} />
<GettingStarted isDeployed={Boolean(bytecode && bytecode !== "0x")} hasKYC={KYCStatus === "ok"} />
🤖 Prompt for AI Agents
In `@src/components/home/Home.tsx` at line 196, The isDeployed prop currently uses
!!bytecode which treats the string "0x" as truthy; update the guard to
explicitly detect non-empty on-chain bytecode by checking the useBytecode result
(bytecode) is not null/undefined/empty and not exactly "0x" (e.g. isDeployed =
Boolean(bytecode && bytecode !== "0x")). Locate the usage in Home.tsx where
GettingStarted is rendered and replace the !!bytecode check with an explicit
bytecode !== "0x" (and null/undefined) check so EOAs are not marked as deployed.

@cruzdanilo cruzdanilo merged commit c6a1241 into main Jan 22, 2026
14 of 15 checks passed
@cruzdanilo cruzdanilo deleted the funds branch January 22, 2026 19:45
@coderabbitai coderabbitai bot mentioned this pull request Jan 30, 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.

2 participants