Skip to content

Commit

Permalink
Upgrade mechanism improvement (#17049)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bridgerz authored and patrickkuo committed May 9, 2024
1 parent a728cde commit 52c2db9
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions bridge/evm/contracts/utils/CommitteeUpgradeable.sol
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,15 @@ abstract contract CommitteeUpgradeable is
_upgradeAuthorized = true;
// upgrade contract
upgradeToAndCall(implementation, callData); // Upgraded event emitted with new implementation address
// reset upgrade authorization
_upgradeAuthorized = false;
}

/* ========== INTERNAL FUNCTIONS ========== */

/// @notice Authorizes the upgrade of the inheriting contract.
/// @dev The _upgradeAuthorized state variable can only be set with the upgradeWithSignatures
/// function, meaning that the upgrade can only be authorized by the committee.
function _authorizeUpgrade(address) internal view override {
function _authorizeUpgrade(address) internal override {
require(_upgradeAuthorized, "CommitteeUpgradeable: Unauthorized upgrade");
_upgradeAuthorized = false;
}
}

0 comments on commit 52c2db9

Please sign in to comment.