Submitted by obront, also found by unforgiven and rvierdiiev
https://github.com/code-423n4/2023-01-astaria/blob/1bfc58b42109b839528ab1c21dc9803d663df898/src/WithdrawProxy.sol#L152-L161
The WithdrawProxy contract has the onlyWhenNoActiveAuction modifier on the withdraw() and redeem() functions. This modifier stops these functions from being called when an auction is active:
Furthermore, both withdraw() and redeem() can only be called when totalAssets() > 0 based on logic within those functions.
The intention of these two checks is that the WithdrawProxy shares can only be cashed out after the PublicVault has called transferWithdrawReserve.
However, because s.finalAuctionEnd == 0 before an auction has started, and totalAssets() is calculated by taking the balance of the contract directly (ERC20(asset()).balanceOf(address(this));), a user may redeem their shares before the vault has been fully funded, and take less than their share of the balance, benefiting the other withdrawer.
Add an additional storage variable that is explicitly switched to open when it is safe to withdraw funds.
SantiagoGregory (Astaria) acknowledged and commented:
Picodes (judge) commented:
