Skip to content

release: L2 swaps#1129

Merged
GarageInc merged 10 commits intoprodfrom
dev
Oct 7, 2025
Merged

release: L2 swaps#1129
GarageInc merged 10 commits intoprodfrom
dev

Conversation

@GarageInc
Copy link
Collaborator

No description provided.

GarageInc and others added 10 commits August 27, 2025 22:58
* feat: hardcoded chains for keplr

* chore: self review
* chore: savepoint

* chore: savepoint

* feat: erc20 bridge

* chore: self review

* fix: devnet url

* feat: add devnet

* chore: self review

* fix: addresses

* feat: tokens fetcher

* chore: savepoint

* chore: api for tokens

* fix: bridge allowance

* chore: savepoint

* feat: use bridge state

* chore: self review

* fix: balances from sepolia

* chore: prettier

* fix: explorer for devnet

* feat: https

* feat: token deployment page

* fix: rpc url

* fix: balances and token deployment

* chore: cleanup logs

* feat: logs parser

* feat: correct handle remote token address

* chore: self review

* chore: precommit hook

* chore: handle allowance with timers

* chore: savepoint

* feat: l2 to l1 orders list

* chore: self review for bridge tokens/links

* chore: self review

* feat: correct devnet configs for time to prove checks

* chore: correct chain switch for proving

* chore: correct finilize steps

* chore: review

* feat: self review UI for bridge page

* fix: header btns for bridge page

* fix: reloading timers

* chore: self review

* chore: replace local storage usage

* chore: review comments
* feat: upd wagmi lib

* fix: build providers
* feat: restore withdraw by tx hash

* chore: savecommit

* feat: recover page with order creation

* fix: linter issues

* fix: types

* fix: upd addresses

* Potential fix for code scanning alert no. 390: Useless assignment to local variable

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Signed-off-by: Rinat Fihtengolts <9-b-rinat@rambler.ru>

---------

Signed-off-by: Rinat Fihtengolts <9-b-rinat@rambler.ru>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
* fix: approve btn disable and chains in header

* chore: savepoint refactored bridge page

* feat: share by url support
* feat: use new testethic

* chore: savepoint

* chore: upd addresses

* fix: build

* fix: search tokens

* chore: self review

* fix: allowance checking

* fix: bridge

* chore: savepoint
* fix: pre release fixes

* chore: savepoint

* chore: reset token on chain id change

* fix: validators count

* fix: chain switch problem

* fix: links
* fix: decrease RPC calls

* fix: rename ISLM to ETH
};

export function BridgePage() {
const { t } = useTranslate('common');

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note

Unused variable t.

Copilot Autofix

AI 4 months ago

To fix the unused variable warning:

  • Remove the destructuring assignment for t on line 49.
  • This means deleting { t } from the assignment and, if nothing else is destructured, possibly the entire line.
  • In this specific case, since t is the only value destructured from useTranslate, remove the entire line 49: const { t } = useTranslate('common');
  • No additional import cleanup is required since the useTranslate import could still be in use elsewhere.

All necessary changes are confined to the shown code in libs/bridge/src/lib/bridge-page.tsx, and no additional functions, methods, or imports need to be added.


Suggested changeset 1
libs/bridge/src/lib/bridge-page.tsx

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/libs/bridge/src/lib/bridge-page.tsx b/libs/bridge/src/lib/bridge-page.tsx
--- a/libs/bridge/src/lib/bridge-page.tsx
+++ b/libs/bridge/src/lib/bridge-page.tsx
@@ -46,7 +46,6 @@
 };
 
 export function BridgePage() {
-  const { t } = useTranslate('common');
   const { switchChainAsync } = useSwitchChain();
 
   // URL state management
EOF
@@ -46,7 +46,6 @@
};

