{
    "Function": "slitherConstructorConstantVariables",
    "File": "contracts/libraries/NAV.sol",
    "Parent Contracts": [],
    "High-Level Calls": [],
    "Internal Calls": [],
    "Library Calls": [],
    "Low-Level Calls": [],
    "Code": "library NAV {\n    /// @notice Initial shares quantity\n    uint internal constant INITIAL_QUANTITY = 10000;\n\n    struct Data {\n        uint lastBalance;\n        uint totalSupply;\n        mapping(address => uint) balanceOf;\n    }\n\n    /// @notice Transfer `_amount` of shares between given addresses\n    /// @param _from Account to send shares from\n    /// @param _to Account to send shares to\n    /// @param _amount Amount of shares to send\n    function transfer(\n        Data storage self,\n        address _from,\n        address _to,\n        uint _amount\n    ) internal {\n        self.balanceOf[_from] -= _amount;\n        self.balanceOf[_to] += _amount;\n    }\n\n    /// @notice Mints shares to the `_recipient` account\n    /// @param self Data structure reference\n    /// @param _balance New shares maximum limit\n    /// @param _recipient Recipient that will receive minted shares\n    function mint(\n        Data storage self,\n        uint _balance,\n        address _recipient\n    ) internal returns (uint shares) {\n        uint amount = _balance - self.lastBalance;\n        uint _totalSupply = self.totalSupply;\n        if (_totalSupply != 0) {\n            shares = (amount * _totalSupply) / self.lastBalance;\n        } else {\n            shares = amount - INITIAL_QUANTITY;\n            _mint(self, address(0), INITIAL_QUANTITY);\n        }\n        require(shares > 0, \"NAV: INSUFFICIENT_AMOUNT\");\n        _mint(self, _recipient, shares);\n    }\n\n    /// @notice Burns shares from the `_recipient` account\n    /// @param self Data structure reference\n    /// @param _balance Shares balance\n    function burn(Data storage self, uint _balance) internal returns (uint amount) {\n        uint value = self.balanceOf[address(this)];\n        amount = (value * _balance) / self.totalSupply;\n        require(amount > 0, \"NAV: INSUFFICIENT_SHARES_BURNED\");\n        _burn(self, address(this), value);\n    }\n\n    /// @notice Synchronizes token balances\n    /// @param self Data structure reference\n    /// @param _newBalance Total asset amount\n    function sync(Data storage self, uint _newBalance) internal {\n        if (self.lastBalance != _newBalance) {\n            self.lastBalance = _newBalance;\n        }\n    }\n\n    /// @notice Returns amount of tokens corresponding to the given `_shares` amount\n    /// @param self Data structure reference\n    /// @param _shares Amount of shares\n    /// @param _balance Shares balance\n    /// @return Amount of tokens corresponding to given shares\n    function assetBalanceForShares(\n        Data storage self,\n        uint _shares,\n        uint _balance\n    ) internal view returns (uint) {\n        uint _totalSupply = self.totalSupply;\n        if (_totalSupply != 0) {\n            return (_shares * _balance) / _totalSupply;\n        }\n\n        return 0;\n    }\n\n    /// @notice Returns amount of shares that will be minted for the given tokens amount\n    /// @param self Data structure reference\n    /// @param _amount Tokens amount\n    /// @return Amount of mintable shares\n    function mintableShares(Data storage self, uint _amount) internal view returns (uint) {\n        uint _totalSupply = self.totalSupply;\n        if (_totalSupply != 0) {\n            return (_amount * _totalSupply) / self.lastBalance;\n        }\n\n        return _amount - INITIAL_QUANTITY;\n    }\n\n    /// @notice Mints shares for the given account\n    /// @param self Data structure reference\n    /// @param _account Account to mint shares for\n    /// @param _amount Amount shares to mint\n    function _mint(\n        Data storage self,\n        address _account,\n        uint _amount\n    ) private {\n        self.balanceOf[_account] += _amount;\n        self.totalSupply += _amount;\n    }\n\n    /// @notice Burns shares of the given account\n    /// @param self Data structure reference\n    /// @param _account Account to burn shares of\n    /// @param _amount Amount shares to burn\n    function _burn(\n        Data storage self,\n        address _account,\n        uint _amount\n    ) private {\n        self.balanceOf[_account] -= _amount;\n        self.totalSupply -= _amount;\n    }\n}"
}