Skip to content

Commit

Permalink
Merge pull request #2 from Maia-DAO/904
Browse files Browse the repository at this point in the history
Address #904
  • Loading branch information
0xLightt authored Aug 9, 2023
2 parents 48a9d83 + bb714f0 commit 0ef4552
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 @@ -170,8 +170,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 @@ -184,7 +184,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 0ef4552

Please sign in to comment.