fix: critical bugs in consolidation.js and demo files (#87, #88)#105
Open
Valisthea wants to merge 2 commits intoasterdex:masterfrom
Open
fix: critical bugs in consolidation.js and demo files (#87, #88)#105Valisthea wants to merge 2 commits intoasterdex:masterfrom
Valisthea wants to merge 2 commits intoasterdex:masterfrom
Conversation
added 2 commits
April 5, 2026 13:02
…sterdex#87) - Line 198: `status = 'SUCCESS'` (assignment) → `status === 'SUCCESS'` (comparison) This bug causes the if-condition to ALWAYS evaluate to true, silently masking failed consolidation transfers - Add null checks on sendToMainAddressRes and spotWithdraw API responses - Fix typo: `withdraw_ignature` → `withdraw_signature` - Replace all implicit globals with `let`/`const` declarations - Replace all loose `==` with strict `===`
…rdex#88) - aster-code.py: replace real ETH addresses (0x014c85ff..., 0xC98Fd64e...) with YOUR_* placeholder values + warning comment - sol_agent.py: replace real SOL address (6mSp4BuW...) and ETH addresses (0x71949710..., 0x014c85ff...) with YOUR_* placeholders + warning comment - Prevents users from accidentally sending funds to developer wallets
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug Fixes
#87 —
consolidation.js: Assignment instead of comparison (CRITICAL)Line 198 (before):
Line 198 (after):
Impact: The
=operator assigns'SUCCESS'tostatusinstead of comparing it. The condition always evaluates to true, silently masking failed consolidation transfers. Users copying this demo code would never know their transfers failed.Additional fixes in same file:
sendToMainAddressResandspotWithdrawAPI responses (preventTypeError: Cannot read properties of undefined)withdraw_ignature→withdraw_signaturecontent,headers,key,secret,signature,path,method,wallet,i,message,userSignature,sendToMainAddressRes,estimateFee,fee,spotWithdraw) with properlet/constdeclarations==with strict===#88 —
aster-code.py&sol_agent.py: Hardcoded wallet addressesBefore: Real developer ETH/SOL addresses hardcoded in demo files:
0x014c85ffb0fF2F2972237AA950B452f92C69Ae1D(ETH)0xC98Fd64eBc39E28b92849d9cCef9495663439014(ETH)0x71949710270163F096A8Bd342b266183Ae742e5E(ETH)6mSp4BuWCNgRSwv8JopQwCma26hmBT8jrcgJNadq23Gt(SOL)After: Replaced with
YOUR_*placeholder values + warning comments.Impact: Users copying demo code could accidentally send funds/approve agents for the wrong wallet address.
Files Changed
consolidation.jsdemo/aster-code.pydemo/sol_agent.pyVerification
==operatorsSubmitted by Kairos Lab