-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Description
Background
The vault contract has WithdrawForDeployment which withdraws funds to whitelisted addresses and increases the control center's deployed amount (via UpdateDeployedAmount). We need the reverse operation to return funds from deployment back to the vault.
Current limitation
Control center's UpdateDeployedAmount only adds to deployed amount. It needs to support subtraction for this feature.
Requirements
1. Update Control Center
Modify UpdateDeployedAmount to support both directions, either:
- Option A: Create separate messages:
AddToDeployedAmountandSubFromDeployedAmount - Option B: Add a direction parameter (add/subtract)
2. Add Vault ExecuteMsg
DepositFromDeployment {}Implementation should:
- Validate caller is whitelisted (
validate_address_is_whitelisted) - Validate
info.fundscontains only the vault'sdeposit_denom - Convert deposited amount to base tokens (using
convert_deposit_token_into_base_token) - Call control center to subtract from deployed amount
- Leave the funds in vault's balance (nothing to do)
- Add relevant tests
Reference implementation: Mirror withdraw_for_deployment logic (contracts/inflow/vault/src/contract.rs) but with reverse "deployed amount" update (subtract).
Files to modify (non-exhaustive list):
packages/interface/src/inflow_control_center.rs-ExecuteMsgcontracts/inflow/control-center/src/contract.rs- Handler logicpackages/interface/src/inflow.rs-ExecuteMsgcontracts/inflow/vault/src/contract.rs- Handler + helper functioncontracts/inflow/control-center/src/testing.rs- Unit tests that use Control center'sUpdateDeployedAmountcontracts/inflow/vault/src/testing.rs- New tests
Copilot
Metadata
Metadata
Assignees
Labels
No labels