Skip to content

fix(frontend): estimate Liquidium ERC20 fees safely#13307

Draft
cursor[bot] wants to merge 2 commits into
mainfrom
cursor/critical-correctness-bugs-acda
Draft

fix(frontend): estimate Liquidium ERC20 fees safely#13307
cursor[bot] wants to merge 2 commits into
mainfrom
cursor/critical-correctness-bugs-acda

Conversation

@cursor

@cursor cursor Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Motivation

Liquidium ETH/EVM supply and repay estimate ERC-20 gas before the SDK returns the final native-address target. The previous pre-confirmation estimate used the sender's own ETH address, which can under-estimate ERC-20 transfer gas when the Liquidium protocol address has no token balance yet. A user with just enough native gas for that under-estimate could confirm a supply/repay transaction that then fails out-of-gas and burns network fees.

Awareness checked: recent/open Liquidium PRs and issues, #13294 repay implementation discussion, #13205/#13292 supply context, the lend/borrow spec, and open Cursor critical-fix drafts. Existing work covers stale Liquidium loads (#13207) and limit-order unit parsing (#13289), but no PR/issue covered Liquidium EVM gas estimation.

Changes

  • Add a Liquidium-specific EVM fee-estimation destination that is not the sender address.
  • Use that fee-only destination in Liquidium ETH/EVM supply and repay fee contexts while leaving the actual SDK-provided broadcast target unchanged.
  • Add focused component regression tests that assert both Liquidium ETH/EVM wizards ask the fee layer to estimate against the Liquidium fee target instead of the sender.

Tests

  • npx @sveltejs/mcp svelte-autofixer ./src/frontend/src/lib/components/liquidium/supply/LiquidiumSupplyEthWizard.svelte --svelte-version 5 (no issues; pre-existing suggestions only)
  • npx @sveltejs/mcp svelte-autofixer ./src/frontend/src/lib/components/liquidium/repay/LiquidiumRepayEthWizard.svelte --svelte-version 5 (no issues; pre-existing suggestions only)
  • PATH="/home/ubuntu/.nvm/versions/node/v24.18.0/bin:$PATH" npx vitest src/frontend/src/tests/lib/components/liquidium/supply/LiquidiumSupplyEthWizard.spec.ts src/frontend/src/tests/lib/components/liquidium/repay/LiquidiumRepayEthWizard.spec.ts (passes: 2 files, 6 tests)
  • PATH="/home/ubuntu/.nvm/versions/node/v24.18.0/bin:$PATH" npm run lint:lockfile (passes)
  • PATH="/home/ubuntu/.nvm/versions/node/v24.18.0/bin:$PATH" npm run lint -- --max-warnings 0 (blocked by pre-existing Prettier drift in unrelated files such as generated declarations and vitest.config.ts; formatter output was reverted for unrelated files)
  • PATH="/home/ubuntu/.nvm/versions/node/v24.18.0/bin:$PATH" npm run check (blocked by existing Solana type error in src/frontend/src/sol/utils/sol-instructions-system.utils.ts:96 for SystemInstruction.CreateAccountAllowPrefund)
Open in Web View Automation 

cursoragent and others added 2 commits July 1, 2026 11:10
Co-authored-by: Antonio Ventilii <AntonioVentilii@users.noreply.github.com>
Co-authored-by: Antonio Ventilii <AntonioVentilii@users.noreply.github.com>
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