yearn / yearn-vaults-v3

GNU Affero General Public License v3.0
103 stars 37 forks source link

fix: minting when total supply is 0 but there are assets in the vault #118

Closed jmonteer closed 1 year ago

jmonteer commented 1 year ago

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes # (issue)

Checklist

pandadefi commented 1 year ago

It's a scenario I took into consideration during my review but couldn't find a scenario where it's possible

jmonteer commented 1 year ago

happens when all withdraws happen when locked profit > 0 (thus vault is the only one holding shares that are burnt over time, leading to a 0 totalSupply with assets)

This means that the first depositor after this happens will get a nice gift