Conversation
* 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
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 4 months ago
To fix the unused variable warning:
- Remove the destructuring assignment for
ton line 49. - This means deleting
{ t }from the assignment and, if nothing else is destructured, possibly the entire line. - In this specific case, since
tis the only value destructured fromuseTranslate, remove the entire line 49:const { t } = useTranslate('common'); - No additional import cleanup is required since the
useTranslateimport 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.
| @@ -46,7 +46,6 @@ | ||
| }; | ||
|
|
||
| export function BridgePage() { | ||
| const { t } = useTranslate('common'); | ||
| const { switchChainAsync } = useSwitchChain(); | ||
|
|
||
| // URL state management |
| const { switchChainAsync } = useSwitchChain(); | ||
|
|
||
| // URL state management | ||
| const { updateUrlState, buildDeploymentUrl, clearUrlState, urlState } = |
Check notice
Code scanning / CodeQL
Unused variable, import, function or class Note
Show autofix suggestion
Hide autofix suggestion
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.
| @@ -50,7 +50,7 @@ | ||
| const { switchChainAsync } = useSwitchChain(); | ||
|
|
||
| // URL state management | ||
| const { updateUrlState, buildDeploymentUrl, clearUrlState, urlState } = | ||
| const { updateUrlState, buildDeploymentUrl, urlState } = | ||
| useBridgeUrlState(); | ||
|
|
||
| // Withdrawal orders management |
| className = '', | ||
| defaultExpanded = false, | ||
| }: FaucetLinksCardProps) { | ||
| const { t } = useTranslate('common'); |
Check notice
Code scanning / CodeQL
Unused variable, import, function or class Note
Show autofix suggestion
Hide autofix suggestion
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.
| @@ -15,7 +15,6 @@ | ||
| className = '', | ||
| defaultExpanded = false, | ||
| }: FaucetLinksCardProps) { | ||
| const { t } = useTranslate('common'); | ||
| const [isExpanded, setIsExpanded] = useState(defaultExpanded); | ||
|
|
||
| const faucets = [ |
| 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
Show autofix suggestion
Hide autofix suggestion
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.
| @@ -10,7 +10,6 @@ | ||
| useReadContract, | ||
| } from 'wagmi'; | ||
| import { | ||
| BRIDGE_ADDRESSES, | ||
| getChainById, | ||
| L2_OPTIMISM_MINTABLE_ERC20_FACTORY_ADDRESS, | ||
| } from '@haqq/shell-shared'; |
| '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
Show autofix suggestion
Hide autofix suggestion
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.
| @@ -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'; |
| const amountWei = parseUnits(amount.toString(), tokenDecimals); | ||
|
|
||
| // Validate balance for ERC-20 tokens | ||
| if (amount > availableBalance) { |
Check warning
Code scanning / CodeQL
Useless comparison test Warning
Show autofix suggestion
Hide autofix suggestion
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.
| @@ -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}`, |
| @@ -0,0 +1,80 @@ | |||
| 'use client'; | |||
|
|
|||
| import { useEffect, useMemo } from 'react'; | |||
Check notice
Code scanning / CodeQL
Unused variable, import, function or class Note
Show autofix suggestion
Hide autofix suggestion
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.
| @@ -1,6 +1,6 @@ | ||
| 'use client'; | ||
|
|
||
| import { useEffect, useMemo } from 'react'; | ||
| import { useMemo } from 'react'; | ||
| import { erc20Abi, parseUnits } from 'viem'; | ||
| import { useReadContract } from 'wagmi'; | ||
|
|
| }); | ||
|
|
||
| // Step 5: Add to withdrawal orders | ||
| const orderId = addWithdrawalOrder({ |
Check notice
Code scanning / CodeQL
Unused variable, import, function or class Note
Show autofix suggestion
Hide autofix suggestion
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.
| @@ -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, |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
No description provided.