export function BridgePage() {
const { t } = useTranslate('common');
const { switchChainAsync } = useSwitchChain();

// URL state management
Copilot is powered by AI and may make mistakes. Always verify output.
Unable to commit as this autofix suggestion is now outdated
const { switchChainAsync } = useSwitchChain();

// URL state management
const { updateUrlState, buildDeploymentUrl, clearUrlState, urlState } =

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note

Unused variable clearUrlState.

Copilot Autofix

AI 4 months ago

To fix the problem, simply remove clearUrlState from the destructured object on line 53 where the output of useBridgeUrlState() is assigned to local variables. There is no other usage or side effect to consider. No other code changes, imports, or definitions are needed.

Suggested changeset 1
libs/bridge/src/lib/bridge-page.tsx

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/libs/bridge/src/lib/bridge-page.tsx b/libs/bridge/src/lib/bridge-page.tsx
--- a/libs/bridge/src/lib/bridge-page.tsx
+++ b/libs/bridge/src/lib/bridge-page.tsx
@@ -50,7 +50,7 @@
   const { switchChainAsync } = useSwitchChain();
 
   // URL state management
-  const { updateUrlState, buildDeploymentUrl, clearUrlState, urlState } =
+  const { updateUrlState, buildDeploymentUrl, urlState } =
     useBridgeUrlState();
 
   // Withdrawal orders management
EOF
@@ -50,7 +50,7 @@
const { switchChainAsync } = useSwitchChain();

// URL state management
const { updateUrlState, buildDeploymentUrl, clearUrlState, urlState } =
const { updateUrlState, buildDeploymentUrl, urlState } =
useBridgeUrlState();

// Withdrawal orders management
Copilot is powered by AI and may make mistakes. Always verify output.
Unable to commit as this autofix suggestion is now outdated
className = '',
defaultExpanded = false,
}: FaucetLinksCardProps) {
const { t } = useTranslate('common');

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note

Unused variable t.

Copilot Autofix

AI 4 months ago

To fix the issue, simply remove the unused variable declaration const { t } = useTranslate('common'); at line 18 from the FaucetLinksCard component in libs/bridge/src/lib/components/faucet-links-card.tsx. This will have no functional impact on the code, as no translation is performed, and the hook's functionality is not required unless localization is later added. No other code changes are needed, and no imports/removals beyond the single variable are required.

Suggested changeset 1
libs/bridge/src/lib/components/faucet-links-card.tsx

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/libs/bridge/src/lib/components/faucet-links-card.tsx b/libs/bridge/src/lib/components/faucet-links-card.tsx
--- a/libs/bridge/src/lib/components/faucet-links-card.tsx
+++ b/libs/bridge/src/lib/components/faucet-links-card.tsx
@@ -15,7 +15,6 @@
   className = '',
   defaultExpanded = false,
 }: FaucetLinksCardProps) {
-  const { t } = useTranslate('common');
   const [isExpanded, setIsExpanded] = useState(defaultExpanded);
 
   const faucets = [
EOF
@@ -15,7 +15,6 @@
className = '',
defaultExpanded = false,
}: FaucetLinksCardProps) {
const { t } = useTranslate('common');
const [isExpanded, setIsExpanded] = useState(defaultExpanded);

const faucets = [
Copilot is powered by AI and may make mistakes. Always verify output.
Unable to commit as this autofix suggestion is now outdated
Comment on lines +12 to +16
import {
BRIDGE_ADDRESSES,
getChainById,
L2_OPTIMISM_MINTABLE_ERC20_FACTORY_ADDRESS,
} from '@haqq/shell-shared';

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note

Unused import BRIDGE_ADDRESSES.

Copilot Autofix

AI 4 months ago

To resolve the issue, we should remove the unused BRIDGE_ADDRESSES import from the import statement on lines 12-16. This does not impact any functionality, as the variable is not referenced in the file. Only the import statement in libs/bridge/src/lib/components/token-deployment-page.tsx needs to be updated. No further code changes, additions, or dependency modifications are necessary.


Suggested changeset 1
libs/bridge/src/lib/components/token-deployment-page.tsx

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/libs/bridge/src/lib/components/token-deployment-page.tsx b/libs/bridge/src/lib/components/token-deployment-page.tsx
--- a/libs/bridge/src/lib/components/token-deployment-page.tsx
+++ b/libs/bridge/src/lib/components/token-deployment-page.tsx
@@ -10,7 +10,6 @@
   useReadContract,
 } from 'wagmi';
 import {
-  BRIDGE_ADDRESSES,
   getChainById,
   L2_OPTIMISM_MINTABLE_ERC20_FACTORY_ADDRESS,
 } from '@haqq/shell-shared';
EOF
@@ -10,7 +10,6 @@
useReadContract,
} from 'wagmi';
import {
BRIDGE_ADDRESSES,
getChainById,
L2_OPTIMISM_MINTABLE_ERC20_FACTORY_ADDRESS,
} from '@haqq/shell-shared';
Copilot is powered by AI and may make mistakes. Always verify output.
Unable to commit as this autofix suggestion is now outdated
'use client';

