{
    "Function": "slitherConstructorConstantVariables",
    "File": "contracts/tokens/converter/Converter.sol",
    "Parent Contracts": [
        "contracts/shared/ProtocolConstants.sol",
        "contracts/interfaces/tokens/converter/IConverter.sol"
    ],
    "High-Level Calls": [],
    "Internal Calls": [],
    "Library Calls": [],
    "Low-Level Calls": [],
    "Code": "contract Converter is IConverter, ProtocolConstants {\r\n    /* ========== LIBRARIES ========== */\r\n\r\n    // Used for safe VADER & VETHER transfers\r\n    using SafeERC20 for IERC20;\r\n\r\n    // Using MerkleProof for validating claims\r\n    using MerkleProof for bytes32[];\r\n\r\n    /* ========== STATE VARIABLES ========== */\r\n\r\n    // The VETHER token\r\n    IERC20 public immutable vether;\r\n\r\n    // The VADER token\r\n    IERC20 public immutable vader;\r\n\r\n    // The VADER vesting contract\r\n    ILinearVesting public immutable vesting;\r\n\r\n    // The merkle proof root for validating claims\r\n    bytes32 public immutable root;\r\n\r\n    // Signals whether a particular leaf has been claimed of the merkle proof\r\n    mapping(bytes32 => bool) public claimed;\r\n\r\n    /* ========== CONSTRUCTOR ========== */\r\n\r\n    /**\r\n     * @dev Initializes the contract's {vether} and {vader} addresses.\r\n     *\r\n     * Performs rudimentary checks to ensure that the variables haven't\r\n     * been declared incorrectly.\r\n     */\r\n    constructor(\r\n        IERC20 _vether,\r\n        IERC20 _vader,\r\n        ILinearVesting _vesting,\r\n        bytes32 _root\r\n    ) {\r\n        require(\r\n            _vether != IERC20(_ZERO_ADDRESS) &&\r\n                _vader != IERC20(_ZERO_ADDRESS) &&\r\n                _vesting != ILinearVesting(_ZERO_ADDRESS),\r\n            \"Converter::constructor: Misconfiguration\"\r\n        );\r\n\r\n        vether = _vether;\r\n        vader = _vader;\r\n\r\n        _vader.approve(address(_vesting), type(uint256).max);\r\n\r\n        vesting = _vesting;\r\n        root = _root;\r\n    }\r\n\r\n    /* ========== MUTATIVE FUNCTIONS ========== */\r\n\r\n    /**\r\n     * @dev Allows a user to convert their Vether to Vader.\r\n     *\r\n     * Emits a {Conversion} event indicating the amount of Vether the user\r\n     * \"burned\" and the amount of Vader that they acquired.\r\n     *\r\n     * Here, \"burned\" refers to the action of transferring them to an irrecoverable\r\n     * address, the {BURN} address.\r\n     *\r\n     * Requirements:\r\n     *\r\n     * - the caller has approved the contract for the necessary amount via Vether\r\n     * - the amount specified is non-zero\r\n     * - the contract has been supplied with the necessary Vader amount to fulfill the trade\r\n     */\r\n    function convert(bytes32[] calldata proof, uint256 amount)\r\n        external\r\n        override\r\n        returns (uint256 vaderReceived)\r\n    {\r\n        require(\r\n            amount != 0,\r\n            \"Converter::convert: Non-Zero Conversion Amount Required\"\r\n        );\r\n\r\n        bytes32 leaf = keccak256(abi.encodePacked(msg.sender, amount));\r\n        require(\r\n            !claimed[leaf] && proof.verify(root, leaf),\r\n            \"Converter::convert: Incorrect Proof Provided\"\r\n        );\r\n        claimed[leaf] = true;\r\n\r\n        vaderReceived = amount * _VADER_VETHER_CONVERSION_RATE;\r\n\r\n        emit Conversion(msg.sender, amount, vaderReceived);\r\n\r\n        vether.safeTransferFrom(msg.sender, _BURN, amount);\r\n        uint256 half = vaderReceived / 2;\r\n        vader.safeTransfer(msg.sender, half);\r\n        vesting.vestFor(msg.sender, half);\r\n    }\r\n}"
}