{
    "Function": "deployToken",
    "File": "contracts/AxelarGateway.sol",
    "Parent Contracts": [
        "contracts/AdminMultisigBase.sol",
        "contracts/EternalStorage.sol",
        "contracts/interfaces/IAxelarGateway.sol"
    ],
    "High-Level Calls": [],
    "Internal Calls": [
        "revert TokenAlreadyExists(string)",
        "tokenAddresses",
        "_setTokenType",
        "revert TokenContractDoesNotExist(address)",
        "_setTokenDailyMintLimit",
        "abi.encodePacked()",
        "revert TokenDeployFailed(string)",
        "abi.decode()",
        "_setTokenAddress",
        "_setTokenType",
        "onlySelf",
        "keccak256(bytes)",
        "code(address)",
        "abi.decode()",
        "abi.encodeWithSelector()"
    ],
    "Library Calls": [],
    "Low-Level Calls": [
        "delegatecall"
    ],
    "Code": "function deployToken(bytes calldata params, bytes32) external onlySelf {\n        (string memory name, string memory symbol, uint8 decimals, uint256 cap, address tokenAddress, uint256 dailyMintLimit) = abi.decode(\n            params,\n            (string, string, uint8, uint256, address, uint256)\n        );\n\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(ITokenDeployer.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 address.\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        _setTokenDailyMintLimit(symbol, dailyMintLimit);\n\n        emit TokenDeployed(symbol, tokenAddress);\n    }"
}