{
    "Function": "enter",
    "File": "contracts/x-vader/XVader.sol",
    "Parent Contracts": [
        "node_modules/@openzeppelin/contracts/security/ReentrancyGuard.sol",
        "node_modules/@openzeppelin/contracts/token/ERC20/extensions/ERC20Votes.sol",
        "node_modules/@openzeppelin/contracts/interfaces/IERC5805.sol",
        "node_modules/@openzeppelin/contracts/governance/utils/IVotes.sol",
        "node_modules/@openzeppelin/contracts/interfaces/IERC6372.sol",
        "node_modules/@openzeppelin/contracts/token/ERC20/extensions/ERC20Permit.sol",
        "node_modules/@openzeppelin/contracts/utils/cryptography/EIP712.sol",
        "node_modules/@openzeppelin/contracts/interfaces/IERC5267.sol",
        "node_modules/@openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol",
        "node_modules/@openzeppelin/contracts/token/ERC20/ERC20.sol",
        "node_modules/@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol",
        "node_modules/@openzeppelin/contracts/token/ERC20/IERC20.sol",
        "node_modules/@openzeppelin/contracts/utils/Context.sol",
        "contracts/shared/ProtocolConstants.sol"
    ],
    "High-Level Calls": [
        "IERC20",
        "IERC20"
    ],
    "Internal Calls": [
        "totalSupply",
        "nonReentrant",
        "_mint"
    ],
    "Library Calls": [],
    "Low-Level Calls": [],
    "Code": "function enter(uint256 _amount) external nonReentrant {\n        // Gets the amount of vader locked in the contract\n        uint256 totalVader = vader.balanceOf(address(this));\n        // Gets the amount of xVader in existence\n        uint256 totalShares = totalSupply();\n\n        uint256 xVADERToMint = totalShares == 0 || totalVader == 0\n            // If no xVader exists, mint it 1:1 to the amount put in\n            ? _amount\n            // Calculate and mint the amount of xVader the vader is worth.\n            // The ratio will change overtime, as xVader is burned/minted and\n            // vader deposited + gained from fees / withdrawn.\n            : (_amount * totalShares) / totalVader;\n\n        _mint(msg.sender, xVADERToMint);\n\n        // Lock the vader in the contract\n        vader.transferFrom(msg.sender, address(this), _amount);\n    }"
}