Commit 2def14fc authored by Kelvin Fichter's avatar Kelvin Fichter

fix(ctb): no continue on dictator exit or finalize

Prevents a user from continuing to carry out SystemDictator steps after
the process has been exited or finalized.
parent 4f54bcdb
...@@ -126,6 +126,11 @@ contract SystemDictator is OwnableUpgradeable { ...@@ -126,6 +126,11 @@ contract SystemDictator is OwnableUpgradeable {
*/ */
bool public finalized; bool public finalized;
/**
* @notice Whether or not the deployment has been exited.
*/
bool public exited;
/** /**
* @notice Address of the old L1CrossDomainMessenger implementation. * @notice Address of the old L1CrossDomainMessenger implementation.
*/ */
...@@ -137,7 +142,9 @@ contract SystemDictator is OwnableUpgradeable { ...@@ -137,7 +142,9 @@ contract SystemDictator is OwnableUpgradeable {
* @param _step Current step. * @param _step Current step.
*/ */
modifier step(uint8 _step) { modifier step(uint8 _step) {
require(currentStep == _step, "BaseSystemDictator: incorrect step"); require(!finalized, "SystemDictator: already finalized");
require(!exited, "SystemDictator: already exited");
require(currentStep == _step, "SystemDictator: incorrect step");
_; _;
currentStep++; currentStep++;
} }
...@@ -402,6 +409,7 @@ contract SystemDictator is OwnableUpgradeable { ...@@ -402,6 +409,7 @@ contract SystemDictator is OwnableUpgradeable {
); );
} }
// Mark the deployment as finalized.
finalized = true; finalized = true;
} }
...@@ -422,5 +430,8 @@ contract SystemDictator is OwnableUpgradeable { ...@@ -422,5 +430,8 @@ contract SystemDictator is OwnableUpgradeable {
// Unset the DTL shutoff block which will allow the DTL to sync again. // Unset the DTL shutoff block which will allow the DTL to sync again.
config.globalConfig.addressManager.setAddress("DTL_SHUTOFF_BLOCK", address(0)); config.globalConfig.addressManager.setAddress("DTL_SHUTOFF_BLOCK", address(0));
// Mark the deployment as exited.
exited = true;
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment