Skip to content

Commit

Permalink
early exit
Browse files Browse the repository at this point in the history
  • Loading branch information
ungaro committed Dec 10, 2024
1 parent 7d6cf0c commit f71ed38
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions nest/src/ComponentToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -389,14 +389,13 @@ abstract contract ComponentToken is

// Get the pre-calculated values
uint256 claimableShares = $.sharesDepositRequest[controller];
assets = $.claimableDepositRequest[controller];

// Verify shares match exactly
if (shares != claimableShares) {
revert InvalidDepositAmount(shares, claimableShares);
}

// Reset state atomically
assets = $.claimableDepositRequest[controller];
$.claimableDepositRequest[controller] = 0;
$.sharesDepositRequest[controller] = 0;
} else {
Expand Down

0 comments on commit f71ed38

Please sign in to comment.