{
    "Function": "slitherConstructorConstantVariables",
    "File": "contracts/tokens/converter/Converter.sol",
    "Parent Contracts": [
        "node_modules/@openzeppelin/contracts/access/Ownable.sol",
        "node_modules/@openzeppelin/contracts/utils/Context.sol",
        "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, Ownable {\r\n    /* ========== LIBRARIES ========== */\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 vesting;\r\n\r\n    // The merkle proof root for validating claims\r\n    bytes32 public immutable root;\r\n\r\n    // Unique deployment salt\r\n    uint256 public immutable salt;\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        bytes32 _root,\r\n        uint256 _salt\r\n    ) {\r\n        require(\r\n            _vether != IERC20(_ZERO_ADDRESS) && _vader != IERC20(_ZERO_ADDRESS),\r\n            \"Converter::constructor: Misconfiguration\"\r\n        );\r\n\r\n        vether = _vether;\r\n        vader = _vader;\r\n\r\n        root = _root;\r\n        salt = _salt;\r\n    }\r\n\r\n    /* ========== RESTRICTED FUNCTIONS ========== */\r\n\r\n    /*\r\n     * @dev Sets address of vesting contract.\r\n     *\r\n     * The LinearVesting and Converter contracts are dependent upon\r\n     * each other, hence this setter is introduced.\r\n     *\r\n     * Also approves Vesting to spend Vader tokens on its behalf.\r\n     *\r\n     **/\r\n    function setVesting(ILinearVesting _vesting) external onlyOwner {\r\n        require(\r\n            vesting == ILinearVesting(_ZERO_ADDRESS),\r\n            \"Converter::setVesting: Vesting is already set\"\r\n        );\r\n        require(\r\n            _vesting != ILinearVesting(_ZERO_ADDRESS),\r\n            \"Converter::setVesting: Cannot Set Zero Vesting Address\"\r\n        );\r\n        vader.approve(address(_vesting), type(uint256).max);\r\n        vesting = _vesting;\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, uint256 minVader)\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        ILinearVesting _vesting = vesting;\r\n\r\n        require(\r\n            _vesting != ILinearVesting(_ZERO_ADDRESS),\r\n            \"Converter::convert: Vesting is not set\"\r\n        );\r\n\r\n        bytes32 leaf = keccak256(\r\n            abi.encodePacked(msg.sender, amount, salt, getChainId())\r\n        );\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        uint256 allowance = vether.allowance(msg.sender, address(this));\r\n\r\n        amount = amount > allowance ? allowance : amount;\r\n\r\n        // NOTE: FoT is ignored as units are meant to be burned anyway\r\n        vether.transferFrom(msg.sender, _BURN, amount);\r\n\r\n        vaderReceived = amount * _VADER_VETHER_CONVERSION_RATE;\r\n        require(vaderReceived >= minVader, \"Converter::convert: Vader < min\");\r\n\r\n        emit Conversion(msg.sender, amount, vaderReceived);\r\n\r\n        uint256 half = vaderReceived / 2;\r\n        vader.transfer(msg.sender, half);\r\n        _vesting.vestFor(msg.sender, vaderReceived - half);\r\n    }\r\n\r\n    /* ========== INTERNAL FUNCTIONS ========== */\r\n    /*\r\n     * @dev Returns the {chainId} of current network.\r\n     **/\r\n    function getChainId() internal view returns (uint256 chainId) {\r\n        assembly {\r\n            chainId := chainid()\r\n        }\r\n    }\r\n}"
}