Submitted by gpersoon
Every time you deposit some assets in the vault (via deposit() of MochiVault.sol) then lastDeposit[_id] is set to block.timestamp.
The modifier wait() checks this value and makes sure you cannot withdraw for delay() blocks.
The default value for delay() is 3 minutes.
Knowing this delay you can do a griefing attack:
On chains with low gas fees: every 3 minutes deposit a tiny amount for a specific NFT-id (which has a large amount of assets).
On chains with high gas fees: monitor the mempool for a withdraw() transaction and frontrun it with a deposit()
This way the owner of the NFT-id can never withdraw the funds.
Create a mechanism where you only block the withdraw of recently deposited funds
ryuheimat (Mochi) confirmed:
