Feat/dex modification#214
Open
Raziievskyi-Illia wants to merge 13 commits intoStableTechnologies:trunkfrom
Open
Feat/dex modification#214Raziievskyi-Illia wants to merge 13 commits intoStableTechnologies:trunkfrom
Raziievskyi-Illia wants to merge 13 commits intoStableTechnologies:trunkfrom
Conversation
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.
Updated DEX Contracts — Testing Report
Overview
This report documents the manual testing of updated DEX smart contracts deployed on Shadownet (Tezos testnet). The pool was deployed using the updated deployment script (FA2 token standard), and the following scenarios were verified.
Deployed Contracts
KT1L8ugtefoFLWEeK8N3DhUbeRBTA5GmXGbuKT1KerNiDTW74ft9wBZTGzMa1jXfaoEhTdPz✅ Test Cases
1. View:
quote_tez_to_tokenCalled the view with
1,000,000 mutez(1 XTZ) as input.1,000,000 mutez(1 XTZ)352,264tokensVerification swap:
ooBFjRitZw79KC...✅ The actual swap output matched the view result exactly.
2. View:
quote_token_to_tezCalled the view with
1,000,000tokens as input.1,000,000tokens2,679,927 mutezVerification swap:
onwtHscw7Ywk...✅ The actual swap output matched the view result exactly.
3. Accumulated Protocol Fee Verification
Three swaps were performed in total. The accumulated fees were verified against the expected values based on the configured fee rate of 100 bps (1%).
XTZ Fee Accumulation
499,999 mutez4,999 mutez4,999 mutez1,000,000 mutez(1 XTZ)10,000 mutez14,999 mutezToken Fee Accumulation
1,000,000tokens10,000tokens10,000tokens✅ Both
accumulated_protocol_fee_xtz = 14,999andaccumulated_protocol_fee_token = 10,000matched the expected values.4. Protocol Fee Withdrawal — Access Control
Fee recipient address:
tz1LuVooxD45DLjJfdu4CqySCyoRM9MH8AYu4a. Unauthorized Withdrawal Attempt
An attempt was made to withdraw fees from a different address (non-recipient).
The transaction failed with error code
39, as defined in the contract:✅ Access control is working correctly — only the designated recipient can claim fees.
4b. Authorized XTZ Fee Withdrawal
Withdrawal performed from the correct recipient address:
🔗
onwhD137G19A...✅ Transaction succeeded.
accumulated_protocol_fee_xtzreset to0.4c. Authorized Token Fee Withdrawal
🔗
opPHcPVxNtFN...✅ Transaction succeeded.
accumulated_protocol_fee_tokenreset to0.5. Fee Recipient Update
The fee recipient address was updated via admin:
🔗
oo9mcvVckKu6...After performing an additional swap to make fees non-zero, an attempt was made to withdraw from the old recipient address (which is also the contract admin).
The call failed with error
39— the old address no longer has the right to claim fees after the recipient update.Withdrawal with the new recipient address succeeded:
🔗
ooz31T3mBQfH...✅ Fee recipient update works correctly. Old recipient loses access, new recipient can claim.
6. Fee Rate Update
The protocol fee was updated from 100 bps (1%) to 50 bps (0.5%):
🔗
oouCqfAc57kB...A swap of 1 XTZ was performed after the update.
10,000 mutez5,000 mutez✅ The fee rate update works correctly. The new fee is applied to subsequent swaps immediately.
📋 Summary
quote_tez_to_tokenview accuracyquote_token_to_tezview accuracyAll test cases passed successfully. ✅