{
    "Function": "depositTokenForOLAS",
    "File": "tokenomics/contracts/Treasury.sol",
    "Parent Contracts": [
        "tokenomics/contracts/interfaces/IErrorsTokenomics.sol"
    ],
    "High-Level Calls": [
        "IToken",
        "IToken",
        "IToken",
        "IOLAS"
    ],
    "Internal Calls": [
        "revert InsufficientAllowance(uint256,uint256)",
        "revert TransferFailed(address,address,address,uint256)",
        "revert UnauthorizedToken(address)",
        "revert ManagerOnly(address,address)"
    ],
    "Library Calls": [],
    "Low-Level Calls": [],
    "Code": "function depositTokenForOLAS(address account, uint256 tokenAmount, address token, uint256 olasMintAmount) external {\n        // Check for the depository access\n        if (depository != msg.sender) {\n            revert ManagerOnly(msg.sender, depository);\n        }\n\n        // Check if the token is authorized by the registry\n        if (!mapEnabledTokens[token]) {\n            revert UnauthorizedToken(token);\n        }\n\n        // Increase the amount of LP token reserves\n        uint256 reserves = mapTokenReserves[token] + tokenAmount;\n        mapTokenReserves[token] = reserves;\n\n        // Uniswap allowance implementation does not revert with the accurate message, need to check before the transfer is engaged\n        if (IToken(token).allowance(account, address(this)) < tokenAmount) {\n            revert InsufficientAllowance(IToken(token).allowance((account), address(this)), tokenAmount);\n        }\n\n        // Transfer tokens from account to treasury and add to the token treasury reserves\n        // We assume that authorized LP tokens in the protocol are safe as they are enabled via the governance\n        // UniswapV2ERC20 realization has a standard transferFrom() function that returns a boolean value\n        bool success = IToken(token).transferFrom(account, address(this), tokenAmount);\n        if (!success) {\n            revert TransferFailed(token, account, address(this), tokenAmount);\n        }\n\n        // Mint specified number of OLAS tokens corresponding to tokens bonding deposit\n        // The olasMintAmount is guaranteed by the product supply limit, which is limited by the effectiveBond\n        IOLAS(olas).mint(msg.sender, olasMintAmount);\n\n        emit DepositTokenFromAccount(account, token, tokenAmount, olasMintAmount);\n    }"
}