Skip to content

Commit

Permalink
Inlining math for totalAssets()
Browse files Browse the repository at this point in the history
  • Loading branch information
dimpar committed Apr 8, 2024
1 parent 1f90524 commit 791b10c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions core/contracts/stBTC.sol
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,8 @@ contract stBTC is ERC4626Fees, PausableOwnable {
/// @notice Returns the total amount of assets held by the vault across all
/// allocations and this contract.
function totalAssets() public view override returns (uint256) {
uint256 totalAmount = IERC20(asset()).balanceOf(address(this));
totalAmount += dispatcher.totalAssets();
return totalAmount;
return
IERC20(asset()).balanceOf(address(this)) + dispatcher.totalAssets();
}

/// @notice Mints shares to receiver by depositing exactly amount of
Expand Down

0 comments on commit 791b10c

Please sign in to comment.