{
    "Function": "addTranche",
    "File": "src/PoolManager.sol",
    "Parent Contracts": [
        "src/util/Auth.sol"
    ],
    "High-Level Calls": [],
    "Internal Calls": [
        "onlyGateway",
        "require(bool,string)",
        "require(bool,string)"
    ],
    "Library Calls": [],
    "Low-Level Calls": [],
    "Code": "function addTranche(\n        uint64 poolId,\n        bytes16 trancheId,\n        string memory tokenName,\n        string memory tokenSymbol,\n        uint8 decimals\n    ) public onlyGateway {\n        Pool storage pool = pools[poolId];\n        require(pool.createdAt != 0, \"PoolManager/invalid-pool\");\n        Tranche storage tranche = pool.tranches[trancheId];\n        require(tranche.createdAt == 0, \"PoolManager/tranche-already-exists\");\n\n        tranche.poolId = poolId;\n        tranche.trancheId = trancheId;\n        tranche.decimals = decimals;\n        tranche.tokenName = tokenName;\n        tranche.tokenSymbol = tokenSymbol;\n        tranche.createdAt = block.timestamp;\n\n        emit TrancheAdded(poolId, trancheId);\n    }"
}