Farseen0/scar-pairs huggingface dataset:
MEDIUM severity: Vulnerable function: ```\nfunction _createAuction() private returns (bool) {\n // Get the next token available for biddin. ```\nfunction _createAuction() private returns (bool) {\n // Get the next token available for bidding\n try token.mint() returns (uint256 tokenId) {\n  // Store the token id\n  auction.tokenId = tokenId;\n\n  // Cache the current timestamp\n  uint256 startTime = block.timestamp;\n\n  // Used to stor

Vulnerable code:
```\nfunction _createAuction() private returns (bool) {\n // Get the next token available for bidding\n try token.mint() returns (uint256 tokenId) {\n  // Store the token id\n  auction.tokenId = tokenId;\n\n  // Cache the current timestamp\n  uint256 startTime = block.timestamp;\n\n  // Used to store the auction end time\n  uint256 endTime;\n\n  // Cannot realistically overflow\n  unchecked {\n   // Compute the auction end time\n   endTime = startTime + settings.duration;\n  }\n\n  // Store the auction start and end time\n  auction.startTime = uint40(startTime);\n  auction.endTime = uint40(endTime);\n\n  // Reset data from the previous auction\n  auction.highestBid = 0;\n  auction.highestBidder = address(0);\n  auction.settled = false;\n\n  // Reset referral from the previous auction\n  currentBidReferral = address(0);\n\n  emit AuctionCreated(tokenId, startTime, endTime);\n  return true;\n } catch {\n  // Pause the contract if token minting failed\n  _pause();\n  return false;\n }\n}\n```\n
MEDIUM severity: Vulnerable function: ```\nfunction test_fulfillRandomWords_revert() public {\n        _startGameAndDrawOneRound();\n\n   . ```\nfunction test_fulfillRandomWords_revert() public {\n        _startGameAndDrawOneRound();\n\n        _drawXRounds(48);\n        \n        uint256 counter = 0;\n        uint256[] memory wa = new uint256[](30);\n        uint256 totalCost = 0;\n\n        for (uint256 j=2; j <= 6; j++) \n        {\n

Vulnerable code:
```\nfunction test_fulfillRandomWords_revert() public {\n        _startGameAndDrawOneRound();\n\n        _drawXRounds(48);\n        \n        uint256 counter = 0;\n        uint256[] memory wa = new uint256[](30);\n        uint256 totalCost = 0;\n\n        for (uint256 j=2; j <= 6; j++) \n        {\n            (uint256[] memory woundedAgentIds, ) = infiltration.getRoundInfo({roundId: j});\n\n            uint256[] memory costs = new uint256[](woundedAgentIds.length);\n            for (uint256 i; i < woundedAgentIds.length; i++) {\n                costs[i] = HEAL_BASE_COST;\n                wa[counter] = woundedAgentIds[i];\n                counter++;\n                if(counter > 29) break;\n            }\n\n            if(counter > 29) break;\n        }\n        \n        \n        totalCost = HEAL_BASE_COST * wa.length;\n        looks.mint(user1, totalCost);\n\n        vm.startPrank(user1);\n        _grantLooksApprovals();\n        looks.approve(TRANSFER_MANAGER, totalCost);\n\n\n        infiltration.heal(wa);\n        vm.stopPrank();\n\n        _drawXRounds(1);\n    }\n```\n
MEDIUM severity: Vulnerable function: ```\nuser.rewardDebt = int128(user.virtualAmount \* pool.accTribePerShare) / toS. ```\nuser.rewardDebt = int128(user.virtualAmount \* pool.accTribePerShare) / toSigned128(ACC\_TRIBE\_PRECISION);\n```\n

Vulnerable code:
```\nuser.rewardDebt = int128(user.virtualAmount \* pool.accTribePerShare) / toSigned128(ACC\_TRIBE\_PRECISION);\n```\n
MEDIUM severity: Vulnerable function: ```\nFile: Constants.sol\n    // Basis for percentages\n    int256 internal cons. ```\nFile: Constants.sol\n    // Basis for percentages\n    int256 internal constant PERCENTAGE_DECIMALS = 100;\n```\n

Vulnerable code:
```\nFile: Constants.sol\n    // Basis for percentages\n    int256 internal constant PERCENTAGE_DECIMALS = 100;\n```\n
HIGH severity: Vulnerable function: ```\n    for (uint i = 0; i < rewardTokens.length; i++) {\n        IERC20Upgrade. ```\n    for (uint i = 0; i < rewardTokens.length; i++) {\n        IERC20Upgradeable(rewardTokens[i]).safeTransfer(\n            msg.sender,\n            rewards[i]\n        );\n    }\n```\n

Vulnerable code:
```\n    for (uint i = 0; i < rewardTokens.length; i++) {\n        IERC20Upgradeable(rewardTokens[i]).safeTransfer(\n            msg.sender,\n            rewards[i]\n        );\n    }\n```\n
MEDIUM severity: Vulnerable function: ```\n    function liveMarketsBy(address owner_) external view returns (uint256[] memory) {\n        . ```\n    function liveMarketsBy(address owner_) external view returns (uint256[] memory) {\n        uint256 count;\n        IBondAuctioneer auctioneer;\n        for (uint256 i; i < marketCounter; ++i) {\n            auctioneer = marketsToAuctioneers[i];\n            if (auctioneer.isLive(i) && aucti

Vulnerable code:
```\n    function liveMarketsBy(address owner_) external view returns (uint256[] memory) {\n        uint256 count;\n        IBondAuctioneer auctioneer;\n        for (uint256 i; i < marketCounter; ++i) {\n            auctioneer = marketsToAuctioneers[i];\n            if (auctioneer.isLive(i) && auctioneer.ownerOf(i) == owner_) {\n                ++count;\n            }\n        }\n\n\n        uint256[] memory ids = new uint256[](count);\n        count = 0;\n        for (uint256 i; i < marketCounter; ++i) {\n            auctioneer = marketsToAuctioneers[i];\n            if (auctioneer.isLive(i) && auctioneer.ownerOf(i) == owner_) {\n                ids[count] = i;\n                ++count;\n            }\n        }\n\n\n        return ids;\n    }\n```\n
MEDIUM severity: Vulnerable function: ```\nfunction refund() override external onlyMinipoolOwnerOrWithdrawalAddress(msg.sender) onlyInitia. ```\nfunction refund() override external onlyMinipoolOwnerOrWithdrawalAddress(msg.sender) onlyInitialised {\n    // Check refund balance\n    require(nodeRefundBalance > 0, "No amount of the node deposit is available for refund");\n    // If this minipool was distributed by a user, force finalisatio

Vulnerable code:
```\nfunction refund() override external onlyMinipoolOwnerOrWithdrawalAddress(msg.sender) onlyInitialised {\n    // Check refund balance\n    require(nodeRefundBalance > 0, "No amount of the node deposit is available for refund");\n    // If this minipool was distributed by a user, force finalisation on the node operator\n    if (!finalised && userDistributed) {\n        \_finalise();\n    }\n    // Refund node\n    \_refund();\n}\n```\n
MEDIUM severity: Vulnerable function: ```\n            reserveRatio = ScalingUtils.scaleByBases(\n                allR. ```\n            reserveRatio = ScalingUtils.scaleByBases(\n                allReserves * valueBase / liabilities,\n                valueBase,\n                tokenManager.RESERVE_RATIO_BASE()\n            );\n```\n

Vulnerable code:
```\n            reserveRatio = ScalingUtils.scaleByBases(\n                allReserves * valueBase / liabilities,\n                valueBase,\n                tokenManager.RESERVE_RATIO_BASE()\n            );\n```\n
MEDIUM severity: Vulnerable function: ```\nFile: BaseLSTAdapter.sol\n    function setRebalancer(address _rebalancer) external onlyOwner {\. ```\nFile: BaseLSTAdapter.sol\n    function setRebalancer(address _rebalancer) external onlyOwner {\n        rebalancer = _rebalancer;\n    }\n```\n

Vulnerable code:
```\nFile: BaseLSTAdapter.sol\n    function setRebalancer(address _rebalancer) external onlyOwner {\n        rebalancer = _rebalancer;\n    }\n```\n
MEDIUM severity: Vulnerable function: ```\n    function safeApprove(\n        IERC20 token,\n        address spender,\n        uint256 val. ```\n    function safeApprove(\n        IERC20 token,\n        address spender,\n        uint256 value\n    ) internal {\n        // safeApprove should only be called when setting an initial allowance,\n        // or when resetting it to zero. To increase and decrease it, use\n        // 'safeIncrea

Vulnerable code:
```\n    function safeApprove(\n        IERC20 token,\n        address spender,\n        uint256 value\n    ) internal {\n        // safeApprove should only be called when setting an initial allowance,\n        // or when resetting it to zero. To increase and decrease it, use\n        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\n        require(\n            (value == 0) || (token.allowance(address(this), spender) == 0),\n            "SafeERC20: approve from non-zero to non-zero allowance"\n        );\n        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\n    }\n```\n
MEDIUM severity: Vulnerable function: ```\n        for (uint i; i < swapParams.length; ) {\n        // find excess amo. ```\n        for (uint i; i < swapParams.length; ) {\n        // find excess amount after repay\n        uint swapAmt = swapParams[i].operation == SwapOperation.EXACT_IN\n          ? IERC20(swapParams[i].tokenIn).balanceOf(address(this)) - openTokenInfos[i].borrowAmt\n             : openTokenInfos[i

Vulnerable code:
```\n        for (uint i; i < swapParams.length; ) {\n        // find excess amount after repay\n        uint swapAmt = swapParams[i].operation == SwapOperation.EXACT_IN\n          ? IERC20(swapParams[i].tokenIn).balanceOf(address(this)) - openTokenInfos[i].borrowAmt\n             : openTokenInfos[i].borrowAmt - IERC20(swapParams[i].tokenOut).balanceOf(address(this));\n                 swapAmt = (swapAmt * swapParams[i].percentSwapE18) / ONE_E18\n                 if (swapAmt == 0) {\n              revert SwapZeroAmount();\n             }\n```\n
HIGH severity: Vulnerable function: ```\n    function mint(\n        uint8 p,\n        address u,\n        uint256 m,\n        uint256 a. ```\n    function mint(\n        uint8 p,\n        address u,\n        uint256 m,\n        uint256 a\n    ) external unpaused(u, m, p) returns (bool) {\n        // Fetch the desired principal token\n        address principal = IMarketPlace(marketPlace).token(u, m, p);\n\n        // Transfer the user

Vulnerable code:
```\n    function mint(\n        uint8 p,\n        address u,\n        uint256 m,\n        uint256 a\n    ) external unpaused(u, m, p) returns (bool) {\n        // Fetch the desired principal token\n        address principal = IMarketPlace(marketPlace).token(u, m, p);\n\n        // Transfer the users principal tokens to the lender contract\n        Safe.transferFrom(IERC20(principal), msg.sender, address(this), a);\n\n        // Mint the tokens received from the user\n        IERC5095(principalToken(u, m)).authMint(msg.sender, a);\n\n        emit Mint(p, u, m, a);\n\n        return true;\n    }\n```\n
HIGH severity: Vulnerable function: ```\nFile: LiquidationModule.sol\n    /// @notice Function to liquidate a position.\n    /// @dev On. ```\nFile: LiquidationModule.sol\n    /// @notice Function to liquidate a position.\n    /// @dev One could directly call this method instead of `liquidate(uint256, bytes[])` if they don't want to update the Pyth price.\n    /// @param tokenId The token ID of the leverage position.\n    function liq

Vulnerable code:
```\nFile: LiquidationModule.sol\n    /// @notice Function to liquidate a position.\n    /// @dev One could directly call this method instead of `liquidate(uint256, bytes[])` if they don't want to update the Pyth price.\n    /// @param tokenId The token ID of the leverage position.\n    function liquidate(uint256 tokenId) public nonReentrant whenNotPaused liquidationInvariantChecks(vault, tokenId) {\n        FlatcoinStructs.Position memory position = vault.getPosition(tokenId);\n\n        (uint256 currentPrice, ) = IOracleModule(vault.moduleAddress(FlatcoinModuleKeys._ORACLE_MODULE_KEY)).getPrice();\n\n        // Settle funding fees accrued till now.\n        vault.settleFundingFees();\n\n        // Check if the position can indeed be liquidated.\n        if (!canLiquidate(tokenId)) revert FlatcoinErrors.CannotLiquidate(tokenId);\n\n        FlatcoinStructs.PositionSummary memory positionSummary = PerpMath._getPositionSummary(\n            position,\n            vault.cumulativeFundingRate(),\n            currentPrice\n        );\n..SNIP..\n        vault.updateGlobalPositionData({\n            price: position.lastPrice,\n            marginDelta: -(int256(position.marginDeposited) + positionSummary.accruedFunding),\n            additionalSizeDelta: -int256(position.additionalSize) // Since position is being closed, additionalSizeDelta should be negative.\n        });\n```\n
MEDIUM severity: Vulnerable function: ```\nfunction setState(uint delegationId, State newState) internal {\n    TimeHelpers timeHelpers = . ```\nfunction setState(uint delegationId, State newState) internal {\n    TimeHelpers timeHelpers = TimeHelpers(contractManager.getContract("TimeHelpers"));\n    DelegationController delegationController = DelegationController(contractManager.getContract("DelegationController"));\n\n    require(newS

Vulnerable code:
```\nfunction setState(uint delegationId, State newState) internal {\n    TimeHelpers timeHelpers = TimeHelpers(contractManager.getContract("TimeHelpers"));\n    DelegationController delegationController = DelegationController(contractManager.getContract("DelegationController"));\n\n    require(newState != State.PROPOSED, "Can't set state to proposed");\n\n    if (newState == State.ACCEPTED) {\n        State currentState = getState(delegationId);\n        require(currentState == State.PROPOSED, "Can't set state to accepted");\n\n        \_state[delegationId] = State.ACCEPTED;\n        \_timelimit[delegationId] = timeHelpers.getNextMonthStart();\n    } else if (newState == State.DELEGATED) {\n        revert("Can't set state to delegated");\n    } else if (newState == State.ENDING\_DELEGATED) {\n        require(getState(delegationId) == State.DELEGATED, "Can't set state to ending delegated");\n        DelegationController.Delegation memory delegation = delegationController.getDelegation(delegationId);\n\n        \_state[delegationId] = State.ENDING\_DELEGATED;\n        \_timelimit[delegationId] = timeHelpers.calculateDelegationEndTime(delegation.created, delegation.delegationPeriod, 3);\n        \_endingDelegations[delegation.holder].push(delegationId);\n    } else {\n        revert("Unknown state");\n    }\n}\n```\n
MEDIUM severity: Vulnerable function: ```\nFile: LMPVault.sol\n    function _collectFees(uint256 idle, uint256 debt, uint256 totalSupply) . ```\nFile: LMPVault.sol\n    function _collectFees(uint256 idle, uint256 debt, uint256 totalSupply) internal {\n        address sink = feeSink;\n        uint256 fees = 0;\n        uint256 shares = 0;\n        uint256 profit = 0;\n\n        // If there's no supply then there should be no assets and s

Vulnerable code:
```\nFile: LMPVault.sol\n    function _collectFees(uint256 idle, uint256 debt, uint256 totalSupply) internal {\n        address sink = feeSink;\n        uint256 fees = 0;\n        uint256 shares = 0;\n        uint256 profit = 0;\n\n        // If there's no supply then there should be no assets and so nothing\n        // to actually take fees on\n        if (totalSupply == 0) {\n            return;\n        }\n\n        uint256 currentNavPerShare = ((idle + debt) * MAX_FEE_BPS) / totalSupply;\n        uint256 effectiveNavPerShareHighMark = navPerShareHighMark;\n\n        if (currentNavPerShare > effectiveNavPerShareHighMark) {\n            // Even if we aren't going to take the fee (haven't set a sink)\n            // We still want to calculate so we can emit for off-chain analysis\n            profit = (currentNavPerShare - effectiveNavPerShareHighMark) * totalSupply;\n```\n
MEDIUM severity: Vulnerable function: ```\naddressToWithdrawalNonce[\_partition][supplier] = withdrawalRootNonce;\n```. ```\naddressToWithdrawalNonce[\_partition][supplier] = withdrawalRootNonce;\n```\n

Vulnerable code:
```\naddressToWithdrawalNonce[\_partition][supplier] = withdrawalRootNonce;\n```\n
MEDIUM severity: Vulnerable function: ```\nFile: libraries/V2Calculations.sol\n\n 93:        // Cast to int265 to avoi. ```\nFile: libraries/V2Calculations.sol\n\n 93:        // Cast to int265 to avoid underflow errors (negative means loan duration has passed)\n 94:        int256 durationLeftOnLoan = int256(\n 95:            uint256(_bid.loanDetails.loanDuration)\n 96:        ) -\n 97:            (int256(_timestamp) 

Vulnerable code:
```\nFile: libraries/V2Calculations.sol\n\n 93:        // Cast to int265 to avoid underflow errors (negative means loan duration has passed)\n 94:        int256 durationLeftOnLoan = int256(\n 95:            uint256(_bid.loanDetails.loanDuration)\n 96:        ) -\n 97:            (int256(_timestamp) -\n 98:                int256(uint256(_bid.loanDetails.acceptedTimestamp)));\n 99:        bool isLastPaymentCycle = durationLeftOnLoan <\n           int256(uint256(_bid.terms.paymentCycle)) || // Check if current payment cycle is within or beyond the last one\n           owedPrincipal_ + interest_ <= _bid.terms.paymentCycleAmount; // Check if what is left to pay is less than the payment cycle amount\n```\n
HIGH severity: Vulnerable function: ```\nif (\_purchased[delegation.holder] > 0) {\n    \_isPurchased[delegationId] . ```\nif (\_purchased[delegation.holder] > 0) {\n    \_isPurchased[delegationId] = true;\n    if (\_purchased[delegation.holder] > delegation.amount) {\n        \_purchased[delegation.holder] -= delegation.amount;\n    } else {\n        \_purchased[delegation.holder] = 0;\n    }\n} else {\n    \_isPu

Vulnerable code:
```\nif (\_purchased[delegation.holder] > 0) {\n    \_isPurchased[delegationId] = true;\n    if (\_purchased[delegation.holder] > delegation.amount) {\n        \_purchased[delegation.holder] -= delegation.amount;\n    } else {\n        \_purchased[delegation.holder] = 0;\n    }\n} else {\n    \_isPurchased[delegationId] = false;\n}\n```\n
MEDIUM severity: Vulnerable function: ```\n         mapping(address => mapping(address => listInfo)) private allowedPa. ```\n         mapping(address => mapping(address => listInfo)) private allowedPairsMap;\n                  pair[] private allowedPairsList;\n```\n

Vulnerable code:
```\n         mapping(address => mapping(address => listInfo)) private allowedPairsMap;\n                  pair[] private allowedPairsList;\n```\n
MEDIUM severity: Vulnerable function: ```\nfunction changeTreasury(uint256 _marketId, address _treasury)\n    public\n    onlyTimeLocker\n. ```\nfunction changeTreasury(uint256 _marketId, address _treasury)\n    public\n    onlyTimeLocker\n{\n    if (_treasury == address(0)) revert AddressZero();\n\n    address[2] memory vaults = marketIdToVaults[_marketId];\n\n    if (vaults[0] == address(0) || vaults[1] == address(0)) {\n        rever

Vulnerable code:
```\nfunction changeTreasury(uint256 _marketId, address _treasury)\n    public\n    onlyTimeLocker\n{\n    if (_treasury == address(0)) revert AddressZero();\n\n    address[2] memory vaults = marketIdToVaults[_marketId];\n\n    if (vaults[0] == address(0) || vaults[1] == address(0)) {\n        revert MarketDoesNotExist(_marketId);\n    }\n\n    IVaultV2(vaults[0]).whiteListAddress(_treasury);\n    IVaultV2(vaults[1]).whiteListAddress(_treasury);\n    IVaultV2(vaults[0]).setTreasury(treasury);\n    IVaultV2(vaults[1]).setTreasury(treasury);\n\n    emit AddressWhitelisted(_treasury, _marketId);\n}\n```\n
MEDIUM severity: Vulnerable function: ```\nif (price_ < MIN_PRICE || price_ > MAX_PRICE) revert BucketPriceOutOfBounds. ```\nif (price_ < MIN_PRICE || price_ > MAX_PRICE) revert BucketPriceOutOfBounds();\n```\n

Vulnerable code:
```\nif (price_ < MIN_PRICE || price_ > MAX_PRICE) revert BucketPriceOutOfBounds();\n```\n
MEDIUM severity: Vulnerable function: ```\n    function findMarketFor(\n        address payout_,\n        address quote_,\n        uint256. ```\n    function findMarketFor(\n        address payout_,\n        address quote_,\n        uint256 amountIn_,\n        uint256 minAmountOut_,\n        uint256 maxExpiry_\n    ) external view returns (uint256) {\n// rest of code\n            if (expiry <= maxExpiry_) {\n                payouts[i] =

Vulnerable code:
```\n    function findMarketFor(\n        address payout_,\n        address quote_,\n        uint256 amountIn_,\n        uint256 minAmountOut_,\n        uint256 maxExpiry_\n    ) external view returns (uint256) {\n// rest of code\n            if (expiry <= maxExpiry_) {\n                payouts[i] = minAmountOut_ <= maxPayout\n                    ? payoutFor(amountIn_, ids[i], address(0))\n                    : 0;\n\n                if (payouts[i] > highestOut) {//****@audit not check payouts[i] >= minAmountOut_******//\n                    highestOut = payouts[i];\n                    id = ids[i];\n                }\n            }\n```\n
MEDIUM severity: Vulnerable function: ```\nfunction _initialize() internal virtual override {\n    // check if the owner is the deployer o. ```\nfunction _initialize() internal virtual override {\n    // check if the owner is the deployer of this contract\n    if (msg.sender != deployer) {\n        revert UnexpectedDeployer(deployer, msg.sender);\n    }\n\n    __ReentrancyGuard_init();\n    // owner of the transceiver is set to the owne

Vulnerable code:
```\nfunction _initialize() internal virtual override {\n    // check if the owner is the deployer of this contract\n    if (msg.sender != deployer) {\n        revert UnexpectedDeployer(deployer, msg.sender);\n    }\n\n    __ReentrancyGuard_init();\n    // owner of the transceiver is set to the owner of the nttManager\n    __PausedOwnable_init(msg.sender, getNttManagerOwner());\n}\n```\n
MEDIUM severity: Vulnerable function: ```\n    loans.push(\n        Loan(req, req.amount + interest, collat, expiratio. ```\n    loans.push(\n        Loan(req, req.amount + interest, collat, expiration, true, msg.sender)\n    );\n```\n

Vulnerable code:
```\n    loans.push(\n        Loan(req, req.amount + interest, collat, expiration, true, msg.sender)\n    );\n```\n
MEDIUM severity: Vulnerable function: ```\nFile: AuraStakingMixin.sol\n    function claimRewardTokens() external returns (uint256[] memory. ```\nFile: AuraStakingMixin.sol\n    function claimRewardTokens() external returns (uint256[] memory claimedBalances) {\n        uint16 feePercentage = BalancerVaultStorage.getStrategyVaultSettings().feePercentage;\n        IERC20[] memory rewardTokens = _rewardTokens();\n\n        uint256 numReward

Vulnerable code:
```\nFile: AuraStakingMixin.sol\n    function claimRewardTokens() external returns (uint256[] memory claimedBalances) {\n        uint16 feePercentage = BalancerVaultStorage.getStrategyVaultSettings().feePercentage;\n        IERC20[] memory rewardTokens = _rewardTokens();\n\n        uint256 numRewardTokens = rewardTokens.length;\n\n        claimedBalances = new uint256[](numRewardTokens);\n        for (uint256 i; i < numRewardTokens; i++) {\n            claimedBalances[i] = rewardTokens[i].balanceOf(address(this));\n        }\n\n        AURA_REWARD_POOL.getReward(address(this), true);\n        for (uint256 i; i < numRewardTokens; i++) {\n            claimedBalances[i] = rewardTokens[i].balanceOf(address(this)) - claimedBalances[i];\n\n            if (claimedBalances[i] > 0 && feePercentage != 0 && FEE_RECEIVER != address(0)) {\n                uint256 feeAmount = claimedBalances[i] * feePercentage / BalancerConstants.VAULT_PERCENT_BASIS;\n                rewardTokens[i].checkTransfer(FEE_RECEIVER, feeAmount);\n                claimedBalances[i] -= feeAmount;\n            }\n        }\n\n        emit BalancerEvents.ClaimedRewardTokens(rewardTokens, claimedBalances);\n    }\n```\n
MEDIUM severity: Vulnerable function: ```\nAdditional tokens may be added to the Deposit Whitelist via Beanstalk governance. In order for . ```\nAdditional tokens may be added to the Deposit Whitelist via Beanstalk governance. In order for a token to be added to the Deposit Whitelist, Beanstalk requires:\n1. The token address;\n2. A function to calculate the Bean Denominated Value (BDV) of the token (see Section 14.2 of the whitepaper f

Vulnerable code:
```\nAdditional tokens may be added to the Deposit Whitelist via Beanstalk governance. In order for a token to be added to the Deposit Whitelist, Beanstalk requires:\n1. The token address;\n2. A function to calculate the Bean Denominated Value (BDV) of the token (see Section 14.2 of the whitepaper for complete formulas); and\n3. The number of Stalk and Seeds per BDV received upon Deposit.\n```\n