Skip to content

Commit

Permalink
Changing the order of actions with updating totalAssets()
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelvm5 committed Sep 6, 2024
1 parent 22f53dc commit 2530d83
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/contracts/extension/ERC4626StakeTokenUpgradeable.sol
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,9 @@ abstract contract ERC4626StakeTokenUpgradeable is
uint256 assets,
uint256 shares
) internal override {
_getStakeTokenStorage()._totalAssets += assets.toUint192();

super._deposit(caller, receiver, assets, shares);

_getStakeTokenStorage()._totalAssets += assets.toUint192();
}

function _withdraw(
Expand All @@ -171,9 +171,9 @@ abstract contract ERC4626StakeTokenUpgradeable is
uint256 assets,
uint256 shares
) internal override {
_getStakeTokenStorage()._totalAssets -= assets.toUint192();

super._withdraw(caller, receiver, owner, assets, shares);

_getStakeTokenStorage()._totalAssets -= assets.toUint192();
}

function _cooldown(address from) internal virtual {
Expand Down

0 comments on commit 2530d83

Please sign in to comment.