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

Pause contracts #311

Merged
merged 11 commits into from
Jul 26, 2021
Merged

Pause contracts #311

merged 11 commits into from
Jul 26, 2021

Conversation

smbsp
Copy link
Contributor

@smbsp smbsp commented Jul 9, 2021

@smbsp smbsp requested a review from tjcloa July 9, 2021 21:10
@smbsp smbsp self-assigned this Jul 9, 2021
@tjcloa
Copy link
Contributor

tjcloa commented Jul 10, 2021

update
moved to a separate task "Refactor protocol pauser #319"

here is an overall idea of implementation
as discussed primarily with @smbsp

  1. _setTarget(this.swapExternal.selector, target);
    is replaced for
    _setTarget(this.swapExternal.selector>>1, target);
    in all modules
    that will lead to calling non-existing functions from the protocol, but this is controllable (see next)
  2. add fallback functions to all modules which will serve as a hook prior to calling any module function
  3. in the fallback function
  • check that the protocol is not on pause and virtually any preliminary processing can be done there
  • unshift func sig to get the real one: msg.sig<<1
  • check that the unshifted (msg.sig<<1) sig exists
  • call the func with unshifted (msg.sig<<1) signature

@smbsp smbsp requested a review from tjcloa July 12, 2021 17:12
Copy link

@korepkorep korepkorep left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Several code quality issues that don't endanger contracts` security

contracts/modules/ProtocolSettings.sol Show resolved Hide resolved
@smbsp smbsp merged commit 61cbd56 into development Jul 26, 2021
@smbsp smbsp deleted the pause-contracts branch July 26, 2021 08:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add pausable to all logic contracts
3 participants