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
* fix: correct chain switch on bridge page * chore: error block styles * fix: handle back chain switch
* chore: savepoint * chore: savepoint * feat: testethiq faucet support
…fter request creation
…ssage confirmation time
| } | ||
|
|
||
| // Handle error objects without message property | ||
| const message = error instanceof Error ? error.message : String(error || ''); |
Check warning
Code scanning / CodeQL
Useless conditional Warning
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 27 days ago
In general, to fix a “useless conditional” you should remove any redundant boolean checks or fallback expressions that cannot change the result given the surrounding control flow and types. Here, the earlier if (!error) guard ensures error is always truthy from that point on, so error || '' can never produce ''. We still want the behavior “if it’s an Error, use its message; otherwise convert the value to string”, but we don’t need the useless || '' for that.
The best minimal fix is to change line 44 from:
const message = error instanceof Error ? error.message : String(error || '');to:
const message = error instanceof Error ? error.message : String(error);This keeps the same observable behavior for all values that can actually reach this line, removes the statically useless || '', and addresses CodeQL’s complaint. No imports, new methods, or other definitions are needed, and no surrounding logic has to change. The change is confined to libs/burn-waitlist/src/lib/waitlist-page.tsx within the sanitizeErrorMessage function.
| @@ -41,7 +41,7 @@ | ||
| } | ||
|
|
||
| // Handle error objects without message property | ||
| const message = error instanceof Error ? error.message : String(error || ''); | ||
| const message = error instanceof Error ? error.message : String(error); | ||
|
|
||
| if (!message || message.trim() === '') { | ||
| return undefined; |
| </div> | ||
|
|
||
| {/* Second Column: Applications List */} | ||
| {isConnected ? ( |
Check warning
Code scanning / CodeQL
Useless conditional Warning
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 27 days ago
In general, when a condition is statically known to always be true or false at a given point, you should remove the conditional and keep only the branch that is actually reachable. This avoids dead code and clarifies intent.
Here, CodeQL says isConnected is always true at line 766, where we have:
{isConnected ? (
<div> ... </div>
) : null}To fix this without altering behavior, we should remove the ternary and just render the <div> unconditionally. Concretely:
- In
libs/burn-waitlist/src/lib/waitlist-page.tsx, around lines 765–791, replace theisConnected ? (...) : nullblock with just the contents of the true branch (<div> ... </div>). - No new imports, methods, or helpers are needed—this is a pure JSX/logic simplification.
| @@ -763,32 +763,30 @@ | ||
| </div> | ||
|
|
||
| {/* Second Column: Applications List */} | ||
| {isConnected ? ( | ||
| <div> | ||
| <h2 className="mb-[16px] text-[18px] font-[600] text-[#0D0D0E]"> | ||
| Your Requests | ||
| </h2> | ||
| {isLoadingApplications && !applicationsData ? ( | ||
| <RequestsListSkeleton /> | ||
| ) : applicationsData || pendingApplications.length > 0 ? ( | ||
| <RequestsList | ||
| applications={mergedApplications} | ||
| canCancel={canWithdraw || false} | ||
| onCancel={handleCancel} | ||
| isCancelling={isCancelling || isConfirmingCancel} | ||
| cancellingRequestId={cancellingRequestId} | ||
| balances={waitlistBalances} | ||
| locale={locale} | ||
| /> | ||
| ) : ( | ||
| <div className="rounded-[8px] bg-[#F3F4F6] p-[16px] text-center"> | ||
| <div className="text-[14px] text-[#6B7280]"> | ||
| You haven't created any requests yet | ||
| </div> | ||
| <div> | ||
| <h2 className="mb-[16px] text-[18px] font-[600] text-[#0D0D0E]"> | ||
| Your Requests | ||
| </h2> | ||
| {isLoadingApplications && !applicationsData ? ( | ||
| <RequestsListSkeleton /> | ||
| ) : applicationsData || pendingApplications.length > 0 ? ( | ||
| <RequestsList | ||
| applications={mergedApplications} | ||
| canCancel={canWithdraw || false} | ||
| onCancel={handleCancel} | ||
| isCancelling={isCancelling || isConfirmingCancel} | ||
| cancellingRequestId={cancellingRequestId} | ||
| balances={waitlistBalances} | ||
| locale={locale} | ||
| /> | ||
| ) : ( | ||
| <div className="rounded-[8px] bg-[#F3F4F6] p-[16px] text-center"> | ||
| <div className="text-[14px] text-[#6B7280]"> | ||
| You haven't created any requests yet | ||
| </div> | ||
| )} | ||
| </div> | ||
| ) : null} | ||
| </div> | ||
| )} | ||
| </div> | ||
| </div> | ||
| </> | ||
| ) : null} |
| import { useCallback, useState, useEffect } from 'react'; | ||
| import { useLocalStorage } from 'usehooks-ts'; | ||
| import { decodeFunctionData, formatUnits } from 'viem'; | ||
| import { Address, decodeFunctionData, formatUnits, Hash } from 'viem'; |
Check notice
Code scanning / CodeQL
Unused variable, import, function or class Note
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI about 1 month ago
To fix the problem, remove the unused Hash symbol from the import statement so that only the actually used symbols (Address, decodeFunctionData, formatUnits) remain. This keeps behavior unchanged while cleaning up the code.
Concretely, in libs/bridge/src/lib/hooks/use-withdrawal-recovery.ts, edit the import on line 5 to drop Hash from the destructuring import list. No other code changes, imports, or definitions are needed because the unused symbol is not referenced anywhere in the file.
| @@ -2,7 +2,7 @@ | ||
|
|
||
| import { useCallback, useState, useEffect } from 'react'; | ||
| import { useLocalStorage } from 'usehooks-ts'; | ||
| import { Address, decodeFunctionData, formatUnits, Hash } from 'viem'; | ||
| import { Address, decodeFunctionData, formatUnits } from 'viem'; | ||
| import { getWithdrawals } from 'viem/op-stack'; | ||
| import { | ||
| L2StandardBridgeAbi, |
| * Direct API calls for withdrawals endpoint | ||
| */ | ||
|
|
||
| import { haqqEthiq, haqqTestethiq } 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 about 1 month ago
In general, to fix an unused-import issue, remove the unused symbol from the import statement, or delete the whole import if none of its symbols are used. This reduces clutter and avoids confusion about dependencies.
Here, we should edit libs/bridge/src/lib/services/explorer-api.ts so that the import from @haqq/shell-shared only includes haqqTestethiq, which is presumably used elsewhere in the file. We will change line 7 from import { haqqEthiq, haqqTestethiq } from '@haqq/shell-shared'; to import { haqqTestethiq } from '@haqq/shell-shared';. No additional methods, imports, or definitions are required.
| @@ -4,7 +4,7 @@ | ||
| * Direct API calls for withdrawals endpoint | ||
| */ | ||
|
|
||
| import { haqqEthiq, haqqTestethiq } from '@haqq/shell-shared'; | ||
| import { haqqTestethiq } from '@haqq/shell-shared'; | ||
| import { WithdrawalStatus } from '../types/withdrawal-order'; | ||
|
|
||
| // These interfaces are no longer needed since we're using the proxy API |
|
|
||
| const { | ||
| data: currentState, | ||
| error: currentStateError, |
Check notice
Code scanning / CodeQL
Unused variable, import, function or class Note
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI about 1 month ago
In general, the way to fix this type of issue is to remove the unused variable, or, if it was meant to be used, to actually consume it (for logging, UI error handling, etc.). Since we must avoid changing existing behavior, and we see no usage of currentStateError, the least invasive change is to stop declaring it.
Concretely, in libs/burn-waitlist/src/lib/hooks/use-waitlist-contract.ts, inside useWaitlistContractState, adjust the destructuring of the useReadContract return value so that it no longer includes error: currentStateError. Leave the rest of the destructured properties (data: currentState, isLoading: currentStateLoading, refetch: refetchState) unchanged, and do not add any new imports or logic. This removes the unused variable and keeps hook behavior and the component’s public API the same.
| @@ -37,7 +37,6 @@ | ||
|
|
||
| const { | ||
| data: currentState, | ||
| error: currentStateError, | ||
| isLoading: currentStateLoading, | ||
| refetch: refetchState, | ||
| } = useReadContract({ |
| const { | ||
| data: currentState, | ||
| error: currentStateError, | ||
| isLoading: currentStateLoading, |
Check notice
Code scanning / CodeQL
Unused variable, import, function or class Note
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI about 1 month ago
In general, to fix an unused variable from a destructuring assignment, remove the unused binding from the destructuring pattern while keeping the rest intact. This avoids changing behavior and keeps types inferred from the remaining values.
Here, in libs/burn-waitlist/src/lib/hooks/use-waitlist-contract.ts, we should edit the destructuring of useReadContract in useWaitlistContractState. Specifically, on lines 38–43, remove isLoading: currentStateLoading, from the object pattern. No other references to currentStateLoading exist, so no further changes are needed. We do not need any new imports or helper methods; the change is purely a cleanup of the destructuring.
| @@ -38,7 +38,6 @@ | ||
| const { | ||
| data: currentState, | ||
| error: currentStateError, | ||
| isLoading: currentStateLoading, | ||
| refetch: refetchState, | ||
| } = useReadContract({ | ||
| address: contractAddress, |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Description
Related Issue
Motivation and Context
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist: