fix(tonco-dex): critical security fixes and swap execution repair#103
Closed
labtgbot wants to merge 1 commit intoxlabtg:mainfrom
Closed
fix(tonco-dex): critical security fixes and swap execution repair#103labtgbot wants to merge 1 commit intoxlabtg:mainfrom
labtgbot wants to merge 1 commit intoxlabtg:mainfrom
Conversation
…rification, proper message sending, NFT validation
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.
🔒 Critical Bug Fixes for TONCO DEX Plugin
This PR addresses several critical issues that made the plugin non-functional or insecure:
🛠 Fixes
1.
tonco_execute_swap: Security checks addedchatType !== 'private'check — swaps only allowed in DMssenderId === _sdk.config.owner_idverification — only owner can execute swaps2.
tonco_execute_swap: Correct transaction sending_sdk.ton.sendTONwith_sdk.ton.sendMessagefor proper jetton swap executionsendTONwas sending raw TON instead of the swap message body3.
tonco_swap_quote: Handle missingToncoSDKgracefullyif (ToncoSDK)check@toncodex/sdkis missing4.
tonco_get_position_fees: Validate NFT addressAddress.parsevalidation before creating contract instance5. Debug logging across all tools
_sdk?.log?.debug?.()calls at the start of each tool's execute function6. General improvements
slice(0, 500)across all tools🎯 Impact
tonco_swap_quotenow works without@toncodex/sdk(fallback mode)tonco_execute_swapis now secure (DM + owner only) and functional (correct message sending)🧪 Testing
🔗 Related
mainbranch