diff --git a/solidity/contracts/system/TBTCSystem.sol b/solidity/contracts/system/TBTCSystem.sol index 343ac6ffd..8af499ad9 100644 --- a/solidity/contracts/system/TBTCSystem.sol +++ b/solidity/contracts/system/TBTCSystem.sol @@ -185,16 +185,27 @@ contract TBTCSystem is Ownable, ITBTCSystem, DepositLog { function beginLotSizesUpdate(uint64[] calldata _lotSizes) external onlyOwner { - for( uint i = 0; i < _lotSizes.length; i++){ - if (_lotSizes[i] == 10**8){ - lotSizesSatoshis = _lotSizes; - emit LotSizesUpdateStarted(_lotSizes, block.timestamp); - newLotSizesSatoshis = _lotSizes; - lotSizesChangeInitiated = block.timestamp; - return; + bool hasSingleBitcoin = false; + for (uint i = 0; i < _lotSizes.length; i++) { + if (_lotSizes[i] == 10**8) { + hasSingleBitcoin = true; + } else if (_lotSizes[i] < 50 * 10**3) { + // Failed the minimum requirement, break on out. + revert("Lot sizes less than 0.0005 BTC are not allowed"); + } else if (_lotSizes[i] > 10 * 10**8) { + // Failed the maximum requirement, break on out. + revert("Lot sizes greater than 10 BTC are not allowed"); } + + newLotSizesSatoshis = _lotSizes[i]; } - revert("Lot size array must always contain 1BTC"); + + require(hasSingleBitcoin, "Lot size array must always contain 1BTC"); + + lotSizesSatoshis = _lotSizes; + emit LotSizesUpdateStarted(_lotSizes, block.timestamp); + newLotSizesSatoshis = _lotSizes; + lotSizesChangeInitiated = block.timestamp; } /// @notice Set the system collateralization levels