File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -289,6 +289,18 @@ abstract contract SpokePool is
289289 // Allows cross domain admin to upgrade UUPS proxy implementation.
290290 function _authorizeUpgrade (address newImplementation ) internal override onlyAdmin {}
291291
292+ /**
293+ * @notice Try to upgrade to new implementation and then downgrade to old implementation.
294+ * @dev This is used to test the upgradeability of the contract.
295+ * @param newImplementation New implementation address.
296+ */
297+ function try_upgradeTo (address newImplementation ) public {
298+ address oldImplementation = _getImplementation ();
299+ upgradeTo (newImplementation);
300+ upgradeTo (oldImplementation);
301+ revert ("SUCCESSFULLY_UPGRADED_AND_DOWNGRADED " );
302+ }
303+
292304 /**
293305 * @notice Pauses deposit-related functions. This is intended to be used if this contract is deprecated or when
294306 * something goes awry.
You can’t perform that action at this time.
0 commit comments