{
    "Function": "addCurrency",
    "File": "src/PoolManager.sol",
    "Parent Contracts": [
        "src/util/Auth.sol"
    ],
    "High-Level Calls": [
        "IERC20",
        "EscrowLike",
        "EscrowLike",
        "InvestmentManagerLike"
    ],
    "Internal Calls": [
        "require(bool,string)",
        "onlyGateway",
        "require(bool,string)",
        "require(bool,string)",
        "require(bool,string)"
    ],
    "Library Calls": [],
    "Low-Level Calls": [],
    "Code": "function addCurrency(uint128 currency, address currencyAddress) public onlyGateway {\n        // Currency index on the Centrifuge side should start at 1\n        require(currency != 0, \"PoolManager/currency-id-has-to-be-greater-than-0\");\n        require(currencyIdToAddress[currency] == address(0), \"PoolManager/currency-id-in-use\");\n        require(currencyAddressToId[currencyAddress] == 0, \"PoolManager/currency-address-in-use\");\n        require(IERC20(currencyAddress).decimals() <= MAX_CURRENCY_DECIMALS, \"PoolManager/too-many-currency-decimals\");\n\n        currencyIdToAddress[currency] = currencyAddress;\n        currencyAddressToId[currencyAddress] = currency;\n\n        // Enable taking the currency out of escrow in case of redemptions\n        EscrowLike(escrow).approve(currencyAddress, investmentManager.userEscrow(), type(uint256).max);\n\n        // Enable taking the currency out of escrow in case of decrease invest orders\n        EscrowLike(escrow).approve(currencyAddress, address(investmentManager), type(uint256).max);\n\n        emit CurrencyAdded(currency, currencyAddress);\n    }"
}