Skip to content

[Chore] Split monolithic vault and blend-adapter contract files into modules - #665

Open
emteebug12-jpg wants to merge 2 commits into
drydocs:mainfrom
emteebug12-jpg:chore/split-contract-modules
Open

[Chore] Split monolithic vault and blend-adapter contract files into modules#665
emteebug12-jpg wants to merge 2 commits into
drydocs:mainfrom
emteebug12-jpg:chore/split-contract-modules

Conversation

@emteebug12-jpg

Copy link
Copy Markdown

Summary

This PR splits the monolithic contract files into focused modules without changing the external ABI or runtime behavior.

What changed

  • moved vault contract error enums into a dedicated module
  • moved vault storage keys and helpers into a dedicated module
  • split the Blend adapter types and errors into dedicated modules
  • kept the public contract interfaces and signatures unchanged

Verification

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

running 17 tests
test tests::accrue_ignores_reserve_scalar_and_uses_the_real_rate_base ... ok
test tests::accrue_is_idempotent_at_a_stable_rate ... ok
test tests::accrue_reflects_yield_from_a_rate_increase ... ok
test tests::accrue_returns_typed_error_on_overflow ... ok
test tests::constructor_sets_vault_pool_and_usdc ... ok
test tests::deposit_requires_vault_auth - should panic ... ok
test tests::accrue_returns_typed_error_when_pool_key_is_unset ... ok
test tests::deposit_supplies_to_pool_and_tracks_total ... ok
test tests::get_pool_returns_the_configured_pool ... ok
test tests::get_protocol_returns_blend ... ok
test tests::initialize_cannot_hijack_a_constructor_deployed_adapter ... ok
test tests::refresh_panics_on_accrue_overflow - should panic ... ok
test tests::refresh_panics_when_pool_key_is_unset - should panic ... ok
test tests::reinitializing_fails ... ok
test tests::withdraw_after_accrue_pays_out_appreciated_value ... ok
test tests::withdraw_requires_vault_auth - should panic ... ok
test tests::withdraw_returns_usdc_and_reduces_total ... ok

test result: ok. 17 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.26s

running 14 tests
test tests::deposit_requires_vault_auth - should panic ... ok
test tests::constructor_sets_vault_defindex_vault_and_usdc ... ok
test tests::get_pool_returns_the_configured_defindex_vault ... ok
test tests::deposit_returns_the_dftoken_balance_diff ... ok
test tests::get_protocol_returns_defindex ... ok
test tests::initialize_cannot_hijack_a_constructor_deployed_adapter ... ok
test tests::total_assets_errs_on_malformed_defindex_response ... ok
test tests::reinitializing_fails ... ok
test tests::total_assets_returns_zero_with_no_shares ... ok
test tests::withdraw_errs_on_malformed_defindex_response ... ok
test tests::total_assets_reflects_defindex_valuation ... ok
test tests::withdraw_requires_vault_auth - should panic ... ok
test tests::withdraw_transfers_usdc_to_recipient ... ok
test tests::withdraw_panics_with_typed_error_when_dfx_vault_is_unset - should panic ... ok

test result: ok. 14 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.18s

