-
Notifications
You must be signed in to change notification settings - Fork 1
refactor: LP Contract refactoring, that allows to specify lp tokens receiver and removes error handling #97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Refactors the liquidity deposit flow to allow specifying an LP token recipient and simplifies error handling by leveraging contract-level require calls.
- Adds
lpTokensReceiverto payloads, message types, and contract constructors in place of the olddepositorfield. - Replaces the single integer
statusbitmask with two boolean flags and aStatusstruct. - Removes manual reject-message handlers and consolidates checks into
requirestatements.
Reviewed Changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| sources/utils/testUtils.ts | Pass lpTokensReceiver: null in test payloads |
| sources/utils/environment.ts | Updated createLiquidityDepositSetup calls to include two new boolean flags |
| sources/tests/proofs.spec.ts | Added lpTokensReceiver: null to proof fixtures |
| sources/tests/liquidity-deposit.spec.ts | Removed old randomInt import, updated status checks, dropped legacy error tests |
| sources/tests/factory.spec.ts | Renamed depositor → lpTokensReceiver and added new boolean args |
| sources/scripts/deploy.ts | Updated deploy script to pass lpTokensReceiver and boolean flags |
| sources/contracts/vaults/vault-interface.tact | Added lpTokensReceiver nullable field; removed reject handler interface |
| sources/contracts/vaults/ton-vault.tact | Propagate lpTokensReceiver or default sender; removed deprecated reject logic |
| sources/contracts/vaults/jetton-vault.tact | Use lpTokensReceiver fallback; removed reject logic |
| sources/contracts/infra/factory.tact | Renamed depositor → lpTokensReceiver and updated arguments |
| sources/contracts/core/messages.tact | Replaced depositor with lpTokensReceiver in LiquidityDeposit message |
| sources/contracts/core/liquidity-deposit.tact | Swapped depositor for lpTokensReceiver, moved to booleans & struct-based status |
| sources/contracts/core/amm-pool.tact | Forward lpTokensReceiver instead of depositor in pool interactions |
Comments suppressed due to low confidence (1)
sources/tests/liquidity-deposit.spec.ts:102
- The legacy error-handling test cases for mismatched or repeated deposits were removed. Please add new tests covering rejection scenarios under the updated
requirelogic to ensure mis-provision is still blocked.
})
Kaladin13
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure about removing if -> again checks
Closes #96
Closes #21