Skip to content

feat: multi-asset deposit support via shared allowlist [NF-05] - #129

Merged
wumibals merged 4 commits into
LadderMine:mainfrom
AbdulmujibOladayo:feat/nf-05-multi-asset-deposit-allowlist
Jul 17, 2026
Merged

feat: multi-asset deposit support via shared allowlist [NF-05]#129
wumibals merged 4 commits into
LadderMine:mainfrom
AbdulmujibOladayo:feat/nf-05-multi-asset-deposit-allowlist

Conversation

@AbdulmujibOladayo

Copy link
Copy Markdown
Contributor

Summary

Wires shared::allowlist into VaultRouter as a deposit-asset registry, enabling multi-asset deposits (e.g. USDC + EURC) while keeping per-asset balances independent.

Changes

contracts/vault_router/Cargo.toml

  • Added shared = { path = "../shared" } dependency

contracts/vault_router/src/error.rs

  • Added AssetNotAllowed = 4

contracts/vault_router/src/lib.rs

  • initialize() now takes initial_assets: Vec<Address> and calls shared::allowlist::init_allowlist()
  • deposit(user, tier, asset, amount) — validates asset against the allowlist before forwarding; rejects with AssetNotAllowed for unlisted assets
  • withdraw(user, tier, asset) and early_exit(user, tier, asset) — asset-aware pass-through
  • add_deposit_asset(admin, asset) / remove_deposit_asset(admin, asset) — admin-gated allowlist management
  • is_deposit_asset_allowed(asset) -> bool — read-only query
  • position(user, tier, asset) — per-asset position query

Tests

  • test_allowed_asset_deposit_succeeds
  • test_non_allowed_asset_deposit_rejected (#[should_panic])
  • test_add_then_deposit_second_asset — adds EURC, verifies deposit succeeds
  • test_remove_asset_blocks_future_deposits
  • test_per_asset_position_is_independent — USDC and EURC positions are independent
  • Below-min-deposit guards for Flex and L12
  • Double-initialize guard

Acceptance Criteria

  • shared::allowlist is now imported and has active call sites
  • Non-allowlisted asset deposit rejected with AssetNotAllowed
  • Per-asset positions queried independently
  • Existing USDC path unchanged (USDC passed as initial_assets in initialize)

closes #80

@vercel

vercel Bot commented Jul 16, 2026

Copy link
Copy Markdown

@AbdulmujibOladayo is attempting to deploy a commit to the wumibals' projects Team on Vercel.

A member of the Team first needs to authorize it.

@wumibals wumibals left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@AbdulmujibOladayo
AbdulmujibOladayo force-pushed the feat/nf-05-multi-asset-deposit-allowlist branch from 27dd1b4 to 6ea2638 Compare July 17, 2026 13:51

@wumibals wumibals left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

outstanding work

@wumibals
wumibals merged commit 81590a8 into LadderMine:main Jul 17, 2026
3 of 4 checks passed
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.

[NF-05] [CONTRACT] Multi-Asset Deposit Support

2 participants