```\nfunction deposit(uint256 _amount) public {\n    // Gets the amount of ABR locked in the contract\n    uint256 totalABR = ABR.balanceOf(address(this));\n    // Gets the amount of xABR in existence\n    uint256 totalShares = totalSupply();\n    // If no xABR exists, mint it 1:1 to the amount put in\n    if (totalShares == 0 || totalABR == 0) {\n        _mint(msg.sender, _amount);\n    }\n    // Calculate and mint the amount of xABR the ABR is worth. The ratio will change overtime, \n    // as xABR is burned/minted and ABR deposited + gained from fees / withdrawn.\n    else {\n        uint256 what = _amount * totalShares / totalABR;\n        _mint(msg.sender, what);\n    }\n    // Lock the ABR in the contract\n    ABR.transferFrom(msg.sender, address(this), _amount);\n}\n```\n