import { useCallback, useState } from 'react';
import { formatEther, parseEther, parseGwei, parseUnits } from 'viem';

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note

Unused imports formatEther, parseGwei.

Copilot Autofix

AI 4 months ago

To resolve this, remove the unused imports formatEther and parseGwei from the import statement on line 4 in libs/bridge/src/lib/hooks/use-bridge-transaction.ts. Only keep the imports which are actually referenced elsewhere, such as parseEther and parseUnits. The fix involves editing the import statement: only within the lines shown, no other changes required.

Suggested changeset 1
libs/bridge/src/lib/hooks/use-bridge-transaction.ts

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/libs/bridge/src/lib/hooks/use-bridge-transaction.ts b/libs/bridge/src/lib/hooks/use-bridge-transaction.ts
--- a/libs/bridge/src/lib/hooks/use-bridge-transaction.ts
+++ b/libs/bridge/src/lib/hooks/use-bridge-transaction.ts
@@ -1,7 +1,7 @@
 'use client';
 
 import { useCallback, useState } from 'react';
-import { formatEther, parseEther, parseGwei, parseUnits } from 'viem';
+import { parseEther, parseUnits } from 'viem';
 import { sepolia } from 'viem/chains';
 import { useSendTransaction, useWriteContract, usePublicClient } from 'wagmi';
 import { L1StandardBridgeAbi, CHAIN_CONFIG } from '@haqq/shell-shared';
EOF
@@ -1,7 +1,7 @@
'use client';

import { useCallback, useState } from 'react';
import { formatEther, parseEther, parseGwei, parseUnits } from 'viem';
import { parseEther, parseUnits } from 'viem';
import { sepolia } from 'viem/chains';
import { useSendTransaction, useWriteContract, usePublicClient } from 'wagmi';
import { L1StandardBridgeAbi, CHAIN_CONFIG } from '@haqq/shell-shared';
Copilot is powered by AI and may make mistakes. Always verify output.
Unable to commit as this autofix suggestion is now outdated
const amountWei = parseUnits(amount.toString(), tokenDecimals);

