{
    "Function": "slitherConstructorConstantVariables",
    "File": "contracts/its/token-manager/TokenManager.sol",
    "Parent Contracts": [
        "contracts/its/utils/Implementation.sol",
        "contracts/its/utils/FlowLimit.sol",
        "contracts/its/utils/Operatable.sol",
        "contracts/its/interfaces/ITokenManager.sol",
        "contracts/its/interfaces/IImplementation.sol",
        "contracts/its/interfaces/IFlowLimit.sol",
        "contracts/its/interfaces/IOperatable.sol",
        "contracts/its/interfaces/ITokenManagerType.sol"
    ],
    "High-Level Calls": [],
    "Internal Calls": [
        "keccak256(bytes)",
        "keccak256(bytes)"
    ],
    "Library Calls": [],
    "Low-Level Calls": [],
    "Code": "abstract contract TokenManager is ITokenManager, Operatable, FlowLimit, Implementation {\n    using AddressBytesUtils for bytes;\n\n    IInterchainTokenService public immutable interchainTokenService;\n\n    /**\n     * @notice Constructs the TokenManager contract.\n     * @param interchainTokenService_ The address of the interchain token service\n     */\n    constructor(address interchainTokenService_) {\n        if (interchainTokenService_ == address(0)) revert TokenLinkerZeroAddress();\n        interchainTokenService = IInterchainTokenService(interchainTokenService_);\n    }\n\n    /**\n     * @dev A modifier that allows only the interchain token service to execute the function.\n     */\n    modifier onlyService() {\n        if (msg.sender != address(interchainTokenService)) revert NotService();\n        _;\n    }\n\n    /**\n     * @dev A modifier that allows only the token to execute the function.\n     */\n    modifier onlyToken() {\n        if (msg.sender != tokenAddress()) revert NotToken();\n        _;\n    }\n\n    /**\n     * @notice A function that should return the address of the token.\n     * Must be overridden in the inheriting contract.\n     * @return address address of the token.\n     */\n    function tokenAddress() public view virtual returns (address);\n\n    /**\n     * @dev This function should only be called by the proxy, and only once from the proxy constructor\n     * @param params the parameters to be used to initialize the TokenManager. The exact format depends\n     * on the type of TokenManager used but the first 32 bytes are reserved for the address of the operator,\n     * stored as bytes (to be compatible with non-EVM chains)\n     */\n    function setup(bytes calldata params) external override onlyProxy {\n        bytes memory operatorBytes = abi.decode(params, (bytes));\n        address operator_;\n        /**\n         * @dev Specifying an empty operator will default to the service being the operator. This makes it easy to deploy\n         * remote standardized tokens without knowing anything about the service address at the destination.\n         */\n        if (operatorBytes.length == 0) {\n            operator_ = address(interchainTokenService);\n        } else {\n            operator_ = operatorBytes.toAddress();\n        }\n        _setOperator(operator_);\n        _setup(params);\n    }\n\n    /**\n     * @notice Calls the service to initiate the a cross-chain transfer after taking the appropriate amount of tokens from the user.\n     * @param destinationChain the name of the chain to send tokens to.\n     * @param destinationAddress the address of the user to send tokens to.\n     * @param amount the amount of tokens to take from msg.sender.\n     */\n    function sendToken(\n        string calldata destinationChain,\n        bytes calldata destinationAddress,\n        uint256 amount,\n        bytes calldata metadata\n    ) external payable virtual {\n        address sender = msg.sender;\n        amount = _takeToken(sender, amount);\n        _addFlowOut(amount);\n        interchainTokenService.transmitSendToken{ value: msg.value }(\n            _getTokenId(),\n            sender,\n            destinationChain,\n            destinationAddress,\n            amount,\n            metadata\n        );\n    }\n\n    /**\n     * @notice Calls the service to initiate the a cross-chain transfer with data after taking the appropriate amount of tokens from the user.\n     * @param destinationChain the name of the chain to send tokens to.\n     * @param destinationAddress the address of the user to send tokens to.\n     * @param amount the amount of tokens to take from msg.sender.\n     * @param data the data to pass to the destination contract.\n     */\n    function callContractWithInterchainToken(\n        string calldata destinationChain,\n        bytes calldata destinationAddress,\n        uint256 amount,\n        bytes calldata data\n    ) external payable virtual {\n        address sender = msg.sender;\n        amount = _takeToken(sender, amount);\n        _addFlowOut(amount);\n        uint32 version = 0;\n        interchainTokenService.transmitSendToken{ value: msg.value }(\n            _getTokenId(),\n            sender,\n            destinationChain,\n            destinationAddress,\n            amount,\n            abi.encodePacked(version, data)\n        );\n    }\n\n    /**\n     * @notice Calls the service to initiate the a cross-chain transfer after taking the appropriate amount of tokens from the user. This can only be called by the token itself.\n     * @param sender the address of the user paying for the cross chain transfer.\n     * @param destinationChain the name of the chain to send tokens to.\n     * @param destinationAddress the address of the user to send tokens to.\n     * @param amount the amount of tokens to take from msg.sender.\n     */\n    function transmitInterchainTransfer(\n        address sender,\n        string calldata destinationChain,\n        bytes calldata destinationAddress,\n        uint256 amount,\n        bytes calldata metadata\n    ) external payable virtual onlyToken {\n        amount = _takeToken(sender, amount);\n        _addFlowOut(amount);\n        interchainTokenService.transmitSendToken{ value: msg.value }(\n            _getTokenId(),\n            sender,\n            destinationChain,\n            destinationAddress,\n            amount,\n            metadata\n        );\n    }\n\n    /**\n     * @notice This function gives token to a specified address. Can only be called by the service.\n     * @param destinationAddress the address to give tokens to.\n     * @param amount the amount of token to give.\n     * @return the amount of token actually given, which will onle be differen than `amount` in cases where the token takes some on-transfer fee.\n     */\n    function giveToken(address destinationAddress, uint256 amount) external onlyService returns (uint256) {\n        amount = _giveToken(destinationAddress, amount);\n        _addFlowIn(amount);\n        return amount;\n    }\n\n    /**\n     * @notice This function sets the flow limit for this TokenManager. Can only be called by the operator.\n     * @param flowLimit the maximum difference between the tokens flowing in and/or out at any given interval of time (6h)\n     */\n    function setFlowLimit(uint256 flowLimit) external onlyOperator {\n        _setFlowLimit(flowLimit);\n    }\n\n    /**\n     * @notice Transfers tokens from a specific address to this contract.\n     * Must be overridden in the inheriting contract.\n     * @param from The address from which the tokens will be sent\n     * @param amount The amount of tokens to receive\n     * @return uint amount of tokens received\n     */\n    function _takeToken(address from, uint256 amount) internal virtual returns (uint256);\n\n    /**\n     * @notice Transfers tokens from this contract to a specific address.\n     * Must be overridden in the inheriting contract.\n     * @param from The address to which the tokens will be sent\n     * @param amount The amount of tokens to send\n     * @return uint amount of tokens sent\n     */\n    function _giveToken(address from, uint256 amount) internal virtual returns (uint256);\n\n    /**\n     * @dev Additional setup logic to perform\n     * Must be overridden in the inheriting contract.\n     * @param params The setup parameters\n     */\n    function _setup(bytes calldata params) internal virtual;\n\n    /**\n     * @notice Gets the token ID from the token manager proxy.\n     * @return tokenId The ID of the token\n     */\n    function _getTokenId() internal view returns (bytes32 tokenId) {\n        tokenId = ITokenManagerProxy(address(this)).tokenId();\n    }\n}"
}