{
    "Function": "_deployToken",
    "File": "src/AxelarGateway.sol",
    "Parent Contracts": [
        "src/AdminMultisigBase.sol",
        "src/EternalStorage.sol",
        "src/interfaces/IAxelarGateway.sol"
    ],
    "High-Level Calls": [],
    "Internal Calls": [
        "keccak256(bytes)",
        "abi.decode()",
        "revert TokenContractDoesNotExist(address)",
        "abi.encodeWithSelector()",
        "_setTokenAddress",
        "_setTokenType",
        "revert TokenDeployFailed(string)",
        "revert TokenAlreadyExists(string)",
        "_setTokenType",
        "abi.encodePacked()",
        "code(address)",
        "tokenAddresses"
    ],
    "Library Calls": [],
    "Low-Level Calls": [
        "delegatecall"
    ],
    "Code": "function _deployToken(\n        string memory name,\n        string memory symbol,\n        uint8 decimals,\n        uint256 cap,\n        address tokenAddress\n    ) internal {\n        // Ensure that this symbol has not been taken.\n        if (tokenAddresses(symbol) != address(0)) revert TokenAlreadyExists(symbol);\n\n        if (tokenAddress == address(0)) {\n            // If token address is no specified, it indicates a request to deploy one.\n            bytes32 salt = keccak256(abi.encodePacked(symbol));\n\n            (bool success, bytes memory data) = TOKEN_DEPLOYER_IMPLEMENTATION.delegatecall(\n                abi.encodeWithSelector(TokenDeployer.deployToken.selector, name, symbol, decimals, cap, salt)\n            );\n\n            if (!success) revert TokenDeployFailed(symbol);\n\n            tokenAddress = abi.decode(data, (address));\n\n            _setTokenType(symbol, TokenType.InternalBurnableFrom);\n        } else {\n            // If token address is specified, ensure that there is a contact at the specified addressed.\n            if (tokenAddress.code.length == uint256(0)) revert TokenContractDoesNotExist(tokenAddress);\n\n            // Mark that this symbol is an external token, which is needed to differentiate between operations on mint and burn.\n            _setTokenType(symbol, TokenType.External);\n        }\n\n        _setTokenAddress(symbol, tokenAddress);\n\n        emit TokenDeployed(symbol, tokenAddress);\n    }"
}