Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some view functions will revert when the system is paused #5

Open
hats-bug-reporter bot opened this issue Jan 16, 2025 · 1 comment
Open

Some view functions will revert when the system is paused #5

hats-bug-reporter bot opened this issue Jan 16, 2025 · 1 comment
Labels
invalid This doesn't seem right

Comments

@hats-bug-reporter
Copy link

Github username: --
Twitter username: --
HATS Profile: ---

Beneficiary: 0x3828b7Dff72E340B44f3A0270574dDE9276D5FD3
Submission hash (on-chain): 0x783ca866be3dcff95ec8c06381655bf932675ee614a8ddacfe3416723bdcd251
Severity: low

Description:
In recent changes, pause functionality was added to pause governance and locking functions.

The issue is this functionality can lead to the revert of some view functions:

  • Locking::totalSupply()
  • Locking::balanceOf()
  • LockingVotes::getVotes()
  • LockingVotes::getPastVotes()
  • LockingVotes::getPastTotalSupply()

This issue can lead to the broke of third-party contracts that rely on these view functions to perform, and it's not the intended behavior.

Recommendation

To fix this issue, consider implementing the whenNotPaused modifier:

modifier whenNotPaused(){
      require(!paused, "locking is paused");
      _;
    }

Then, add this modifier to the functions that need to revert when the protocol is paused.

@nvtaveras
Copy link
Collaborator

As mentioned in the scope of the audit, the revert of all the above functions is intentional in order to pause related Locking and Governance functions during the L2 transition period.

@nvtaveras nvtaveras added the invalid This doesn't seem right label Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

1 participant