Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
hpmaxi
force-pushed
the
feat/152-deposit-cap
branch
from
September 24, 2026 19:43
a2480ef to
249ef4a
Compare
luchobonatti
added this pull request to stack #158
September 25, 2026 16:43
Add deposit_cap setting for governance to configure maximum vault assets, defaulting to unbounded. Enforces cap at deposit request time, restores headroom upon cancellation, and emits DepositCapUpdated. Closes #152
hpmaxi
force-pushed
the
feat/152-deposit-cap
branch
from
September 25, 2026 18:08
249ef4a to
a5990a4
Compare
luchobonatti
left a comment
Member
There was a problem hiding this comment.
Cap logic reads sound and the rebase is clean. Two small things inline.
| } | ||
|
|
||
| #[only_admin] | ||
| pub fn set_deposit_cap(e: &Env, cap: Option<i128>, caller: Address) { |
Member
There was a problem hiding this comment.
New governance parameter, but §8.8's Configuration row still lists only bounds, freshness, timelock and wind-down delay. Worth adding the cap there?
| @@ -164,6 +165,27 @@ impl AsyncVault { | |||
| .unwrap_or_else(|| panic_with_error!(e, VaultError::AmountTooLarge)) | |||
| } | |||
Member
There was a problem hiding this comment.
The PR body names total_economic_assets(), which is not in the diff. Leftover from before the metric was simplified?
This branch was successfully deployed
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.
Summary of changes
deposit_capconfiguration key to instance storage, defaulting toNone(unbounded deposits).set_deposit_cap(Option<i128>, caller)to set, adjust, or clear the cap.deposit_cap() -> Option<i128>andtotal_economic_assets() -> i128(cash held + net deployed - committed redemptions).deposit::request, returningVaultError::DepositCapExceeded (6062)if the deposit would breach the cap.DepositCapUpdatedevent capturing previous and new cap values.contracts/async-vault/src/test/deposit_cap.rsverifying boundary values, cancellations, deployments, redemptions, and unauthorized access rejection.Closes #152