Skip to content

Commit

Permalink
fix: flow
Browse files Browse the repository at this point in the history
  • Loading branch information
Schlagonia committed Sep 11, 2024
1 parent c3de009 commit a3e186f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions contracts/VaultV3.vy
Original file line number Diff line number Diff line change
Expand Up @@ -457,12 +457,13 @@ def _convert_to_shares(assets: uint256, rounding: Rounding) -> uint256:
return assets

total_supply: uint256 = self._total_supply()
total_assets: uint256 = self._total_assets()

# if total_supply is 0, price_per_share is 1
if total_supply == 0:
return assets

total_assets: uint256 = self._total_assets()

# if total_Supply > 0 but total_assets == 0, price_per_share = 0
if total_assets == 0:
return 0
Expand Down Expand Up @@ -646,7 +647,7 @@ def _deposit(sender: address, recipient: address, assets: uint256, shares: uint2
# Record the change in total assets.
self.total_idle += assets

# Issue the corresponding shares for amount.
# Issue the corresponding shares for assets.
self._issue_shares(shares, recipient)

log Deposit(sender, recipient, assets, shares)
Expand Down

0 comments on commit a3e186f

Please sign in to comment.