Feat/liquidity pool audit#76
Merged
Merged
Conversation
…add state TTL management
…oss multiple contract source and test files.
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.
Pull Request
Description
This PR addresses all critical, high, medium, and low severity findings from the recent security audit of the
liquidity-pool-contract. It hardens access control, corrects accounting logic, implements an emergency pause mechanism, and ensures storage TTLs are properly managed to prevent contract archival.Type of Change
Changes Made
distribute_interestwith strictrequire_authand caller identity verification (Admin/CreditLine only).access.rsto standardize administrative gating and updatedset_adminto comply with Soroban auth patterns.receive_guaranteeaccounting mismatch and enforcedMIN_AMOUNTon deposits.bump_instanceandbump_lp_shares) across all state-mutating and relevant read functions to prevent state expiration.pause,unpause,is_paused) blocking all state-mutating operations when active.unsafe { core::mem::transmute }from test helpers, replacing it with safe, lifetime-bound client generation.Testing
Checklist
Code follows project style guidelines
Self-review completed
Comments added for complex code
Documentation updated (constants and new error codes)
No new warnings generated
Close [FEATURE] SC-15: Implement deposits to the Liquidity Pool #70