feat: Yield Strategy Interface, Registry, and Deposit Routing#232
Merged
Devsol-01 merged 2 commits intoDevsol-01:mainfrom Feb 25, 2026
Merged
feat: Yield Strategy Interface, Registry, and Deposit Routing#232Devsol-01 merged 2 commits intoDevsol-01:mainfrom
Devsol-01 merged 2 commits intoDevsol-01:mainfrom
Conversation
|
@OtowoSamuel is attempting to deploy a commit to the devsol-01's projects Team on Vercel. A member of the Team first needs to authorize it. |
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.
Closes #225
Closes #224
Closes #222
Closes #223
Summary
Implements the yield strategy subsystem for the Nestera savings protocol. This includes a generic strategy interface for external contracts, a governance-gated strategy registry, and deposit routing logic for LockSave and GroupSave plans.
Changes
interface.rs
YieldStrategytrait with four entry points:strategy_deposit,strategy_withdraw,strategy_harvest, andstrategy_balance#[contractclient]to generateYieldStrategyClientfor Soroban cross-contract invocationregistry.rs
StrategyInfostruct (address,enabled,risk_level)register_strategy,disable_strategy,get_strategy,get_all_strategiesvalidate_admin_or_governancerouting.rs
route_to_strategyfollowing the Checks-Effects-Interactions (CEI) pattern: state is written before the external call, ensuring atomicity if the strategy call revertsprincipal_depositedandstrategy_sharesper plan in aStrategyPositionLockandGroupposition key variantswithdraw_from_strategyclears position state before the external call (reentrancy safe)StrategyDepositandStrategyWithdraweventserrors.rs
StrategyNotFound (92),StrategyAlreadyRegistered (93),StrategyDisabled (94)lib.rs
strategymodule and exposes contract-level entry points:register_strategy,disable_strategy,get_strategy,get_all_strategies,route_lock_to_strategy,route_group_to_strategy,get_lock_strategy_position,get_group_strategy_position,withdraw_lock_strategy,withdraw_group_strategytests.rs
Acceptance Criteria Met