Swap the TBTCSystem initialized flag for timestamp
Keeping the block timestamp will allow keeping track of the age of the
deloyment for supply cap purposes.
@@ -59,7 +59,7 @@ contract TBTCSystem is Ownable, ITBTCSystem, DepositLog {
address _ethBackedFactory
);
- bool _initialized = false;
+ uint256 initializedTimestamp = 0;
uint256 pausedTimestamp;
uint256 constant pausedDuration = 10 days;
@@ -123,7 +123,7 @@ contract TBTCSystem is Ownable, ITBTCSystem, DepositLog {
uint16 _keepThreshold,
uint16 _keepSize
) external onlyOwner {
- require(!_initialized, "already initialized");
+ require(initializedTimestamp == 0, "already initialized");
keepFactorySelection.initialize(_defaultKeepFactory);
@@ -143,7 +143,7 @@ contract TBTCSystem is Ownable, ITBTCSystem, DepositLog {
_keepSize
);
setTbtcDepositToken(_tbtcDepositToken);
- _initialized = true;
+ initializedTimestamp = block.timestamp;
allowNewDeposits = true;
}
