Skip to content

Add Fast Unpause functionality - #337

Open
shahthepro wants to merge 7 commits into
mainfrom
shah/fast-unpause
Open

Add Fast Unpause functionality#337
shahthepro wants to merge 7 commits into
mainfrom
shah/fast-unpause

Conversation

@shahthepro

@shahthepro shahthepro commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator

Code changes

  • Adds support for fast unpause
  • Adds a new guardian address (points to 2/8), this is need to enable a Safe module that'll allow HyperNative to quickly pause actions
  • Adds a new admin address storage slot that points to the 5/8
  • Ownable already has a admin for proxy admin, so the variable is named multisigAdmin instead to avoid confusion

Contract size impact

Fast Unpause increases the runtime size of contracts inheriting from AbstractARM

Contract main This PR Increase EIP-170 margin
MultiAssetARM 23,964 bytes 24,350 bytes 386 bytes 226 bytes
EthenaARM 24,063 bytes 24,449 bytes 386 bytes 127 bytes
OriginARM 24,132 bytes 24,518 bytes 386 bytes 58 bytes
LidoARM 24,877 bytes 25,299 bytes 422 bytes 723 bytes over
EtherFiARM 24,877 bytes 25,299 bytes 422 bytes 723 bytes over

The WETH and USDC MultiAssetARM implementations upgraded by this PR remain below the 24,576-byte EIP-170 runtime limit.

LidoARM and EtherFiARM were already 301 bytes over the limit on main; this PR increases their excess to 723 bytes. They are therefore excluded from the deployment.

The CI contract-size check intentionally excludes LidoARM, EtherFiARM, and OriginARM.

naddison36
naddison36 previously approved these changes Aug 14, 2026

@naddison36 naddison36 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks nice and simple. Thanks

Comment thread src/contracts/AbstractARM.sol
naddison36
naddison36 previously approved these changes Aug 24, 2026

@naddison36 naddison36 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LTGM

Comment thread src/contracts/AbstractARM.sol Outdated

/// @dev Restricts to the owner, operator, guardian or adminMultisig. Pausing is the safe
/// direction, so the caller list is deliberately wide: any of them can trip the circuit breaker.
modifier onlyPauser() {

@clement-ux clement-ux Aug 24, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Non-blocking suggestion: we could consolidate onlyPauser and onlyUnpauser by checking msg.sig == this.pause.selector in a shared internal authorization helper, then have a single modifier call that helper. For example:

modifier onlyPauserOrUnpauser() {
    _checkPauserOrUnpauser();
    _;
}

function _checkPauserOrUnpauser() internal view {
    bool isPause = msg.sig == this.pause.selector;
    if (
        msg.sender != _owner() && msg.sender != adminMultisig
            && (!isPause || (msg.sender != operator && msg.sender != guardian))
    ) {
        if (isPause) revert OnlyPauser();
        revert OnlyUnpauser();
    }
}

Both pause() and unpause() would then use onlyPauserOrUnpauser.

It reduces bytecode size by 8. Not sure the change is worth it though.

clement-ux
clement-ux previously approved these changes Aug 25, 2026

@clement-ux clement-ux left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

While I've left a comment, I'm still approving it like this.

@shahthepro
shahthepro dismissed stale reviews from clement-ux and naddison36 via 6a8c37b August 26, 2026 13:29

@clement-ux clement-ux left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants