Summary
Code has Functions that are never used.
Vulnerability Details
File: contracts/libraries/Silo/LibGerminate.sol
LibGerminate.getUnclaimedGerminatingStalkAndRoots(uint32) (contracts/libraries/Silo/LibGerminate.sol#319-324) is never used and should be removed
319: function getUnclaimedGerminatingStalkAndRoots(
320: uint32 season
321: ) internal view returns (Storage.Sr memory unclaimed) {
322: AppStorage storage s = LibAppStorage.diamondStorage();
323: unclaimed = s.unclaimedGerminating[season];
324: }
GitHub : 319-324
File: contracts/beanstalk/silo/SiloFacet/SiloGettersFacet.sol
SiloGettersFacet._season() (contracts/beanstalk/silo/SiloFacet/SiloGettersFacet.sol#584-586) is never used and should be removed
584: function _season() internal view returns (uint32) {
585: return s.season.current;
586: }
GitHub : 584-586
File: contracts/libraries/Silo/LibTokenSilo.sol
LibTokenSilo.incrementTotalGerminatingBdv(address,uint256,LibGerminate.Germinate) (contracts/libraries/Silo/LibTokenSilo.sol#173-202) is never used and should be removed
173: function incrementTotalGerminatingBdv(
174: address token,
175: uint256 bdv,
176: LibGerminate.Germinate germ
177: ) internal {
178: AppStorage storage s = LibAppStorage.diamondStorage();
179:
180: if (germ == LibGerminate.Germinate.ODD) {
181:
182: s.oddGerminating.deposited[token].bdv = s.oddGerminating.deposited[token].bdv.add(
GitHub : 173-202
File: contracts/libraries/Silo/LibSilo.sol
LibSilo.burnStalk(address,uint256,LibGerminate.Germinate) (contracts/libraries/Silo/LibSilo.sol#230-250) is never used and should be removed
230: function burnStalk(address account, uint256 stalk, LibGerminate.Germinate germ) internal {
231: AppStorage storage s = LibAppStorage.diamondStorage();
232: if (stalk == 0) return;
233:
234:
235: if (germ == LibGerminate.Germinate.NOT_GERMINATING) {
236: uint256 roots = burnActiveStalk(account, stalk);
237:
238:
239:
240:
241:
242:
243: if (s.season.raining) {
244: s.r.roots = s.r.roots.sub(roots);
245: s.a[account].sop.roots = s.a[account].roots;
246: }
247: } else {
248: burnGerminatingStalk(account, uint128(stalk), germ);
249: }
250: }
GitHub : 230-250
File: contracts/libraries/Silo/LibTokenSilo.sol
LibTokenSilo.calculateStalkFromStemAndBdv(address,int96,uint256) (contracts/libraries/Silo/LibTokenSilo.sol#553-562) is never used and should be removed
553: function calculateStalkFromStemAndBdv(
554: address token,
555: int96 grownStalkIndexOfDeposit,
556: uint256 bdv
557: ) internal view returns (int96 grownStalk) {
558:
559: int96 _stemTipForToken = stemTipForToken(address(token));
560:
561: return _stemTipForToken.sub(grownStalkIndexOfDeposit).mul(toInt96(bdv));
562: }
GitHub : 553-562
File: contracts/libraries/Silo/LibLegacyTokenSilo.sol
LibLegacyTokenSilo.incrementMigratedBdv(address,uint256) (contracts/libraries/Silo/LibLegacyTokenSilo.sol#548-551) is never used and should be removed
548: function incrementMigratedBdv(address token, uint256 bdv) private {
549: AppStorage storage s = LibAppStorage.diamondStorage();
550: s.migratedBdvs[token] = s.migratedBdvs[token].add(bdv);
551: }
GitHub : 548-551
File: contracts/libraries/LibUnripe.sol
LibUnripe._getTotalPenalizedUnderlying(address) (contracts/libraries/LibUnripe.sol#157-163) is never used and should be removed
157: function _getTotalPenalizedUnderlying(
158: address unripeToken
159: ) internal view returns (uint256 redeem) {
160: require(isUnripe(unripeToken), "not vesting");
161: uint256 supply = IERC20(unripeToken).totalSupply();
162: redeem = _getUnderlying(unripeToken, getRecapPaidPercentAmount(supply), supply);
163: }
GitHub : 157-163
Impact
Unused code cause unnecessary compilation, gas overhead and codebase maintenance issues.
Tools Used
Manual Review
Recommendations
Remove unused functions.