The maxTotalLocked variable in the contract is supposed to check for the max amount locked in contract. This check is missing when creating a new position/ increasing a previous position.
It can be seen that the check for the MAXTOTAL_LOCK_AMOUNT is missing. This variable was initialized as 1B
function lock(uint256 amount, uint256 duration) external nonReentrant whenNotPaused {
if (amount == 0) revert InvalidAmount();
if (amount > MAX_LOCK_AMOUNT) revert AmountExceedsLimit();
if (totalSupply() + amount > MAX_TOTAL_SUPPLY) revert TotalSupplyLimitExceeded();
if (duration < MIN_LOCK_DURATION || duration > MAX_LOCK_DURATION)
revert InvalidLockDuration();
raacToken.safeTransferFrom(msg.sender, address(this), amount);
uint256 unlockTime = block.timestamp + duration;
_lockState.createLock(msg.sender, amount, duration);
_updateBoostState(msg.sender, amount);
(int128 bias, int128 slope) = _votingState.calculateAndUpdatePower(
msg.sender,
amount,
unlockTime
);
uint256 newPower = uint256(uint128(bias));
_checkpointState.writeCheckpoint(msg.sender, newPower);
_mint(msg.sender, newPower);
emit LockCreated(msg.sender, amount, unlockTime);
}
function _initializeLockParameters() internal {
_lockState.minLockDuration = MIN_LOCK_DURATION;
_lockState.maxLockDuration = MAX_LOCK_DURATION;
_lockState.maxLockAmount = MAX_LOCK_AMOUNT;
_lockState.maxTotalLocked = MAX_TOTAL_LOCKED_AMOUNT;
}