Skip to content

Commit

Permalink
Address #904
Browse files Browse the repository at this point in the history
  • Loading branch information
0xLightt committed Aug 3, 2023
1 parent 48b9e50 commit bb714f0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/erc-20/ERC20Boost.sol
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ abstract contract ERC20Boost is ERC20, Ownable, IERC20Boost {

/// @inheritdoc IERC20Boost
function detach(address user) external {
require(_userGauges[user].remove(msg.sender));
require(_userGauges[user].remove(msg.sender)); // Remove from set. Should never fail.
delete getUserGaugeBoost[user][msg.sender];

emit Detach(user, msg.sender);
Expand Down Expand Up @@ -174,8 +174,8 @@ abstract contract ERC20Boost is ERC20, Ownable, IERC20Boost {
/// @inheritdoc IERC20Boost
function decrementGaugeBoost(address gauge, uint256 boost) public {
GaugeState storage gaugeState = getUserGaugeBoost[msg.sender][gauge];
if (boost >= gaugeState.userGaugeBoost) {
_userGauges[msg.sender].remove(gauge);
if (_deprecatedGauges.contains(gauge) || boost >= gaugeState.userGaugeBoost) {
require(_userGauges[msg.sender].remove(gauge)); // Remove from set. Should never fail.
delete getUserGaugeBoost[msg.sender][gauge];

emit Detach(msg.sender, gauge);
Expand All @@ -188,7 +188,7 @@ abstract contract ERC20Boost is ERC20, Ownable, IERC20Boost {

/// @inheritdoc IERC20Boost
function decrementGaugeAllBoost(address gauge) external {
require(_userGauges[msg.sender].remove(gauge));
require(_userGauges[msg.sender].remove(gauge)); // Remove from set. Should never fail.
delete getUserGaugeBoost[msg.sender][gauge];

emit Detach(msg.sender, gauge);
Expand Down

0 comments on commit bb714f0

Please sign in to comment.