fix: remove Blend adapter admin shortcuts#434
Conversation
…530b96144 Remove the admin-only supply_balance and withdraw_to_vault entrypoints so managed Blend positions can only be mutated through the vault-routed adapter lifecycle. This preserves vault accounting as the canonical source of truth for external assets and allocation state.\n\nVerification:\n- RED: cargo test -p templar-soroban-blend-adapter admin_accounting_shortcuts_are_not_public_entrypoints -- --nocapture failed before deletion on pub fn supply_balance(\n- cargo fmt --all -- --check\n- git diff --check\n- cargo test -p templar-soroban-blend-adapter -- --nocapture\n- cargo test -p templar-soroban-runtime --features testutils --lib -- --nocapture\n- cargo test -p templar-soroban-runtime --features testutils --test property_tests -- --nocapture\n- just -f contract/vault/soroban/justfile size-budget-check\n\nRuntime deploy WASM: 93961 bytes <= 131072 bytes.
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
Superseded by #431, which consolidates the tracker-defined |
|
Closed as superseded by #431 consolidated adapter-accounting-and-blend-admin PR. |
Fixed Findings
76f200c7-618d-4fd1-bff3-109530b96144— Admin-only Blend adapter shortcuts can desynchronize vault accounting.Root Cause
The Blend adapter exposed admin-only
supply_balanceandwithdraw_to_vaultentrypoints. Those methods could mutate the adapter's managed Blend position directly, bypassing the vault allocation lifecycle that owns external-asset accounting.Fix
supply_balanceentrypoint.withdraw_to_vaultentrypoint.supply,withdraw,total_assets) intact.Fix commit:
b98f7f753334d4b796dc160a3610f61d26db8e65Verification
RED evidence:
GREEN / regression evidence:
Results:
templar-soroban-blend-adapter: 20 unit tests + 7 integration tests passed.templar-soroban-runtime --lib: 103 tests passed.property_tests: 23 tests passed.93961bytes, under131072byte budget.size-budget-checkand passed at93961bytes.This change is