Skip to content

Commit

Permalink
chore: rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
Schlagonia committed Jan 29, 2024
1 parent 24c7c36 commit 9c41a27
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
8 changes: 4 additions & 4 deletions contracts/VaultV3.vy
Original file line number Diff line number Diff line change
Expand Up @@ -1186,6 +1186,7 @@ def _process_report(strategy: address) -> (uint256, uint256):
# We have a loss.
loss = unsafe_sub(current_debt, total_assets)

_asset: address = self.asset
### Asses Fees and Refunds ###

# For Accountant fee assessment.
Expand All @@ -1198,7 +1199,7 @@ def _process_report(strategy: address) -> (uint256, uint256):

if total_refunds > 0:
# Make sure we have enough approval and enough asset to pull.
total_refunds = min(total_refunds, min(ASSET.balanceOf(accountant), ASSET.allowance(accountant, self)))
total_refunds = min(total_refunds, min(ERC20(_asset).balanceOf(accountant), ERC20(_asset).allowance(accountant, self)))

# Total fees to charge in shares.
total_fees_shares: uint256 = 0
Expand All @@ -1220,7 +1221,7 @@ def _process_report(strategy: address) -> (uint256, uint256):
total_fees_shares = shares_to_burn * total_fees / (loss + total_fees)

# Get the protocol fee config for this vault.
protocol_fee_bps, protocol_fee_recipient = IFactory(FACTORY).protocol_fee_config()
protocol_fee_bps, protocol_fee_recipient = IFactory(self.factory).protocol_fee_config()

# If there is a protocol fee.
if protocol_fee_bps > 0:
Expand All @@ -1239,10 +1240,9 @@ def _process_report(strategy: address) -> (uint256, uint256):
total_supply: uint256 = self.total_supply
# The total shares the vault currently owns. Both locked and unlocked.
total_locked_shares: uint256 = self.balance_of[self]

# Get the desired end amount of shares after all accounting.
ending_supply: uint256 = total_supply + shares_to_lock - shares_to_burn - self._unlocked_shares()

# If we will end with more shares than we have now.
if ending_supply > total_supply:
# Issue the difference.
Expand Down
4 changes: 0 additions & 4 deletions contracts/test/mocks/ERC4626/MockTokenizedStrategy.sol
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,7 @@ contract MockTokenizedStrategy is TokenizedStrategy {
function availableDepositLimit(
address
) public view virtual returns (uint256) {
<<<<<<< HEAD
uint256 _totalAssets = _strategyStorage().totalAssets;
=======
uint256 _totalAssets = totalAssets();
>>>>>>> build: only burn or mint (#193)
uint256 _maxDebt = maxDebt;
return _maxDebt > _totalAssets ? _maxDebt - _totalAssets : 0;
}
Expand Down

0 comments on commit 9c41a27

Please sign in to comment.