running 60 tests
test tests::a_full_exit_lets_a_later_deposit_start_fresh ... ok
test tests::a_full_transfer_out_lets_a_later_deposit_start_fresh ... ok
test tests::a_position_transferred_away_stops_being_reported ... ok
test tests::a_transfer_in_after_a_cleared_transfer_out_reports_no_stale_basis ... ok
test tests::a_partial_transfer_leaves_both_holders_able_to_withdraw ... ok
test tests::a_transferred_in_position_reports_no_recorded_basis ... ok
test tests::deposit_fails_before_initialize ... ok
test tests::accept_admin_fails_with_no_pending_nominee ... ok
test tests::deposit_fails_when_adapter_reports_zero_assets_with_shares_outstanding ... ok
test tests::deposit_mints_shares ... ok
test tests::deposit_records_principal ... ok
test tests::deposit_refresh_call_resource_cost_is_within_sanity_ceiling ... ok
test tests::deposit_records_entry_time ... ok
test tests::deposit_zero_amount_fails ... ok
test tests::depositing_on_top_of_a_transferred_in_position_stamps_an_entry_time ... ok
test tests::deposit_too_small_after_share_price_inflation ... ok
test tests::entry_time_defaults_to_zero ... ok
test tests::full_withdraw_clears_entry_time ... ok
test tests::depositor_priced_correctly_within_own_transaction_after_yield_accrual ... ok
test tests::get_adapter_fails_before_initialize ... ok
test tests::get_admin_fails_before_initialize ... ok
test tests::full_withdraw_clears_principal ... ok
test tests::get_total_assets_fails_before_initialize ... ok
test tests::get_position_reads_the_token_even_for_an_address_that_never_deposited ... ok
test tests::inflation_attack_is_unprofitable ... ok
test tests::migrate_adapter_excludes_target_pre_existing_balance_from_value_after ... ok
test tests::migrate_adapter_fails_to_same_adapter ... ok
test tests::migrate_adapter_fails_when_new_adapter_returns_zero_shares ... ok
test tests::migrate_adapter_fails_with_invalid_slippage_bps ... ok
test tests::large_depositor_withdrawal_shifts_ratio_causing_small_depositors_withdrawal_to_revert ... ok
test tests::migrate_adapter_fails_with_no_adapter_position ... ok
test tests::migrate_adapter_moves_position_and_preserves_bookkeeping ... ok
test tests::migrate_adapter_rejects_value_drift_beyond_slippage ... ok
test tests::min_usdc_out_fires_min_amount_out_not_met_when_payout_is_positive_but_below_floor ... ok
test tests::paused_blocks_deposit ... ok
test tests::reinitializing_fails ... ok
test tests::set_adapter_fails_before_initialize ... ok
test tests::set_adapter_fails_with_shares_outstanding ... ok
test tests::partial_withdraw_reduces_principal_proportionally ... ok
test tests::set_paused_fails_before_initialize ... ok
test tests::set_adapter_succeeds_with_no_shares_outstanding ... ok
test tests::share_price_reflects_yield ... ok
test tests::topup_accumulates_principal ... ok
test tests::topup_keeps_original_entry_time ... ok
test tests::transfer_admin_fails_before_initialize ... ok
test tests::share_value_exceeds_principal_after_yield ... ok
test tests::transfer_admin_then_accept_rotates_admin ... ok
test tests::transfer_admin_overwrites_a_prior_unaccepted_nomination ... ok
test tests::transferred_musdc_withdraws_through_its_new_holder ... ok
test tests::transferring_a_position_away_leaves_the_sender_with_a_typed_error ... ok
test tests::unpause_re_enables_deposits ... ok
test tests::withdraw_fails_before_initialize ... ok
test tests::withdraw_more_than_balance_fails ... ok
test tests::withdraw_payout_is_live_computed_and_unaffected_by_cache_refresh ... ok
test tests::withdraw_returns_usdc ... ok
test tests::withdraw_with_no_shares_outstanding_fails ... ok
test tests::withdraw_zero_shares_fails ... ok
test tests::withdrawal_too_small_when_usdc_drained_from_adapter ... ok
test tests::withdraw_works_while_paused ... ok
test tests::withdrawing_after_a_partial_transfer_out_retires_basis_against_what_is_held ... ok

test result: ok. 60 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 1.44s

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

Closes #593

@vercel

vercel Bot commented Aug 30, 2026

Copy link
Copy Markdown

@emteebug12-jpg is attempting to deploy a commit to the Collins' projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Aug 30, 2026

Copy link
Copy Markdown

@emteebug12-jpg Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Chore] Split monolithic vault and blend-adapter contract files into modules

1 participant