TraitForgeNft.sol :: _incrementGeneration() will never be able to update to the next generation because the transaction will always revert due to the use of the onlyOwner modifier instead of onlyAllowedCaller in EntropyGenerator.sol.
Audit: 2024-07-traitforge-findings
Severity: HIGH

# Lines of code

https://github.com/code-423n4/2024-07-traitforge/blob/279b2887e3d38bc219a05d332cbcb0655b2dc644/contracts/TraitForgeNft/TraitForgeNft.sol#L353
https://github.com/code-423n4/2024-07-traitforge/blob/279b2887e3d38bc219a05d332cbcb0655b2dc644/contracts/EntropyGenerator/EntropyGenerator.sol#L25-L28
https://github.com/code-423n4/2024-07-traitforge/blob/279b2887e3d38bc219a05d332cbcb0655b2dc644/contracts/EntropyGenerator/EntropyGenerator.sol#L206-L216


# Vulnerability details

## Impact
**`_incrementGeneration()`** is a private and is triggered when **`maxTokensPerGen`** is reached. It then calls **`initializeAlphaIndices()`** in the **`EntropyGenerator.sol`**. However, the transaction always reverts because it uses the **`onlyOwner`** modifier instead of **`onlyAllowedCaller`**.
## Proof of Concept
**`_incrementGeneration()`** is invoked by **`mintToken()`**, **`forge()`**, and **`mintWithBudget()`** when **`maxTokensPerGen`** is reached.
```Solidity
function _incrementGeneration() private {
    require(
      generationMintCounts[currentGeneration] >= maxTokensPerGen,
      'Generation limit not yet reached'
    );
    
    currentGeneration++;
    generationMintCounts[currentGeneration] = 0;
    priceIncrement = priceIncrement + priceIncrementByGen;
@>  entropyGenerator.initializeAlphaIndices();
    emit GenerationIncremented(currentGeneration);
  }
```
As you can see, it calls **`entropyGenerator.initializeAlphaIndices()`** in **`EntropyGenerator.sol`**.
```Solidity
function initializeAlphaIndices() public whenNotPaused onlyOwner {
    uint256 hashValue = uint256(
      keccak256(abi.encodePacked(blockhash(block.number - 1), block.timestamp))
    );

    uint256 slotIndexSelection = (hashValue % 258) + 512;
    uint256 numberIndexSelection = hashValue % 13;

    slotIndexSelectionPoint = slotIndexSelection;
    numberIndexSelectionPoint = numberIndexSelection;
  }
```
As you can see, the function is restricted by the **`onlyOwner`** modifier. However, this owner is the contract deployer, not TraitForgeNft. The contract has the **`onlyAllowedCaller()`** modifier, which designates **`allowedCaller`** to TraitForgeNft in the constructor as an authorized caller for functions using this modifier.
```Solidity
modifier onlyAllowedCaller() {
    require(msg.sender == allowedCaller, 'Caller is not allowed');
    _;
  }
```
Using **`onlyOwner`** instead of **`onlyAllowedCaller`** causes the transaction to revert each time an attempt is made to increment to the next generation. This prevents the generation from being incremented and results in a DOS.

To observe the issue, run the following POC by copying the code into **`TraitForgeNft.test.ts`**.
```Solidity
it('Next generation can never be reached because TraitForgeNft is not the owner', async () => {
      fastForward(24 * 60 * 60 + 1);
      for (let i = 0; i < 10000; i++) {
        
          const tx = await nft.connect(user2).mintToken(merkleInfo.whitelist[1].proof, {
            value: e