// Validate balance for ERC-20 tokens
if (amount > availableBalance) {

Check warning

Code scanning / CodeQL

Useless comparison test Warning

The condition 'amount ... Balance' is always false.

Copilot Autofix

AI 4 months ago

To fix the issue, remove the redundant comparison if (amount > availableBalance) and its attached error throw from the ERC-20 branch. This clarifies that the check is not necessary and prevents confusion for future maintainers. Only remove lines strictly dedicated to this check; leave all other logic and assignment untouched. No additional imports, method definitions, or variable declarations are necessary. The change applies only to lines 186–190 in the snippet provided.


Suggested changeset 1
libs/bridge/src/lib/hooks/use-bridge-transaction.ts

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/libs/bridge/src/lib/hooks/use-bridge-transaction.ts b/libs/bridge/src/lib/hooks/use-bridge-transaction.ts
--- a/libs/bridge/src/lib/hooks/use-bridge-transaction.ts
+++ b/libs/bridge/src/lib/hooks/use-bridge-transaction.ts
@@ -183,12 +183,12 @@
           const amountWei = parseUnits(amount.toString(), tokenDecimals);
 
           // Validate balance for ERC-20 tokens
-          if (amount > availableBalance) {
-            throw new Error(
-              `Insufficient ${token.symbol} balance. Available: ${availableBalance}, Requested: ${amount}`,
-            );
-          }
 
+
+
+
+
+
           // For now, use the same address for both local and remote token
           hash = await writeContractAsync({
             address: bridgeAddress as `0x${string}`,
EOF
@@ -183,12 +183,12 @@
const amountWei = parseUnits(amount.toString(), tokenDecimals);

// Validate balance for ERC-20 tokens
if (amount > availableBalance) {
throw new Error(
`Insufficient ${token.symbol} balance. Available: ${availableBalance}, Requested: ${amount}`,
);
}






// For now, use the same address for both local and remote token
hash = await writeContractAsync({
address: bridgeAddress as `0x${string}`,
Copilot is powered by AI and may make mistakes. Always verify output.
Unable to commit as this autofix suggestion is now outdated
@@ -0,0 +1,80 @@
'use client';

import { useEffect, useMemo } from 'react';

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note

Unused import useEffect.

Copilot Autofix

AI 4 months ago

To fix the problem, we should remove the unused useEffect import from the import statement. Specifically, in the file libs/bridge/src/lib/hooks/use-token-allowance.ts, on line 3, change the import from import { useEffect, useMemo } from 'react'; to import { useMemo } from 'react';. No other changes, imports, or adjustments are needed since useEffect is not used in the rest of the shown code.


Suggested changeset 1
libs/bridge/src/lib/hooks/use-token-allowance.ts

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/libs/bridge/src/lib/hooks/use-token-allowance.ts b/libs/bridge/src/lib/hooks/use-token-allowance.ts
--- a/libs/bridge/src/lib/hooks/use-token-allowance.ts
+++ b/libs/bridge/src/lib/hooks/use-token-allowance.ts
@@ -1,6 +1,6 @@
 'use client';
 
-import { useEffect, useMemo } from 'react';
+import { useMemo } from 'react';
 import { erc20Abi, parseUnits } from 'viem';
 import { useReadContract } from 'wagmi';
 
EOF
@@ -1,6 +1,6 @@
'use client';

import { useEffect, useMemo } from 'react';
import { useMemo } from 'react';
import { erc20Abi, parseUnits } from 'viem';
import { useReadContract } from 'wagmi';

Copilot is powered by AI and may make mistakes. Always verify output.
Unable to commit as this autofix suggestion is now outdated
});

// Step 5: Add to withdrawal orders
const orderId = addWithdrawalOrder({

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note

Unused variable orderId.

Copilot Autofix

AI 4 months ago

The best way to fix this unused variable is to simply remove the declaration of orderId and replace it with a call to addWithdrawalOrder as a statement, not an assignment. This ensures the side effect of calling addWithdrawalOrder (presumably creating the order) remains, but does not introduce an unnecessary variable. This change should only affect line 146 in the provided code within libs/bridge/src/lib/hooks/use-withdrawal-recovery.ts.

Suggested changeset 1
libs/bridge/src/lib/hooks/use-withdrawal-recovery.ts

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/libs/bridge/src/lib/hooks/use-withdrawal-recovery.ts b/libs/bridge/src/lib/hooks/use-withdrawal-recovery.ts
--- a/libs/bridge/src/lib/hooks/use-withdrawal-recovery.ts
+++ b/libs/bridge/src/lib/hooks/use-withdrawal-recovery.ts
@@ -143,7 +143,7 @@
         });
 
         // Step 5: Add to withdrawal orders
-        const orderId = addWithdrawalOrder({
+        addWithdrawalOrder({
           amount: Number(withdrawal.value) / 1e18, // Convert from wei
           toAddress: withdrawal.target,
           fromAddress: transaction.from,
EOF
@@ -143,7 +143,7 @@
});

// Step 5: Add to withdrawal orders
const orderId = addWithdrawalOrder({
addWithdrawalOrder({
amount: Number(withdrawal.value) / 1e18, // Convert from wei
toAddress: withdrawal.target,
fromAddress: transaction.from,
Copilot is powered by AI and may make mistakes. Always verify output.
Unable to commit as this autofix suggestion is now outdated
@vercel
Copy link

vercel bot commented Oct 7, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
shell-app Ready Ready Preview Comment Oct 7, 2025 2:38pm

@GarageInc GarageInc merged commit 32314ae into prod Oct 7, 2025
5 of 10 checks 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.

1 participant