You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At present a user can spawn a vault with invalid/misconfigured parameters, e.g., one where VestingStart > VestingEnd (see below thread). Do we want to forbid this by causing Spawn txs for such a vault to fail? We might also want to check that the vault contains at least TotalAmount before it's spawned. Note, however, that one possible adverse outcome if we go this route is that someone might deposit coins to an address under the mistaken belief that they could later spawn a vault there, then find out that they can't spawn the vault because the params are invalid, which means the coins would be stuck.
This however raises the question - do we want to allow Spawning of misconfigured/invalid Vaults in the first place? Examples would be an insufficient balance, or VestingStart > VestingEnd. With the code as it stands there's no harm in allowing them, and I've written the logic here in such a way that the funds in the vault can still be spent. We may also want to prevent Spawn of any Vault other than the genesis Vaults to prevent this sort of issue.
I prefer when objects in invalid state cannot exist in the first place rather than have to have checks around in the logic because the checks are easy to miss or get wrong.
If VestingStart > VestingEnd, no Spend can occur until VestingStart layer, at which point the TotalAmount becomes available. If account balance < unvested portion of TotalAmount, no Spend can occur, but this can always be remedied by sending more coins to the account.
I think VestingStart > VestingEnd is not possible because of this check:
At present a user can spawn a vault with invalid/misconfigured parameters, e.g., one where VestingStart > VestingEnd (see below thread). Do we want to forbid this by causing Spawn txs for such a vault to fail? We might also want to check that the vault contains at least TotalAmount before it's spawned. Note, however, that one possible adverse outcome if we go this route is that someone might deposit coins to an address under the mistaken belief that they could later spawn a vault there, then find out that they can't spawn the vault because the params are invalid, which means the coins would be stuck.
Originally posted by @poszu in #5840 (comment)
The text was updated successfully, but these errors were encountered: