query
large_stringlengths
38
1.29k
positive
large_stringlengths
18
171k
hard_negative
large_stringlengths
0
171k
negative_type
large_stringclasses
10 values
source
large_stringclasses
10 values
severity
large_stringclasses
3 values
vuln_type
large_stringclasses
294 values
quality_tier
int64
1
4
__index_level_0__
int64
0
12k
LOW severity: Fees are set to 0 at the first instance. **Severity**: Low **Status**: Resolved **Description** When the `TokenBridgeBase.sol` smart contract is deployed, the `brc20TransferFee`, `runesTransferFee` and `btcTransferFee` are not being set, therefore they are 0. If the corresponding functions to modify ...
constructor( address _endpoint, address _btcBridge, address _superAdmin, address _btcDataFeed, address _nativeDataFeed, uint8 _nativeDecimals ) BridgeRoles(_superAdmin, _btcBridge) NonblockingLzApp(_endpoint) { btcDataFeed = AggregatorV3Interface(_btcDataFeed); ...
function _fractionOfShares( uint256 _assetAmount, uint256 _shares, uint256 _totalShares, bool _isRoundingUp ) internal pure returns ( uint256 amount ) { amount = _isRoundingUp ? _assetAmount.mulDivRoundingUp(_shares, _totalShares): _assetAmount.mulDiv(_shares, _totalShares); }
same_firm_diff_protocol
Solodit
LOW
2
0
HIGH severity: Use explicit sizes instead of `uint`. **Description:** While `uint` defaults to `uint256`, it is considered good practice to use the explicit types including the size and to avoid using `uint`: **Strata:** Fixed in commit [61f5910](https://github.com/Strata-Money/contracts/commit/61f591088754e2666355307...
predeposit/yUSDeDepositor.sol 65: uint beforeAmount = asset.balanceOf(address(this)); 73: uint pUSDeShares = pUSDeDepositor.deposit(asset, amount, address(this)); predeposit/MetaVault.sol 53: uint baseAssets = IERC4626(token).previewRedeem(tokenAssets); 54: uint shares = previewDeposit(base...
/** * @notice Preview the *gross* assets required to mint `shares` * @dev We gross-up the net assets (from base ERC4626 math) by adding the deposit fee on top. */ function previewMint(uint256 shares) public view virtual override returns (uint256) { require(shares > 0, "Cannot mint 0 shares"); // Net assets ...
same_firm_diff_protocol
Solodit
HIGH
2
1
HIGH severity: Fees can become stuck in `UniswapV4Wrapper`. **Description:** When a modification is made to Uniswap V4 position liquidity, such as in the case of a partial `UniswapV4Wrapper` unwrap which decreases liquidity, any outstanding fees are also transferred and required to be completely settled. For multiple h...
function test_finalLosesFeesPoC() public { int256 liquidityDelta = -19999; uint256 swapAmount = 100_000 * unit0; LiquidityParams memory params = LiquidityParams({ tickLower: TickMath.MIN_TICK + 1, tickUpper: TickMath.MAX_TICK - 1, liquidityDelta: liquidityDelta }); (uint256...
calculator.tokenToUSD( ITokenManager(ISmartVaultManager(manager).tokenManager()).getTokenIfExists(_collateralAddr), _collateralAmount )
same_firm_diff_protocol
Solodit
HIGH
2
2
HIGH severity: TRST-It’s never possible to vote for new pools until setMaxVotesForPool() is called. **Description:** The function `_vote()` allows voting on a pool only when the current amount of votes plus the new votes is lower or equal to the value returned by `_calculateMaxVotePossible()`: However, `_calculateMax...
require(_poolWeights <= _calculateMaxVotePossible(_pool), "Max votes exceeded"); return ((totalVotingPower * maxVotesForPool[_pool]) / 100);
- if (debtRatioE18 >= ONE_E18 && startLiqTimestamp == 0) { + if (debtRatioE18 >= IBasePositionViewer(_positionViewer).unmarkLiqDebtRatioE18() && startLiqTimestamp == 0) { // mark liquidatable if the position is unhealthy and is not marked yet pos.startLiqTimestamp = block.time...
same_firm_diff_protocol
Solodit
HIGH
2
3
LOW severity: TRST-_derivedBalance() doesn’t properly apply boosted rewards based on voting power. **Description:** The function `_derivedBalance()` is used to adjust the balance of a pool voter based on his percentage of voting power and LP deposited. However the adjustment is only applied to the Satin / $CASH LP g...
if (underlying != IVe(ve).token()) { return _derived; } if (underlying == IVe(ve).token()) { //⇐ IF EQUAL return _derived; }
function submitProposal(uint8 _actionType, bytes memory _payload) public onlyCouncil { uint256 proposalId = proposalCount; proposals[proposalId] = Proposal(msg.sender,_actionType, _payload, 0, false); proposalCount += 1; emit ProposalSubmitted...
same_firm_diff_protocol
Solodit
LOW
2
4
HIGH severity: Insufficient Validation of Referral Address in mint. **Severity**: High **Status**: Acknowledged **Description** The `mint` function allows users to specify a referral address to receive a discount on the minting fee. However, the referral address is not validated. This means that users can set the re...
_updateGlobalTimeThreshold(); nextMint[partnerNFTAddress][partnerNFTtokenId] = globalTimeThreshold; _updateGlobalTimeThreshold(); nextSignatureMint[signature] = globalTimeThreshold;
function pendingRewards(uint256 tokenId) external view returns (uint256) { StakingPosition storage position = _stakingPositions[tokenId]; uint256 accRewardsPerShare = _accRewardsPerShare; (,,uint256 lastRewardTime, uint256 reserve, uint256 poolEmissionRate) = master.getPoolInfo(address(this)); uint256 ...
same_firm_diff_protocol
Solodit
HIGH
2
5
LOW severity: Unsafe Downcasting in `TokenStableV6_V2`. **Severity**: Low **Status**: Resolved **Description** There is unsafe downcasting on line: 483 and 492. This can result in silent overflows or truncation of the number. **Recommendation**: It is advised to use a safecast library such as that of Openzeppel...
Line: 483 uint16 currentEpoch = uint16((block.number - epochStart) / epochTerm + 1); Line: 492 return uint16((block.number - epochStart) / epochTerm + 1);
function testPOCDeleteMapping() public { vm.startPrank(address(alice)); stakingToken.mint(address(alice), 1 ether); uint _amount = 1 ether; uint _locktype = 0; whitelistChecker.Signer memory _signer; _signer.userAddress = address(alice); _signer.contractAddress = address...
same_firm_diff_protocol
Solodit
LOW
2
6
LOW severity: `TroveNFT.tokenURI` `debt` and `coll` are static and will not reflect interest and redistributions. **Impact** `TroveNFT.tokenURI` is as follows: https://github.com/liquity/bold/blob/c84585881d8c6a5d11d38deee2943ba949a39962/contracts/src/TroveNFT.sol#L33-L48 Which is not using `getLatestTroveData` Th...
function tokenURI(uint256 _tokenId) public view override(ERC721, IERC721Metadata) returns (string memory) { (uint256 debt, uint256 coll,, ITroveManager.Status status,,,, uint256 annualInterestRate,,) = troveManager.Troves(_tokenId); IMetadataNFT.TroveData memory troveData = IMetadataNFT.Tro...
for (uint i = 0; i < _iterations.length; i++) { RedeemIteration memory iteration = _iterations[i]; checkValidRedemptionHint(vars.priceCache, iteration.trove); troveManager.applyPendingRewards(iteration.trove, vars.priceCache); /// @audit The Hint may be wrong NOW, the CR may be underwater now Si...
same_firm_diff_protocol
Solodit
LOW
2
7
HIGH severity: `FarmFacet` functions are susceptible to the draining of intermediate value sent by the caller via reentrancy when execution is handed off to an untrusted external contract. **Description:** The `FarmFacet` enables multiple Beanstalk functions to be called in a single transaction using Farm calls. Any fu...
// signals to Beanstalk functions that they should not refund Eth // at the end of the function because the function is wrapped in a Farm function modifier withEth() { if (msg.value > 0) s.isFarm = 2; _; if (msg.value > 0) { s.isFarm = 1; LibEth.refundEth(); } } function refundEth() ...
function test_deactivateSupplyGauge_usesExistingSpeed() public { // Set existing speeds comptroller.setRewardSpeeds(QITOKEN_1, 1000, 2000); // Only provide borrow gauge, not supply IDistributionGaugeVote.GaugeVote[] memory gauges = new IDistributionGaugeVote.GaugeVote[](1); gauges[0] = IDistributio...
same_firm_diff_protocol
Solodit
HIGH
2
8
LOW severity: Penalty fee can be higher than the user balance. **Severity** : Low **Status** : Resolved **Description** : In Contract locking.sol, the method unlock allows users to unlock their locked tokens but a penalty fee is incurred on them. The amount fee is calculated as follows: Here if the method calculat...
function calculatePenalty(address locker, uint256 balance, uint256 unlockTimestamp) public view returns (uint256) { if (emergencyExit) { return 0; } return (balance * calculatePenaltyFee(locker, unlockTimestamp)) / 10 ** 6; }
function testPOCDeleteMapping() public { vm.startPrank(address(alice)); stakingToken.mint(address(alice), 1 ether); uint _amount = 1 ether; uint _locktype = 0; whitelistChecker.Signer memory _signer; _signer.userAddress = address(alice); _signer.contractAddress = address...
same_firm_diff_protocol
Solodit
LOW
2
9
MEDIUM severity: [RSCO-5] Ecall parameters missing address range check. **Severity:** Medium **Path:** zkvm/src/exec/executor.rs **Description:** The executor’s ecall functions that correspond to their syscalls (`ecall_sha`, `ecall_halt`, `ecall_input`, `ecall_software`, `ecall_bigint`) are missing the security chec...
fn read_mem(&mut self, addr: u32, size: MemAccessSize) -> Option<u32> { if addr < TEXT_START || addr as usize >= SYSTEM.start() { return None; } ... } fn write_mem(&mut self, addr: u32, size: MemAccessSize, store_data: u32) -> bool { if addr < TEXT_START || addr as usize >= SYSTEM.start() { ...
requestsLength = depositQueue.length; while (requestsLength > 0) { [..] } function quexCallback(uint256 receivedRequestId, DataItem memory response) external { [..] { uint256 sharesToMint; uint256 amountToInvest; uint256 totalDeposit; bytes32 depositRequestHash; Queu...
same_firm_diff_protocol
Solodit
MEDIUM
2
10
HIGH severity: Collateral is reduced twice when a position is liquidated by a user different from `protocolLiquidator`.. **Severity**: Critical **Status**: Resolved **Description** The function `liquidatePosition()` within the `Escrow.sol` smart contract is used to liquidate a position. This function differentiate...
if (msg.sender != protocolLiquidator) { require(actualCollateralRequired <= _collateralAmount, "less collateral"); uint256 positionSize = position.size; require(positionSize >= _collateralAmount, "position size should be greater than collateral"); uint256 userleverage = posit...
for (uint i = 0; i < nfts.length; i++) { collectionWhitelist[nfts[i]] = whitelisted; } for (uint i = 0; i < dataLen; i++) { TokenPrice storage tokenPrice = collectionPrices[tokenIds[i]]; tokenPrice.priceWei = pricesWei[i]; tokenPrice.updatedAt = getBlockTimestamp(); ...
same_firm_diff_protocol
Solodit
HIGH
2
11
LOW severity: Dust due to rounding tax calculations will accumulate in `Angstrom` and cannot be recovered. **Description:** The sum of rewards owed to positions can be less than the total tax amount due to rounding. While it is correct to round down these proportional share calculations, any dust that is not accounted ...
// Distribute remainder to last range and update global accumulator. unchecked { cumulativeGrowthX128 += PoolRewardsLib.getGrowthDelta(taxInEther, liquidity); rewards[ticks.poolId].globalGrowthX128 += cumulativeGrowthX128; } function test_rewardDust() public { PoolKey memory key = initializePool(address(to...
/// @notice Iterates through supported vaults and redeems assets until the required amount of base tokens is obtained function redeemRequiredBaseAssets (uint baseTokens) internal { for (uint i = 0; i < assetsArr.length; i++) { IERC4626 vault = IERC4626(assetsArr[i].asset); uint totalBaseTokens = va...
same_firm_diff_protocol
Solodit
LOW
2
12
LOW severity: `MarketOrder` minimum lifetime can be easily bypassed. **Description:** `OrderBranch::createMarketOrder` validates the `marketOrderMinLifetime` of the previous pending market order before canceling it and opening a new market order: But in `OrderBranch::cancelMarketOrder` users can cancel the pending mar...
File: OrderBranch.sol // @audit `createMarketOrder` enforces minimum market order lifetime 210: marketOrder.checkPendingOrder(); 211: marketOrder.update({ marketId: params.marketId, sizeDelta: params.sizeDelta }); File: MarketOrder.sol 55: function checkPendingOrder(Data storage sel...
function setMinimumFee(uint256 _feeInWei) external onlyRole(MINIMUM_FEE_SETTER_ROLE) { uint256 previousMinimumFee = minimumFeeInWei; minimumFeeInWei = _feeInWei; emit MinimumFeeChanged(previousMinimumFee, _feeInWei, msg.sender); }
same_firm_diff_protocol
Solodit
LOW
2
13
LOW severity: `Angstrom:_computeAndCollectProtocolSwapFee` computation can be simplified. **Description:** `AngstromL2::_computeAndCollectProtocolSwapFee` currently performs the following computation: However, the highlighted line can be simplified to: **Sorella Labs:** Fixed in commit [aa90806](https://github.com/So...
uint256 fee = exactIn ? absTargetAmount * protocolFeeE6 / FACTOR_E6 @> : absTargetAmount * FACTOR_E6 / (FACTOR_E6 - protocolFeeE6) - absTargetAmount; fee128 = fee.toInt128(); absTargetAmount * protocolFeeE6 / (FACTOR_E6 - protocolFeeE6)
function ownerMint(address to, uint256 amount) external onlyOperator { _mint(to, amount); // Approve vault to adjust by this amount approvedTotalStakedAdjustment[to] = amount; approvedAccountingAdjustment[to] = amount; emit PermissionedMint(to, amount); emit RebalanceApprovalSet(to, amount, am...
same_firm_diff_protocol
Solodit
LOW
2
14
MEDIUM severity: [LID-21] Withdrawals accrued rewards are not distributed among stakers. **Severity:** Medium **Path:** PositiveTokenRebaseLimiter.sol **Description:** The PositiveTokenRebaseLimiter calculates the rewards to be taken from the vaults and the amount of shares to be burned for withdrawal requests. Ora...
sharesBurnLimit = (totalWithdrawalRequestETH / totalPooledETH) * totalShares TokenRebaseLimiterData memory tokenRebaseLimiter = PositiveTokenRebaseLimiter.initLimiterState( getMaxPositiveTokenRebase(), _preTotalPooledEther, _preTotalShares );
function withdraw(uint256 _amount, address _recipient) external onlyOwner { pool.withdraw(asset, _amount, _recipient); }
same_firm_diff_protocol
Solodit
MEDIUM
2
15
LOW severity: Array length validation is not necessary. **Description:** [`RiskOracle::publishBulkRiskParameterUpdates`](https://github.com/ChaosLabsInc/risk-oracle/blob/9449219174e3ee7da9a13a5db7fb566836fb4986/src/RiskOracle.sol#L117-L142) currently validates that the lengths of all input arrays are equal. This valid...
function publishBulkRiskParameterUpdates( string[] memory referenceIds, bytes[] memory newValues, string[] memory updateTypes, bytes[] memory markets, bytes[] memory additionalData ) external onlyAuthorized { require( referenceIds.length == newValues.length && newValues.length == updateT...
function activateAccount(bytes calldata _signature) external { address account = _msgSender(); bytes32 hash = keccak256(abi.encode(account)); // @account simple hash, no EIP-712 if (authorizedSigner() != ECDSA.recover(hash, _signature)) { revert InvalidSignature(); } _activateAccount(accou...
same_firm_diff_protocol
Solodit
LOW
2
16
LOW severity: Unexpected behavior if user stakes in the same block as when the first pool is created. If there is only 1 rewards pool and a user has staked in exactly the same block as when the pool was created, then both and will return `true`. The problem is the first check is in the `if` of `getCurrentShareRaw`, w...
(pool[pool.length - 1].time) <= timeLizardLocked[_tokenId]
require(requests[_requestId].exists, 'RandomProvider: requestId not found'); _core.resolveClaimer(requests[_requestId].listingId, randomWords[0]); emit RequestFulfilled(_requestId, requests[_requestId].listingId, randomWords); + delete requests[_requestId];
same_firm_diff_protocol
Solodit
LOW
2
17
HIGH severity: Use `ReentrancyGuardTransient` for faster `nonReentrant` modifiers. **Description:** Use [ReentrancyGuardTransient](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/ReentrancyGuardTransient.sol) for faster `nonReentrant` modifiers: **Lido:** Fixed in commit...
Vault.sol 10:import {ReentrancyGuard} from "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; 32:abstract contract Vault is ERC4626, ERC20Permit, AccessControl, ReentrancyGuard, Pausable {
it("audit small rewards not distributed while reserves and exchange rate increasing", async () => { const swellTreasuryRewardPercentage = parseEther("0.1"); await swETH_Deployer.setSwellTreasuryRewardPercentage( swellTreasuryRewardPercentage ); await swETH_Deployer.deposit({ va...
same_firm_diff_protocol
Solodit
HIGH
2
18
HIGH severity: BPS_TO_DECIMAL conversion is wrong, leading users to dramatically overpay for options. The constant value used to convert bips to decimals is defined as: `10e14` is equivalent to `1e15`, which when multiplied by `10_000 bips` equals `1e19`, which is 10x higher than it should be. The result is that the ...
uint256 constant BPS_TO_DECIMAL = 10e14; function testZach__ConversionMakesBidTooLow() public { vm.warp(block.timestamp + 20 days); uint TIME_TO_EXPIRY = 2 weeks; uint VOL_DEC = 0.5e18; uint SPOT_DEC = 10e18; uint STRIKE_DEC = 12e18; int RATE_DEC = 0.05e18; (ui...
function testZach_CanReceiveEth() public { uint before = address(lidoSplit).balance; payable(address(lidoSplit)).transfer(1 ether); assertEq(address(lidoSplit).balance, before + 1 ether); }
same_firm_diff_protocol
Solodit
HIGH
2
19
HIGH severity: Immediate stake cache updates enable reward distribution without P-Chain confirmation. **Description:** The middleware immediately updates stake cache for reward calculations when operators initiate stake changes via `initializeValidatorStakeUpdate()`, even though these changes remain unconfirmed by the ...
// In initializeValidatorStakeUpdate(): function _initializeValidatorStakeUpdate(address operator, bytes32 validationID, uint256 newStake) internal { uint48 currentEpoch = getCurrentEpoch(); nodeStakeCache[currentEpoch + 1][validationID] = newStake; nodePendingUpdate[validationID] = true; // @audit P-...
impl AirdopOnChain for AirdropData { fn new(instruction_data: &[u8]) -> Result<&Self, DeriverseError> { bytemuck::try_from_bytes::<Self>(instruction_data) .map_err(|_| drv_err!(InvalidClientDataFormat)) // Only format check } } amount = ((amount as f64) * data.ratio) as u64; // No validat...
same_firm_diff_protocol
Solodit
HIGH
2
20
LOW severity: Missing storage gap in upgradeable parent contract causes storage slot collision risk. **Description:** The `VaultDeployer` abstract contract is designed to be upgradeable and inherited by child contracts `SegregatedVaultDeployer` and `SecuritizeVaultDeployer`. However, `VaultDeployer` lacks storage gap v...
abstract contract VaultDeployer is IVaultDeployer, BaseContract { bytes32 public constant AGGREGATOR_ROLE = keccak256("AGGREGATOR_ROLE"); address public navProvider; address internal admin; address public upgradeableBeacon; + // Reserve storage slots for future VaultDeployer upgrades + uint256[47]...
function test_maxRedeem_WhenWithdrawalsPaused() external { // user1 deposits $1000 USDe into the main vault uint256 user1AmountInMainVault = 1000e18; USDe.mint(user1, user1AmountInMainVault); vm.startPrank(user1); USDe.approve(address(pUSDe), user1AmountInMainVault); uint256 user1MainVaultShare...
same_firm_diff_protocol
Solodit
LOW
2
21
LOW severity: BATCH DEBT FIXES - Rebase is economicall unfeasible.
SHARES * 1e16 // DENOM 9999999.0 SHARES * 1e14 // DENOM 99999.0 SHARES * 1e13 // DENOM 9999.0 SHARES * 1e9 // DENOM 1.0 SHARES * 1e8 // DENOM 0.0 SHARES * 1e10 // DENOM 10.0 SHARES * 2e8 // DENOM 0.0 SHARES * 9e8 // DENOM 0.0 SHARES * 1.9e8 // DENOM 0.0 SHARES * 1.9e9 // DENOM 1.0 0.06 * 1e9 / 1e18 6e-11 0.06 * 1e9 / 1...
bytes wrongCheck = "a54D3c09E34aC96807c1CC397404bF2B98DC4eFb"; bytes rightCheck = "a54d3c09E34aC96807c1CC397404bF2B98DC4eFb"; function test_bytes_checksum() public { bytes32 kak1 = keccak256(wrongCheck); bytes32 kak2 = keccak256(rightCheck); assertEq(kak1, kak2, "same res"); } byt...
same_firm_diff_protocol
Solodit
LOW
2
22
MEDIUM severity: Calculated commission cut does not align with the expected percentages. **Severity**: Medium **Status**: Resolved **Description** The `getComissionCut()` function within the `Treasury.sol` smart contract is used to calculate the commission that must be taken from the players. After some calculation...
if (tier == 4) { //10-20% comissionCut = 3000; } else if (tier > 0) { //30% comissionCut = 1000 + 500 * tier - 1; }
if (block.timestamp - updatedAt > STALENESS_THRESHOLD) revert ChainlinkPriceFeedStale(); mapping(address => uint256) private s_stalenessTresholds; function _getAssetOraclePrice(address asset) internal view returns (uint256) { AggregatorV3Interface priceFeed = s_assetConfigs[asset].chainlinkPriceFeed; (, int25...
same_firm_diff_protocol
Solodit
MEDIUM
2
23
HIGH severity: Anyone can make new bids always revert after a window expires. **Impact:** High, as all new bidding will revert until auction ends **Likelihood:** High, as anyone can execute the attack without rare preconditions **Description** The `fulfillWindow` method is a `public` method that is also called inter...
if (hasExpired) { window = _window[auctionId][windowExpiration(auctionId)]; } if (window.processed) { revert WindowFulfilled(); }
if ((block.timestamp - reward.claimedAt) < claimTimeout) revert ClaimTimeout(reward.claimedAt + claimTimeout);
same_firm_diff_protocol
Solodit
HIGH
2
24
HIGH severity: Users can purchase vaults by paying less amount of funds than expected, even by the least. **Severity**: Critical **Status**: Acknowledged **Description** Users call to `purchaseFirstVaults()` or `purchaseMoreVaults()` in `NodeSale.sol` in order to buy vaults. These functions receive `numberOfVaults...
function testPOCByPassIncreasePrice() public { vm.startPrank(randomUser); (uint256 price, uint256 amountUntilNextPrice) = lumiaVault.pricePerVault(); paymentToken.dispense(); paymentToken.approve(address(lumiaVault), price * (amountUntilNextPrice - 1)); string memory referralC...
if (shareValue > fees_.highWaterMark) fees.highWaterMark = shareValue; if (fee > 0) _mint(fees_.feeRecipient, convertToShares(fee)); fees.feesUpdatedAt = uint64(block.timestamp); return managementFee > 0 ? managementFee.mulDivDown( totalAssets() * (bl...
same_firm_diff_protocol
Solodit
HIGH
2
25
LOW severity: Admin has unlimited power to mint new OHM. While the SiloAMO system appears to have many checks and balances, in the form of a permissionless `update()` function and a `maximumToDeploy` cap on OHM deployed, all these checks can be circumvented by a malicious admin. While I don't see an incentive for the ...
function setMaximumToDeploy(uint256 newMaximum_) external onlyRole("lendingamo_admin") { maximumToDeploy = newMaximum_; } function setRateModel(address newRateModel_) external onlyRole("lendingamo_admin") { rateModel = newRateModel_; } function setUpdateInterval(uint256 newInterval_) external onlyRole("lendin...
function setGauge(address token, address gauge) external onlyGovernanceOrFactory { if (token == address(0)) revert ADDRESS_NULL(); if (gauge == address(0)) revert ADDRESS_NULL(); gauges[token] = gauge; /// Approve trough the locker. locker.safeExecute(token, 0, abi.encodeWithSignature("approve(add...
same_firm_diff_protocol
Solodit
LOW
2
26
MEDIUM severity: `BorrowerOperations` alters user debt but enforces prices are not stale only for debts that are being actively altered. **Impact** A common pattern used in Apollon for price validation looks as follows: https://github.com/blkswnStudio/ap/blob/8fab2b32b4f55efd92819bd1d0da9bed4b339e87/packages/contract...
function addColl( TokenAmount[] memory _colls, address _upperHint, address _lowerHint, bytes[] memory _priceUpdateData ) public payable override { address borrower = msg.sender; (ContractsCache memory contractsCache, LocalVariables_adjustTrove memory vars) = _prepareTroveAdjustment( borr...
/// will be 0 on the second retrieval and the require will fail. require( /// @audit Pretty sure OZ does this valid && recoveredAddress != address(0), "RecoverySpell: Invalid signature" ); assembly ("memory-safe") { valid := tload(recoveredAddress...
same_firm_diff_protocol
Solodit
MEDIUM
2
27
HIGH severity: Redundant condition in `LibSilo::_mow` can be removed. There is a [line](https://github.com/BeanstalkFarms/Beanstalk/blob/c7a20e56a0a6659c09314a877b440198eff0cd81/protocol/contracts/libraries/Silo/LibSilo.sol#L355) within `LibSilo::_mow` which performs some validation on the last update for a given accou...
- if (lastUpdate <= s.season.rainStart && lastUpdate <= s.season.current) { + if (lastUpdate <= s.season.rainStart) {
function setAllowedDeviationBps(...) external onlyRole(CONFIGURER_ROLE) { if (bps >= BPS_DENOMINATOR) revert InvalidDeviationBps(); prices[token].allowedDeviationBps = bps; emit AllowedDeviationSet(token, bps); } function setDefaultAllowedDeviationBps(...) public onlyRole(CONFIGURER_ROLE) { if (bps == 0) rever...
same_firm_diff_protocol
Solodit
HIGH
2
28
LOW severity: Admin user can `unstake` without fulfilling the staking period. **Severity**: Low **Status**: Resolved **Description** In contract TradableStaking, the method _unstake(...) implemented the following logic Here it means that the admin user can unstake without fulfilling the staking period. **Recommend...
if (user != ITradableSettings(settingsProvider).getAdminUser()) { uint256 timeDiff = block.timestamp - (uint256(_stakes.timestamp)); require( timeDiff > uint256(stakingSettings.stakingPeriod), "period" ); // console.log("timeDiff: %d", timeDiff); }
require( priceTimestamp - game.endTime <= 10 minutes || block.timestamp - priceTimestamp <= 10 minutes, "Old chainlink report" );
same_firm_diff_protocol
Solodit
LOW
2
29
HIGH severity: Yield spread cannot be decrease without causing significant loss to the stUSDC pool. **Details** [StUsdc.sol#L313-L324](https://github.com/stakeup-protocol/stakeup-contracts/blob/b4d8a83e9455efb8c7543a0fc62b5aea598c7f49/src/token/StUsdc.sol#L313-L324) function _liveTbyValue(IBloomPool pool) interna...
function _liveTbyValue(IBloomPool pool) internal view returns (uint256 value) { uint256 startingId = lastRedeemedTbyId(); // Because we start at type(uint256).max, we need to increment and overflow to 0. unchecked { startingId++; } uint256 lastMintedId = pool.lastMintedId(); if (lastMintedId == type(uint256).max) retur...
function prepareCondition( ... ) public returns (ConditionID) { // Limit of 256 because we use a partition array that is a number of 256 bits. if (outcomeSlotCount < 2 || outcomeSlotCount > 255) revert InvalidOutcomeSlotsAmount(); // If not prepared, initialize, and emit the event, otherwise just return existing condi...
same_firm_diff_protocol
Solodit
HIGH
2
30
HIGH severity: Arbitrary amount can be withdrawn (stolen). **Severity**: Critical **Status**: Resolved GatewayManagerFacet.sol - A vulnerability is identified in the `releaseRewardForRelayer` function. The issue allows for arbitrary amount inputs without proper validation, potentially leading to unauthorized fund dra...
function releaseRewardForRelayer(uint256 amount) external nonReentrant { if (amount == 0) { revert CannotReleaseZero(); } (bool registered, Subnet storage subnet) = LibGateway.getSubnet(msg.sender); if (!registered) { revert NotRegisteredSubnet(); } ...
function decimals() public view virtual override returns (uint8) { return _decimals; }
same_firm_diff_protocol
Solodit
HIGH
2
31
HIGH severity: Remove obsolete return statements when using named return variables. **Description:** Remove either the named return value or the `return` statement. * [`BasisTradeVault::requestWithdraw`](https://github.com/buttonxyz/button-protocol/blob/9002f2b0d05ba80039bd942c809dbe5bc1a252c9/src/BasisTradeVault.sol#...
function requestWithdraw(uint256 assets) external returns (uint256 queuePosition) { // ... return requestRedeem(shares); } function requestRedeem(uint256 shares) public requirePocket returns (uint256 queuePosition) { // ... return queuePosition; } function exec(address target, bytes call...
function rate() external view override returns (uint256) { uint8 oracleDecimals = priceFeed.decimals(); uint8 assetDecimals = asset.decimals(); int256 rsRate = priceFeed.latestAnswer(); require(rsRate != 0, 'Rate must not be zero'); // @audit Checks raw value only // @audit normalized rate never z...
same_firm_diff_protocol
Solodit
HIGH
2
32
LOW severity: Protocol will leak value to users due to rounding in `SecuritizeSwap::buy`. **Description:** Protocols should always round against users in favor of the protocol. The `buy` function in the `SecuritizeSwap.sol` is rounding the stable coin need it in favor of the user: With this rounding down, in theory a ...
function buy(uint256 _dsTokenAmount, uint256 _maxStableCoinAmount) public override whenNotPaused { ... uint256 stableCoinAmount = calculateStableCoinAmount(_dsTokenAmount); <---- dsToken.issueTokensCustom(msg.sender, _dsTokenAmount, block.timestamp, 0, "", 0); emit Buy(msg.sender, _dsTo...
function recalculateNftPower(uint256 tokenId) public override returns (uint256 newPower) { // @audit execution allowed to continue when // block.timestamp == powerCalcStartTimestamp if (block.timestamp < powerCalcStartTimestamp) { return 0; } // @audit getNftPower() returns 0 when // blo...
same_firm_diff_protocol
Solodit
LOW
2
33
HIGH severity: Incorrect Check For Early Stakers. **Severity** - High **Status** - Resolved **Description** For the first 99 stakers the minimum staking amount is 8e6 ether tokens (compared to 16e6 ether tokens for non-early stakers) , the code which verifies if the staker is an early staker is → It checks if the s...
function canUseReducedStakingAmount(address stakerAddress) public view returns (bool eligible, uint256 requiredStakingAmount) { EarlyStaking earlyStaking = EarlyStaking(payable(getContractAddress("EarlyStaking"))); int256 stakerIndex = earlyStaking.getIndexOf(stakerAddress); bool isEarlyStaker = stakerIndex...
console.log("Withdrawable Tokens: %s", tokensAvailable); console.log("Everyday Percentage: %s, Days: %s, Current Unlock %: %s",everyDayReleasePercentage, noOfDays, currentUnlockedPercentage);
same_firm_diff_protocol
Solodit
HIGH
2
34
MEDIUM severity: Require check in `MultiSig_V2` can be bypassed. **Severity**: Medium **Status**: Resolved **Description** In the MultiSig contract, the require check statement of `_numConfirmationsRequired <= _whiteWallet.length` could be bypassed if `DeregisterWhiteWallet()` is used. For example, if the wallet `_...
require( _numConfirmationsRequired > 0 && _numConfirmationsRequired <= _whiteWallet.length, "invalid number of required confirmations" );
if (userMaxAllc > maxAllocation) { return maxAllocation;
same_firm_diff_protocol
Solodit
MEDIUM
2
35
MEDIUM severity: User can join after the first question is revealed to gain an advantage over other users. **Description:** Users can join a game while the game is ongoing: `SessionManager::startAndRevealGameQuestion` both moves the game to the `Ongoing` state and reveals the first question. **Impact:** A user can ge...
function joinGame(uint256 _gameId) external { require( games[_gameId].state == SessionState.Created || games[_gameId].state == SessionState.Ongoing, InvalidGameState(SessionState.Created, games[_gameId].state) ); } function joinGame(uint256 _gameId) external { - require...
File: Goldivault.sol 159: if(remainingTime > 0) { 160: SafeTransferLib.safeTransfer(depositToken, msg.sender, amount * (1000 - _fee) / 1000); 161: SafeTransferLib.safeTransfer(depositToken, multisig, amount * _fee / 1000); //@audit rounding loss 162: emit OwnershipTokenRedemption(msg.sender, amoun...
same_firm_diff_protocol
Solodit
MEDIUM
2
36
LOW severity: Missing Signer and New Account Validation for `asset_token_program_acc` in `new_instrument`. **Description:** The `new_instrument` instruction lacks validation checks for `asset_token_program_acc` when creating a new asset token account. Unlike `new_base_crncy` which explicitly validates that the program ...
if is_new_account(asset_token_acc) { let decimals = *asset_mint .data .borrow() .get(MINT_DECIMALS_OFFSET) .ok_or_else(|| drv_err!(DeriverseErrorKind::InvalidClientDataFormat))? as u32; if !(MIN_DECS_COUNT..=MAX_DECS_COUNT).contains(&decimals)...
function _handleRewards(IInfraredVault.UserReward[] memory _rewards) internal { IIsolationModeVaultFactory factory = IIsolationModeVaultFactory(VAULT_FACTORY()); for (uint256 i = 0; i < _rewards.length; ++i) { if (_rewards[i].amount > 0) { if (_rewards[i].token == UNDERLYING_TOKEN()) { ...
same_firm_diff_protocol
Solodit
LOW
2
37
HIGH severity: Users may lose value when transferring ERVault tokens cross-chain. **Description:** Both the `VaultV0` and `VaultV3` ERC-4626 tokens are designed to be transferable across chains and therefore implement the LayerZero cross-chain OFT standard. When a token is transferred cross-chain, the `_debit` functio...
function _debit(address _from, uint256 _amountLD, uint256 _minAmountLD, uint32 _dstEid) internal virtual override returns (uint256 amountSentLD, uint256 amountReceivedLD) { (amountSentLD, amountReceivedLD) = _debitView(_amountLD, _minAmountLD, _dstEid); _burn(_from, amountSentLD); } function _credit(address _t...
// In `client_community.rs` `update()` during deposit if available_tokens != self.header.drvs_tokens { // 50,000 != 0 - TRUE community_state.header.upgrade()?.drvs_tokens += 50,000; if self.header.slot <= community_state.header.voting_start_slot { // 0 <= 60 - TRUE self.header.current_voti...
same_firm_diff_protocol
Solodit
HIGH
2
38
HIGH severity: Operator is not removed in Registry when validator has `owedAmount == 0`. **Description:** `CasimirManager::withdrawValidator()` function is designed to remove a validator after a full withdrawal. It checks whether the final effective balance of the removed validator is sufficient to cover the initial 32...
uint256 owedAmount = VALIDATOR_CAPACITY - finalEffectiveBalance; if (owedAmount > 0) { uint256 availableCollateral = registry.collateralUnit() * 4; owedAmount = owedAmount > availableCollateral ? availableCollateral : owedAmount; uint256 recoverAmount = owedAmount / 4; for (uint256 i; i < validator.oper...
struct DepositReturnData { uint256 shares; @> uint256 amount0; @> uint256 amount1; } ... struct WithdrawReturnData { @> uint256 amount0; @> uint256 amount1; } ... struct SwapReturnData { uint160 updatedSqrtPriceX96; int24 updatedTick; @> uint2...
same_firm_diff_protocol
Solodit
HIGH
2
39
LOW severity: `Timelock` checks for `1` instead of `DONE_TIMESTAMP`. This should be `DONE_TIMESTAMP` https://github.com/solidity-labs-io/kleidi/blob/1a06ac16bc99d0b4081281329d03064c3737f5e4/src/Timelock.sol#L430-L431
require(timestamp != 1, "Timelock: operation already executed");
batchDebtSharesDelta = currentBatchDebtShares * debtIncrease / _batchDebt; _latestTroveData.recordedDebt = _latestBatchData.recordedDebt * batchDebtShares / totalDebtShares; // SPDX-License-Identifier: MIT pragma solidity 0.8.18; import "./TestContracts/DevTestSetup.sol"; contract Redemptions is DevTestSetup { ...
same_firm_diff_protocol
Solodit
LOW
2
40
LOW severity: TRST-Fee mismatch between contracts can make strategies unusable. **Description:** In CoW Swap strategies, fee is set in the strategy contracts and then passed to `initiateSwap()`. It is built in `_buildInitiateSwapExecutable()`: There is a mismatch between the constraints around fees between the stra...
// Generate executable to initiate swap on DCACoWAutomation return Types.Executable({ callType: Types.CallType.DELEGATECALL, target: dcaCoWAutomation, value: 0, data: abi.encodeCall( DCACoWAutomation.initiateSwap, (params.tokenIn, params.tokenOut, swapRecipient, amountIn, minAmountOut, swapFee) ...
uint256 _pool = balance(); if (_pool + _amount > underlyingCap) { revert NYProfitTakingVault__UnderlyingCapReached(underlyingCap); } uint256 _before = underlying.balanceOf(address(this)); underlying.safeTransferFrom(msg.sender, address(this), _amount); uint2...
same_firm_diff_protocol
Solodit
LOW
2
41
LOW severity: Blacklisted addresses will count towards total slope if they vote before rollover. When we roll over to a new period, we calculate the `rewardPerVote` by taking the `rewardPerPeriod` and dividing by the total bias (votes) for the gauge. In order to ensure these calculations are accurate, blacklisted addr...
uint256 gaugeBias = _getAdjustedBias(bounty.gauge, bounty.blacklist, currentPeriod); rewardPerVote[bountyId] = rewardPerPeriod.mulDiv(_BASE_UNIT, gaugeBias); gaugeBias = gaugeController.points_weight(gauge, period).bias; for (uint256 i = 0; i < length;) { // Get the user slope. userSlope = gaugeController.vot...
if (nouns.getPriorVotes(proxy, nouns.proposalCreationBlock(proposalId)) == 0) revert NoVotes;
same_firm_diff_protocol
Solodit
LOW
2
42
MEDIUM severity: Uninitialized CCTP domain mapping can send USDC to the incorrect blockchain. **Description:** `USDCBridgeV2::chainIdToCCTPDomain` maps Wormhole chain IDs to Circle's CCTP domain IDs: **Impact:** When this mapping isn't initialized for a wormhole chain id, it returns 0 by default (Solidity's default va...
mapping(uint16 => uint32) public chainIdToCCTPDomain; function getCCTPDomain(uint16 _chain) internal view returns (uint32) { return chainIdToCCTPDomain[_chain]; // @audit returns 0 if not set! } circleTokenMessenger.depositForBurn( _amount, getCCTPDomain(_targetChain), // @audit 0 by defa...
if ( !pledgeRoundConcluded && SafeCast.toUint32(block.timestamp) < deadline ) { refundAmount -= (refundAmount * earlySellPenalty) / 1e6; _propertyToken.adminTransferFrom( signer, holderWallet, numTokens, ...
same_firm_diff_protocol
Solodit
MEDIUM
2
43
MEDIUM severity: Allowance check in `FiveFiftyRule::canTransfer` is inverted. **Description:** The following snippet from `FiveFiftyRule::canTransfer` has inverted logic. This is also present in `FiveFiftyRule::checkCanTransfer`. **Impact:** No transfers to entities are possible except in the rare cases that `allowan...
if (iTo.isEntity) { // if entity @> if (entityData[to].allowance <= amount) { entityData[to].allowance -= SafeCast.toUint64(amount); iTo.lastBalance += SafeCast.toUint64(amount); emit FiveFiftyApproved(from, to, amount); retur...
function getInitialLPFee(uint24 self) internal pure returns (uint24) { // the initial fee for a dynamic fee pool is 0 if (self.isDynamicFee()) return 0; self.validate(); return self; } function test_zeroInitialLPFee() public { PoolKey memory key = initializePool(address(token), 10, 3); assertEq...
same_firm_diff_protocol
Solodit
MEDIUM
2
44
HIGH severity: Precision loss can result in funds becoming stuck in incentive logic contracts. **Description:** In all three incentive logic contracts, the `ratePerSec` of deposited rewards is computed by performing a division of the `amount` to distribute by the `duration`: If the token to distribute has a small amou...
function depositRewards(IncentivizedPoolId id, address token, uint256 amount, uint256 duration) external override nonReentrant { ... uint32 endTimestampCache = _state.endTimestamp; if (endTimestampCache < block.timestamp) { if (duration < MIN_DURATION) rev...
int256 currentLastInterpolationPossible = type(int256).max; for (uint i; i < local.currentWeights.length; ) { // ... if (blockMultiplier > int256(0)) { weightBetweenTargetAndMax = upperGuardRail - local.currentWeights[i]; // ... blockTimeUntilGuardRailHit = weightBetweenTargetAndMax / ...
same_firm_diff_protocol
Solodit
HIGH
2
45
HIGH severity: If `feeScaled` is set too high in the constructor, the protocol will be bricked. When `feeScaled` is set using the `setFeeScaled()` function, we perform a check to ensure it is lower than `1e18`: However, when the value is set from the constructor, there is no such check: This means that it is possible...
function setFeeScaled(uint256 _feeScaled) external onlyOwner { if (_feeScaled > SCALAR) { revert AMKTVaultFeeTooLarge(); } tryInflation(); feeScaled = _feeScaled; } constructor( IIndexToken _indexToken, address _owner, address _feeRecipient, uint256 _feeScaled ) { indexToke...
uint256 feeDiff = boost + stakeDaoTotalFee > convexTotalFee ? stakeDaoTotalFee + boost - convexTotalFee : 0;
same_firm_diff_protocol
Solodit
HIGH
2
46
HIGH severity: Precision loss in `swETH::_deposit` from unnecessary hidden division before multiplication. **Description:** `swETH::_deposit` [L170](https://github.com/SwellNetwork/v3-contracts-lst/blob/a95ea7942ba895ae84845ab7fec1163d667bee38/contracts/implementations/swETH.sol#L170) contains a hidden unnecessary [div...
uint256 swETHAmount = wrap(msg.value).mul(_ethToSwETHRate()).unwrap(); // @audit expanding this out // wrap(msg.value).mul(_ethToSwETHRate()).unwrap(); // wrap(msg.value).mul(wrap(1 ether).div(_swETHToETHRate())).unwrap(); // SPDX-License-Identifier: MIT pragma solidity ^0.8.23; import {UD60x18, wrap} from "@prb/math...
File: PriorityPool.sol 103: token.safeApprove(_stakingPool, type(uint256).max);
same_firm_diff_protocol
Solodit
HIGH
2
47
MEDIUM severity: `getUserStake` function failure for non-staker accounts. **Description:** The function `getUserStake` in the smart contract throws an error when invoked for an address that does not have any stakes. Specifically, the function fails due to a division by zero error. This occurs because the divisor, `user...
function getUserStake(address userAddress) public view returns (uint256 userStake) { userStake = Math.mulDiv(users[userAddress].stake0, rewardStakeRatioSum, users[userAddress].rewardStakeRatioSum0); }
function performUpkeep(bytes calldata performData) external { if (lastRequestId == bytes32(0)) { triggerRequest(); } } uint256 _usdsBalance = USDs.balanceOf(address(this)); minted -= _usdsBalance;
same_firm_diff_protocol
Solodit
MEDIUM
2
48
MEDIUM severity: CRV claimed as an extraRewardToken will be stuck in Strategy. When rewards are harvested via the strategy (either `OnlyBoost.sol` or `Strategy.sol`, depending on whether the optimizer is set or not), the goal is to claim all rewards and pass them along to the appropriate reward distributor. The logic ...
function _claimExtraRewards(address gauge, address rewardDistributor) internal virtual returns (uint256 _rewardTokenClaimed) { /// If the gauge doesn't support extra rewards, skip. if (lGaugeType[gauge] > 0) return 0; // Cache the reward tokens and their balance before locker address[8] mem...
bytes32 claimHash = keccak256(claimEncoded); bytes32 prefixedHash = keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", claimHash)); bytes32 claimLen = len(claimEncoded); bytes32 prefixedHash = keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", claimLen, claimEncoded));
same_firm_diff_protocol
Solodit
MEDIUM
2
49
HIGH severity: The `SecuritizeRedemption.updateLiquidityProvider` function emits the wrong information.. **Description:** The `SecuritizeRedemption.updateLiquidityProvider` function emits the information that `oldProvider` is updated to `liquidityProvider`. But the function allocates `_liquidityProvider` to `oldProvide...
File: securitize_dev-bc-redemption-sc-32e23d5318be\contracts\redemption\SecuritizeRedemption.sol 65: function updateLiquidityProvider(address _liquidityProvider) onlyOwner external override { 66: address oldProvider = address(_liquidityProvider); 67: liquidityProvider = ILiquidityProvider(_liquidity...
if (spec == NONE) { return (recipients, amounts, spec, royaltyAddress, addToCache); }
same_firm_diff_protocol
Solodit
HIGH
2
50
MEDIUM severity: Misplaced stake limit validation in stake function of `LockedStakingPools` contract. **Severity**: Medium **Status**: Resolved **Description** The following check inside the stake function from `LockedStakingPools` contract attempts to restrict users from having more than 100 active stakes in any g...
if (userStakeIds[poolId][msg.sender].length == 0) { if (userStakeIds[poolId][msg.sender].length > 100) revert TooManyStake(); noUsersStaked[poolId] += 1; }
function clearTokenConfig(address _token) external override { _onlyGov(); require(whitelistedTokens[_token], "Token not whitelisted"); totalTokenWeights = totalTokenWeights.sub(tokenWeights[_token]); // Properly removing the token from allWhitelistedTokens array for (uint i = 0; i < allWhitelis...
same_firm_diff_protocol
Solodit
MEDIUM
2
51
HIGH severity: `transferERToTreasury` won't work as intended if `assetToken` is a multiple-address token. **Likelihood:** Low, because it requires using a multiple-address token and a malicious/compromised admin **Impact:** High, because users can use 100% of their deposits **Description** Some ERC20 tokens on the b...
require(tokenAddress != _assetTokenAddress, "IP: Asset transfer");
uint256 percentage = 100000 - slippage; uint256 glpPrice = priceFeed.getGLPprice().mul(percentage).div(100000); uint256 glpOut = amountOut.mul(10**12).mul(tokenPrice).div(glpPrice).div(10**30);
same_firm_diff_protocol
Solodit
HIGH
2
52
LOW severity: [TOKE-31] New NAV per share calculation when setting streaming fee could be stale. **Severity:** Low **Path:** AutopoolFees.sol:setStreamingFeeBps **Description:** When setting a new streaming fee, the `navPerShareLastFeeMark` is reset to the current share rate so that the new streaming fee is not appl...
function setStreamingFeeBps(IAutopool.AutopoolFeeSettings storage feeSettings, uint256 fee) external { if (fee >= FEE_DIVISOR) { revert InvalidFee(fee); } feeSettings.streamingFeeBps = fee; IAutopool vault = IAutopool(address(this)); // Set the high mark when we ch...
func ProcessDeposit(beaconState state.BeaconState, deposit *ethpb.Deposit, verifySignature bool) (state.BeaconState, bool, error) { [...] index, ok := beaconState.ValidatorIndexByPubkey(bytesutil.ToBytes48(pubKey)) if !ok { [...] if contractExist { contracts = [][]byte{make([]byt...
same_firm_diff_protocol
Solodit
LOW
2
53
HIGH severity: Avoid unnecessary initialization to zero in `BeefyVaultConcLiq::deposit`. **Description:** `BeefyVaultConcLiq::deposit` declares the `shares` variable on [L127](https://github.com/beefyfinance/experiments/blob/14a313b76888581b05d42b6f7b6097c79f3e65c6/contracts/protocol/concliq/vault/BeefyVaultConcLiq.sol...
uint256 shares = _amount1 + (_amount0 * price / PRECISION);
uint256 scaleDown = 10 ** (18 - d); execPrice = rawExecPriceWad / scaleDown; baseReserves = newBase; quoteReserves = newQuote; k = newBase * newQuote; function executeBuyBase( uint256 amountInQuote, uint256 anchorPriceWad, uint8 marketStatus ) external onlyRole(EXECUTOR_ROLE) returns (uint256 baseOu...
same_firm_diff_protocol
Solodit
HIGH
2
54
HIGH severity: Failure to pass \_withdraw_only to \_getBalanceTXs allows any withdrawing user to drain vault assets through sandwich attack. **Details** [AdapterVault.vy#L1045-L1060](https://github.com/adapter-fi/AdapterVault/blob/3c2895a69ad5eb2c4be16d454f63a6f2f074f351/contracts/AdapterVault.vy#L1045-L1060) def...
def _balanceAdapters( _target_asset_balance: uint256, pregen_info: DynArray[Bytes[4096], MAX_ADAPTERS], _withdraw_only : bool = False, _max_txs: uint8 = MAX_BALTX_DEPOSIT ): # Make sure we have enough assets to send to _receiver. txs: BalanceTX[MAX_ADAPTERS] = empty(BalanceTX[MAX_ADAPTERS]) blocked_adapters: address[MA...
try optionsContract.unlock( params.optionId, params.closingPrice, publisherSignInfo.timestamp, params.isAbove ) {} catch Error(string memory reason) { emit FailUnlock(params.optionId, params.targetContract, reason); continue; }
same_firm_diff_protocol
Solodit
HIGH
2
55
HIGH severity: Signatures on `TokenBank` and `AllowList` can be reused in perpetuity an infinite amount of times. **Description:** `TokenBank` allows buyers to purchase tokens by getting an off-chain signature, which specifies the token and the amount they are allowed to buy. When buying using a signature, the buyer do...
//TokenBank.sol// // Handle payment off chain, including referral discount function buyTokenOCP( address signer, address tokenAddress, uint256 amount, bytes memory signature ) external nonReentrant { ... if (!verifySignature(signer, sender, tokenAddress, amoun...
function _calculateOperatorShare(uint48 epoch, address operator) internal { // ... uptime checks ... uint96[] memory assetClasses = l1Middleware.getAssetClassIds(); // @audit Gets CURRENT asset classes for (uint256 i = 0; i < assetClasses.length; i++) { uint256 operatorStake = l1Middleware.getOpera...
same_firm_diff_protocol
Solodit
HIGH
2
56
HIGH severity: Mismatch in multiplier position causes incorrect weight calculations in `QuantAMMWeightedPool`. **Description:** The primary feature of QuantAMM weighted pools is to periodically update weights based on various trading rules set during pool creation. These weights are updated by a singleton contract, `Up...
/// @dev Update weight runner gives all weights in a single array shaped like [w1,w2,w3,w4,w5,w6,w7,w8,m1,m2,m3,m4,m5,m6,m7,m8], we need it to be [w1,w2,w3,w4,m1,m2,m3,m4,w5,w6,w7,w8,m5,m6,m7,m8] uint256 tokenLength = weights.length / 2; splitWeights = new int256[][](2); splitWeights[0] = new int256[](8); for (uint i;...
//here vote has been included even if end time has been passed of this period match data.choice { VoteOption::DECREMENT => { community_account_header.voting_decr += voting_tokens; } VoteOption::INCREMENT => { community_account_header.voting_inc...
same_firm_diff_protocol
Solodit
HIGH
2
57
LOW severity: [OIN8-8] Self-exchange is possible. **Severity:** Low **Path:** programs/fusion-swap/src/lib.rs#L106-L258 **Description:** `fusion-swap` does not prevent the fulfillment of orders with identical maker and taker accounts. Although this was not observed to be directly exploitable, this allows for self-fu...
... pub fn fill(ctx: Context<Fill>, order_id: u32, amount: u64) -> Result<()> { ... ++ require!( ++ ctx.accounts.maker.key() != ctx.accounts.taker.key(), ++ EscrowError::MakerAndTakerIdentical ); ... } ...
func ProcessDeposit(beaconState state.BeaconState, deposit *ethpb.Deposit, verifySignature bool) (state.BeaconState, bool, error) { [...] index, ok := beaconState.ValidatorIndexByPubkey(bytesutil.ToBytes48(pubKey)) if !ok { [...] if contractExist { contracts = [][]byte{make([]byt...
same_firm_diff_protocol
Solodit
LOW
2
58
LOW severity: Proxy-Based self-liquidation creates bad debt for lenders. **Description:** When calling [`Licredity::seize`](https://github.com/Licredity/licredity-v1-core/blob/e8ae10a7d9f27529e39ca277bf56cef01a807817/src/Licredity.sol#L550-L558) to liquidate an unhealthy position, the contract checks that the position ...
// prevents owner from purposely causing a position to be underwater then profit from seizing it // side effect is that positions cannot be seized by owner contract, such as non-fungible position manager, which is acceptable if (position.owner == msg.sender) { assembly ("memory-safe") { mstore(0x00, 0x7c474...
gi - lgi = rgo[10] - rgo[0] - lgi = 0 - 3 - 997 = 997 - 997 = 0 gi - lgi == G - rgo[0] - rgo[10] - lgi == 10 - 3 - 10 - 997 == 997 - 997 == 0 gi - lgi == rgo[0] - rgo[10] - lgi == 7 - 10 - 997 == 997 - 997 == 0
same_firm_diff_protocol
Solodit
LOW
2
59
HIGH severity: State update performed after external call in `MembershipER:mint`. **Description:** When `MembershipERC1155::mint` is invoked during a call to `MembershipFactory::joinDAO`, the `totalSupply` increment is performed after the call to `ERC1155::_mint`: While there does not appear to be any immediate impact...
function mint(address to, uint256 tokenId, uint256 amount) external override onlyRole(OWP_FACTORY_ROLE) { _mint(to, tokenId, amount, ""); totalSupply += amount * 2 ** (6 - tokenId); // Update total supply with weight } if (to.isContract()) { try IERC1155Receiver(to).onERC1155Received(operator, from, id, am...
File: audit-farcaster\src\KeyManager.sol 123: vault = _initialVault; 124: emit SetVault(address(0), _initialVault); ... 211: function setVault(address vaultAddr) external onlyOwner { 212: if (vaultAddr == address(0)) revert InvalidAddress(); 213: emit SetVault(vault, vaultAddr); 214:...
same_firm_diff_protocol
Solodit
HIGH
2
60
HIGH severity: `RewardDistributor#claim` will revert for tokens with expired locks leading to loss of rewards. **Details** [RewardsDistributor.sol#L277-L287](https://github.com/hyperstable/contracts/blob/35db5f2d3c8c1adac30758357fbbcfe55f0144a3/src/governance/RewardsDistributor.sol#L277-L287) function claim(u...
function claim(uint256 _tokenId) external returns (uint256) { if (block.timestamp >= time_cursor) _checkpoint_total_supply(); uint256 _last_token_time = last_token_time; _last_token_time = _last_token_time / WEEK * WEEK; uint256 amount = _claim(_tokenId, voting_escrow, _last_token_time); if (amount != 0) { @> ...
function rewardPerToken(address _ibToken) public view returns (uint256) { if (totalSupply[_ibToken] == 0) { return rewardPerTokenStored[_ibToken]; }
same_firm_diff_protocol
Solodit
HIGH
2
61
LOW severity: Stale Issuance Records After `Burn` and `Seize` Operations. **Description:** The `recordBurn()` and `recordSeize()` functions in `ComplianceServiceRegulated.sol` do not clean up issuance records when tokens are burned or seized. This causes stale issuance records to persist in the system, which can lead t...
function recordBurn(address _who, uint256 _value) internal override returns (bool) { if (compareInvestorBalance(_who, _value, _value)) { adjustTotalInvestorsCounts(_who, CommonUtils.IncDec.Decrease); } return true; }
// SPDX-License-Identifier: MIT // SPDX-FileCopyrightText: Copyright 2024 ADDPHO pragma solidity 0.8.25; contract MockAvalancheL1Middleware { uint48 public constant EPOCH_DURATION = 4 hours; uint48 public constant SLASHING_WINDOW = 5 hours; address public immutable L1_VALIDATOR_MANAGER; address public...
same_firm_diff_protocol
Solodit
LOW
2
62
LOW severity: Aave rewards incentives lost as there is no way to claim them. **Description:** When a bet uses an Aave pool, funds are supplied to Aave and can accrue [incentive rewards](https://aave.com/docs/aave-v3/aptos/smart-contracts/incentives), but the contracts provide no way to claim or forward these rewards (n...
function aave_claimRewards(address reward) external { address[] memory assets = new address[](1); assets[0] = _bet.asset; rewardsController.claimRewards( assets, type(uint256).max, _treasury, reward ); }
function setUp() public virtual { // prevent Foundry from setting block.timestamp = 1 which can cause // errors in this protocol vm.warp(1659973223); // SPDX-License-Identifier: MIT pragma solidity 0.8.19; import {AdminVoting} from "../../../contracts/dao/AdminVoting.sol"; // test setup import {TestSetup...
same_firm_diff_protocol
Solodit
LOW
2
63
HIGH severity: Lack of ERToken Transfer Validation. **Severity**: Medium **Status**: Resolved **Location:** Admin.sol, TokenSaleUSDB.sol **description** Function `createPoolNew()` initiates ERC20 token transfers without validating the return value of the transfer operation. This oversight can result in unhandled tr...
310 IERC20D(_params.tokenAddress).transferFrom(msg.sender, instance, (_params.totalSupply + _params.tokenLiquidity)); 236 if(params.tokenLiquidity - tokenAmount > 0) IERC20D(params.tokenAddress).transfer(creator, params.tokenLiquidity - tokenAmount); ... 246 if (liquidity > 0) IERC20D(pair).transfer(creator,liquidity)...
(uint80 roundID, int256 answer, , uint256 timestamp, uint80 answeredInRound) = _btcUsdFeed.latestRoundData(); require(answeredInRound >= roundID, "Stale price"); require(timestamp != 0,"Round not complete");
same_firm_diff_protocol
Solodit
HIGH
2
64
LOW severity: `PledgeManager::pricePerToken` can only support a maximum price of `$4294`. **Description:** `PledgeManager::pricePerToken` uses `uint32` and indicates in the comment it represents USD price using 6 decimals of precision: **Impact:** Since the maximum value of `uint32` is 4294967295, with 6 decimals of p...
uint32 public pricePerToken; //in usd (6 decimals)
# Guard (fails if PRIVATE_KEY not provided) @if [ -z "$(PRIVATE_KEY)" ]; then \ echo "$(RED)ERROR: PRIVATE_KEY not set$(NC)"; \ exit 1; \ fi # Usage (Sepolia) forge script script/Deployer.s.sol:Deployer \ --rpc-url $(BASE_SEPOLIA_RPC) \ --private-key $(PRIVATE_KEY) \ --broadcast \ --verify \ --ethers...
same_firm_diff_protocol
Solodit
LOW
2
65
MEDIUM severity: Setting a peer `NttManager` contract for the same chain can cause loss of user funds. **Description:** The current implementation of `NttManager::setPeer` allows the owner to set the NTT Manager as a peer for the same chain ID as the current chain. If the NTT Manager owner accidentally (or otherwise) s...
function testTransferToOwnChain() external { uint16 localChainId = nttManager.chainId(); DummyToken token = DummyToken(nttManager.token()); uint8 decimals = token.decimals(); nttManager.setPeer(localChainId, toWormholeFormat(address(0x999), decimals); address user_A = address(uint160(uint256(keccak2...
// NormalizedTokenDecimalsVPCalc.sol function _normalizeVaultTokenDecimals(address vault, uint256 votingPower) internal view virtual returns (uint256) { return votingPower.scale(IERC20Metadata(_getCollateral(vault)).decimals(), BASE_DECIMALS); //@audit BASE_DECIMALS = 24 } //Scaler.sol function scale(uint256 value...
same_firm_diff_protocol
Solodit
MEDIUM
2
66
MEDIUM severity: Maximum preclaim limit can be easily bypassed to preclaim entire token allocation. **Description:** The `AllocationVesting` contract allows token recipients to preclaim up to a maximum of their total token allocation, however this limit can easily by passed allowing recipients to preclaim their entire ...
function test_transferPoints_BypassVestingViaPreclaim() external { AllocationVesting.AllocationSplit[] memory allocationSplits = new AllocationVesting.AllocationSplit[](2); uint24 INIT_POINTS = 50000; // allocate to 2 users 50% 50% allocationSplits[0].recipient = users.user1; allocationSpl...
function mint( uint256 shares, address receiver //@audit receiver could be not whitelisted? ) public override onlyWhitelisted(msg.sender) returns (uint256 assets) { ... } function test_mint_non_whitelist_receiver() public { uint256 amount = 100 ether; vm.startPrank(user...
same_firm_diff_protocol
Solodit
MEDIUM
2
67
HIGH severity: More efficient way of checking for empty string in `CommonUtils::isEmptyString`. **Description:** More efficient way of checking for empty string in `CommonUtils::isEmptyString`: **Securitize:** Fixed in commit [22b117a](https://github.com/securitize-io/dstoken/commit/22b117a3514c04b766aa7be6c8556838655...
function isEmptyString(string memory _str) internal pure returns (bool) { return bytes(_str).length == 0; }
impl AirdopOnChain for AirdropData { fn new(instruction_data: &[u8]) -> Result<&Self, DeriverseError> { bytemuck::try_from_bytes::<Self>(instruction_data) .map_err(|_| drv_err!(InvalidClientDataFormat)) // Only format check } } amount = ((amount as f64) * data.ratio) as u64; // No validat...
same_firm_diff_protocol
Solodit
HIGH
2
68
LOW severity: Precision Loss due to truncated decimals. **Severity** : Low **Status** : Resolved **Description** : This line will cause precision loss, however it mainly depends on the constructor arguments. This bug is due to the lack of support for floating-point arithmetic, which means Solidity can only handle in...
uint256 tge_round_release = (totalAllocation * tgeReleasePercentage) / 100;
function testPOCByPassIncreasePrice() public { vm.startPrank(randomUser); (uint256 price, uint256 amountUntilNextPrice) = lumiaVault.pricePerVault(); paymentToken.dispense(); paymentToken.approve(address(lumiaVault), price * (amountUntilNextPrice - 1)); string memory referralC...
same_firm_diff_protocol
Solodit
LOW
2
69
HIGH severity: TRST-Users will be unable to claim emissions from veSatin tokens if they withdraw it or merge it. **Description:** The function `_calculateClaim()` uses the variable **lockEndTime** when checking if a veSatin is entitled to emissions for a particular week (code with mitigation from TRST-H-1): However *...
if ((lockEndTime - weekCursor) > (minLockDurationForReward)) { toDistribute += (balanceOf * tokensPerWeek[weekCursor]) / veSupply[weekCursor]; weekCursor += WEEK; }
function estimateHarvest() external view override returns (uint256 profit, uint256 callFeeToUser) { uint256 pendingReward = IMasterChef(SPOOKY_SWAP_FARM_V2).pendingBOO(POOL_ID, address(this)); uint256 totalRewards = pendingReward + IERC20Upgradeable(BOO).balanceOf(address(this)); ...
same_firm_diff_protocol
Solodit
HIGH
2
70
MEDIUM severity: The useless if and SafeMath omission:. **Description** The if statement is unnecessary here and the omission of SafeMath may lead to the overflow. **Recommendation**: Remove the if statement and implement proper SafeMath calls.
function calculatePendingRewards(address to) public view virtual override whenNotPaused returns (uint256 pendingRewards){ // Get the current Block uint256 _currentBlock = block.number; // Get the time in number of blocks uint256 _rewardBlock = _currentBlock.sub(_stakedBlocks[to], "STokens: Error in subtraction"); // Ge...
/** * Returns the latest answer * @param dataFeed Chainlink data feed * @return answer The latest answer */ function getChainlinkDataFeedLatestAnswer( AggregatorV3Interface dataFeed ) internal view returns (int) { // prettier-ignore ( /* uint80 roundId */, ...
same_firm_diff_protocol
Solodit
MEDIUM
2
71
HIGH severity: addNewAsset Does Not Mark The Previous Assets As False. **Severity** - High **Status** - Resolved **Description** When adding new assets in the vault facet all the index tokens are removed first (the old ones) and new ones are added (deletion of allIndexTokens) and then new tokens are pushed in the al...
delete s.allIndexTokens; uint256 length = _address.length; for (uint256 i = 0; i < length; ++i) { s.allIndexTokens.push(_address[i]); s.IndexToken[_address[i]] = true; assignCompartment(_address[i], _percentage[i]); emit NewAssetAdded(_address[i], _percent...
uint256 ratio = btcPoolWeight > ethPoolWeight ? (btcPoolWeight * DECIMAL_PRECISION) / ethPoolWeight : (ethPoolWeight * DECIMAL_PRECISION) / btcPoolWeight;
same_firm_diff_protocol
Solodit
HIGH
2
72
LOW severity: TRST-when using fee-on-transfer tokens in VaultV3, capacity is limited below underlyingCap. **Description:** Vault V3 documentation states it accounts properly for fee-on-transfer tokens. It calculates actual transferred amount as below: A small issue is that underlyingCap is compared to the _amount bef...
uint256 _pool = balance(); if (_pool + _amount > underlyingCap) { revert NYProfitTakingVault__UnderlyingCapReached(underlyingCap); } uint256 _before = underlying.balanceOf(address(this)); underlying.safeTransferFrom(msg.sender, address(this), _amount); uint2...
if (_amount <= balance) { SafeTransferLib.safeTransfer(ERC20(collateralAsset), msg.sender, _amount); emit Withdraw(_amount); // return in collateral format return _amount; } else { SafeTransferLib.safeTransfer(ERC20(collateralAsset), msg.sender, balance...
same_firm_diff_protocol
Solodit
LOW
2
73
LOW severity: [EIG-1] Custom errors. **Severity:** Low **Description:** In each contract the validation checks are performed using the `require` function with a reason string. **Remediation:** We would recommend to replace these with custom errors. This should be done by flipping the check. For example: becomes...
**Remediation:** We would recommend to replace these with custom errors. This should be done by flipping the check. For example:
13acd573529992578e7f0fdbe54c747a8a9d91f757947b56d343741d40a0c79103000000000000000000000000e7f1725e7734ce288f8367e1bb143e90bb3f05120000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000...
same_firm_diff_protocol
Solodit
LOW
2
74
LOW severity: [I-02] When Comptroller is low on funds, large claims will fail while small claims will succeed. When a user claims tokens on L2 (whether through `buyBackFromL1()`, `buyBack()`, `claim()` or `claimAll()`), the tokens are transferred with the following logic: It is expected that, at times, the contract wi...
// Transfer the tokens to the caller. // We are deliberately not checking if this contract has enough tokens as // this would have the desired impact in case of low buy token balance anyway. IERC20Upgradeable(address(tokenToBuy)).safeTransfer( receiver, buyTokenAmount ); function _buyBack( address receiver...
function utilizationRate(uint cash, uint borrows, uint reserves) public pure returns (uint) { // Utilization rate is 0 when there are no borrows if (borrows == 0) { return 0; } return borrows * BASE / (cash + borrows - reserves); }
same_firm_diff_protocol
Solodit
LOW
2
75
HIGH severity: Partial redemptions can be used to steal assets. **Description:** The request state is not handled properly when redeem requests are filled partially, leading to an inflated redemption price for the remaining part of the request. - When a new redemption is pushed onto an existing requestID, then the ave...
} else { // if controller had an existing active requestID requestId = requestId_; WithdrawalRequest storage request = _queue.requests[requestId_]; request.shares += shares; if (processingMode == ProcessingMode.RequestPrice) { request.totalValue += shar...
File: property-checking/MerklePropertyChecker.sol 25: if (!MerkleProof.verify(proof, root, keccak256(abi.encodePacked(ids[i])))) {
same_firm_diff_protocol
Solodit
HIGH
2
76
LOW severity: Rebalance might not work for pools with less than minimum weight assets ratio. **Severity**: Low **Status**: Resolved **Description** In Contract GlmRebalance, the method `getLatestRebalInfo(...)` has one return variable `bool isValidRebalance`. This value is set as following: Here, if any pool’s cur...
for (uint256 i; i < manager.getGmPoolLength(); i++) { … if (currentWeight < minimumWeight) { isValidRebalance = true; } } isCorePoolLowerThanThreshold(totalAssets) || isCorePoolsRatioInRange(totalAssets) ? isValidRebalance = true : isVali...
function updateReserve(IncreaseParamaters memory _increasePositionParams, uint256 price) internal { if (_increasePositionParams.isLong) { if (s.reservedSizeLong[_increasePositionParams.indexToken] == 0) { s.averagePriceLong[_increasePositionParams.indexToken] = price; s.r...
same_firm_diff_protocol
Solodit
LOW
2
77
LOW severity: Multiple `BridgeToken` can be associated with the same `NativeToken` by using `TokenBridge::setCustomContract`. **Description:** Multiple L2 `BridgeToken` can be associated with the same L1 `NativeToken` by using `TokenBridge::setCustomContract`. This was not introduced in the latest changes but is prese...
it("Multiple L2 BridgeTokens can be associated with a single L1 NativeToken by using setCustomContract", async function () { const { user, l1TokenBridge, l2TokenBridge, tokens: { L1USDT }, } = await loadFixture(deployContractsFixture); // @audit the setup of this PoC h...
function registerEmitterAndDomain(bytes memory encodedVaa) public { /* snip: parsing of Governance VAA payload */ // Set the registeredEmitters state variable. registeredEmitters[foreignChain] = foreignAddress; // update the chainId to domain (and domain to chainId) mappings getChainToDomain()[for...
same_firm_diff_protocol
Solodit
LOW
2
78
MEDIUM severity: The Redeem Function In BaseControlledAsyncRedeem Does Not Check That msg.sender Can Spend Owner Funds Using Allowance. **Severity**: Medium **Status**: Acknowledged **Description** The redeem function in the BaseControlledAsyncRedeem function allows users to claim their tokens by redeeming vault sha...
function redeem( uint256 shares, address receiver, address controller ) public virtual override returns (uint256 assets) { require( controller == msg.sender || isOperator[controller][msg.sender], "ERC7540Vault/invalid-caller" ); // ============= SNIP ==...
Scenario #1 ( normal flow ): 1. Bob setup his collection, creating a security policy where he enables the price constrain enforce in tx #1 block #1 2. Bob setup his pricing bound by calling the function “setTokenPricingBoundaries” in tx#2 block #1 3. Alice, Carol & David execute different nft transactions using Payme...
same_firm_diff_protocol
Solodit
MEDIUM
2
79
HIGH severity: TRST-Attackers can drain users over time by donating negligible ERamount. **Description:** In the Console automation model, a strategy shall keep executing until its trigger check fails. For DCA strategies, the swapping trigger is defined as: **Impact:** Note that every execution will charge the user fo...
function canInitSwap(address subAccount, address inputToken, uint256 interval, uint256 lastSwap) external view returns (bool) { if (hasZeroBalance(subAccount, inputToken)) { return false; } return ((lastSwap + interval) < block.timestamp); }
function changeHatToggle(uint256 _hatId, address _newToggle) external { _checkAdmin(_hatId); Hat storage hat = _hats[_hatId]; if (!_isMutable(hat)) { revert Immutable(); } hat.toggle = _newToggle; emit HatToggleChanged(_hatId, _newToggle); }
same_firm_diff_protocol
Solodit
HIGH
2
80
HIGH severity: Remove duplicate calculation in `TokenLocker::withdrawWithPenalty`. **Description:** Remove duplicate [calculation](https://github.com/Bima-Labs/bima-v1-core/blob/09461f0d22556e810295b12a6d7bc5c0efec4627/contracts/dao/TokenLocker.sol#L878-L879) in `TokenLocker::withdrawWithPenalty`: To get around "stack...
- accountData.locked -= uint32((amountToWithdraw + penaltyTotal - unlocked) / lockToTokenRatio); - totalDecayRate -= uint32((amountToWithdraw + penaltyTotal - unlocked) / lockToTokenRatio); + // calculate & cache total amount of locked tokens withdraw inc penalties, + // scaled down by lockToTokenRatio + uint32 lockedP...
IERC20(daos[daoMembershipAddress].currency).transferFrom(msg.sender, owpWallet, platformFees); IERC20(daos[daoMembershipAddress].currency).transferFrom(msg.sender, daoMembershipAddress, tierPrice - platformFees);
same_firm_diff_protocol
Solodit
HIGH
2
81
MEDIUM severity: Fees will be lost in the event that a user withdraws from MarketFundingPool and there isn't enough reserves to cover fees. **Details** [ParentFundingPool.sol#L631-L646](https://github.com/SportsFI-UBet/ubet-contracts-v1/blob/64157824f67d6000588ae4235a49ccd24dede5c3/contracts/funding/ParentFundingPool....
function _reevaluateGainsOnPool(bool force) private returns (uint256 fees) { uint256 lastBlock = lastFeeEvaluationBlock; uint256 period = feeEvaluationBlockPeriod; if (!force && (block.number - lastBlock <= period)) return fees; lastFeeEvaluationBlock = uint64(block.number); uint256 poolValue = getPoolValue(); if (poo...
function burn(uint256 id, address account, uint256 amount) external onlyBloom { _totalSupply[id] -= amount; _burn(account, 0, amount); emit Burn(account, id, amount); }
same_firm_diff_protocol
Solodit
MEDIUM
2
82
MEDIUM severity: Flags can be passed by in case of `requestClosePosition`. **Severity**: Medium **Status**: Resolved **Description** VodkaVaultV2.sol - Function requestClosePosition is called with the purpose to close an open position. After functionfulfillClosePosition is invoked, position is either liquidated or c...
function requestClosePosition( uint256 _positionID, address _user ) external payable InvalidID(_positionID, _user) nonReentrant { PositionInfo storage _positionInfo = positionInfo[_user][_positionID]; 718 require( !_positionInfo.liquidated || !_positionInfo.closed, ...
uint256 discount; uint256 liqPercent = 1e18; if (currentLTV < 1e18) { discount = 1e36 / currentLTV - 999000000000000000; console.log("discount", discount); if (discount > config.liqMaxDiscount) { discount = config.liqMaxDiscount; } …}}
same_firm_diff_protocol
Solodit
MEDIUM
2
83
MEDIUM severity: TRST-BaseV1Pair could break because of overflow. **Description:** In the function _update(), called internally by `mint()`, `burn()` and `swap()`, the following code is executed: This is forked from UniswapV2 source code, and it’s meant and known to overflow. It works fine if solidity < 0.8.0 is use...
uint256 timeElapsed = blockTimestamp - blockTimestampLast; // overflow is desired if (timeElapsed > 0 && _reserve0 != 0 && _reserve1 != 0) { reserve0CumulativeLast += _reserve0 * timeElapsed; reserve1CumulativeLast += _reserve1 * timeElapsed; }
uint minOut = tokenInPrice.multiplyDecimal(marketPricingParams[_optionMarket].minReturnPercent) .multiplyDecimal(_amountBase) .divideDecimal(tokenOutPrice);
same_firm_diff_protocol
Solodit
MEDIUM
2
84
HIGH severity: One side players have more probability of winning than the other.. **Severity**: High **Status**: Resolved **Description** In the `UpDown` game, players can bet that an asset’s price will be up or down compared to the current price. If the price is up, players that voted for it will win and vice vers...
if (uint192(finalPrice / 1e14) > _game.startingPrice) { // @audit why / 1e14 ahora? uint256 finalRate = ITreasury(treasury).calculateUpDownRate( _game.totalDepositsDown, _game.totalDepositsUp, fee ); for (uint i = 0; i < UpPlayers.length; i++...
uint256 public constant MAX_WHITELISTED_TOKENS = 100; // Example maximum number
same_firm_diff_protocol
Solodit
HIGH
2
85
MEDIUM severity: In the event of a partial match inside \_convertMatchOrders, borrower funds will be over-allocated. **Details** [BloomPool.sol#L399-L403](https://github.com/Blueberryfi/bloom-v2/blob/87a60380331cc914be41ad57691f08b532a4d6fb/src/BloomPool.sol#L399-L403) if (lenderFunds == matches[index].lCollatera...
if (lenderFunds == matches[index].lCollateral) { matches.pop(); } else { matches[index].lCollateral -= uint128(lenderFunds); }
elif adapter.current > 0: withdraw : uint256 = min(target_withdraw_balance, adapter.current) target_withdraw_balance = target_withdraw_balance - withdraw adapter.delta = convert(withdraw, int256) * -1 if adapter.delta != 0: adapter_assets_allocated += convert(adapter.delta * -1, uint256) # TODO : eliminate adapter_...
same_firm_diff_protocol
Solodit
MEDIUM
2
86
HIGH severity: Unsafe external calls made during proportional LP fee transfers can be used to reenter wrapper contracts. **Description:** `ERC721WrapperBase` exposes two overloads of the `unwrap()` function to perform full and partial unwrap of the ERC-6909 position for a given `tokenId`. The partial unwrap is used to ...
function unwrap(address from, uint256 tokenId, address to, uint256 amount, bytes calldata extraData) external callThroughEVC { _unwrap(to, tokenId, amount, extraData); // @audit - native ETH/ERC-777 token can be used to reenter here _burnFrom(from, tokenId, amount); } /// @notice A modifier that ve...
function beforeHook( bytes calldata _terms, bytes calldata, ModeCode _mode, bytes calldata _executionCallData, bytes32 _delegationHash, address _delegator, address ) public override onlyBatchCallTypeMode(_mode) onlyDefaultExecut...
same_firm_diff_protocol
Solodit
HIGH
2
87
HIGH severity: `poolRewards` arrays can grow without bounds, resulting in DoS of core functionality. **Description:** The `poolRewards` mapping maintains an array of reward token addresses for a given `IncentivizedPoolId`. Given that the distribution of rewards is permissionless, anyone can invoke this functionality wi...
function _updateAllRewardState(IncentivizedPoolId id) internal virtual { address[] memory _tokens = poolRewards[id]; uint256 _length = _tokens.length; for (uint256 i; i < _length; i++) { _updateRewardState(id, _tokens[i], address(0)); } } function _updateAllUserState(IncentivizedPoolId id, addr...
// Calculate total distributed shares for the epoch uint256 totalDistributedShares = 0; // Sum operator shares address[] memory operators = l1Middleware.getAllOperators(); for (uint256 i = 0; i < operators.length; i++) { totalDistributedShares += operatorShares[epoch][operators[i]]; } // Sum vault shares address[...
same_firm_diff_protocol
Solodit
HIGH
2
88
LOW severity: [ZLS1-2] First Depositor Can Front-Run and Steal the Next User's Stake. **Severity:** High **Path:** contracts/ZEALInfinityPool.sol#L196-L197 contracts/ZEALInfinityPool.sol#L274-L287 **Description:** The `ZEALInfinityPool.stake()` function mints xZeal shares in exchange for Zeal tokens. The number of ...
1. currentRate = (totalStaked + totalRewards).mulDiv(PRECISION_FACTOR, xSupply); 2. xMint = _amount.mulDiv(PRECISION_FACTOR, currentRate); (X + 1 + X / 2) / 2 = (X / 2 + 1) + (X / 4 - 0.5) uint256 xMint = _amount.mulDiv(PRECISION_FACTOR, currentRate); require(xMint > 0, "Stake amount too small");
function setStalePriceDelay(uint _stalePriceDelay) external { // Check caller = admin if (msg.sender != admin) { revert("unauthorized"); } stalePriceDelay = _stalePriceDelay; }
same_firm_diff_protocol
Solodit
LOW
2
89
MEDIUM severity: Inconsistent decimal treatment for token amounts across codebase increases security risks for users interacting with Dexe DAO contracts. **Description:** Inconsistencies have been identified within the codebase regarding the assumed decimal format for token amounts. Some sections of the codebase assume...
function createTier( mapping(uint256 => ITokenSaleProposal.Tier) storage tiers, uint256 newTierId, ITokenSaleProposal.TierInitParams memory _tierInitParams ) external { _validateTierInitParams(_tierInitParams); uint256 saleTokenDecimals = _tierInitParams.saleTokenAddress.dec...
// NOTE: place in `Pump.Update.t.sol` function testTWAReservesIsWrong() public { increaseTime(12); // increase 12 seconds bytes memory startCumulativeReserves = pump.readCumulativeReserves( address(mWell) ); uint256 lastTimestamp = block.timestamp; increaseTime(120); // increase 120 seconds...
same_firm_diff_protocol
Solodit
MEDIUM
2
90
LOW severity: Refactor `SecuritizeBridge::bridgeDSTokens` and `quoteBridge` to use `internal` function saves 2 storage reads per bridging transaction. **Description:** `SecuritizeBridge::bridgeDSTokens`: * L71 calls `quoteBridge` which reads `wormholeRelayer` and `gasLimit` from storage * L91 calls `wormholeRelayer.sen...
// new internal function function _quoteBridge(IWormholeRelayer relayer, uint256 _gasLimit, uint16 targetChain) internal view returns (uint256 cost) { (cost, ) = relayer.quoteEVMDeliveryPrice(targetChain, 0, _gasLimit); } // modify `quoteBridge` to use new internal function function quoteBridge(uin...
SecuritizeRedemption.sol 77: function redeem(uint256 _amount) whenNotPaused external override { 78: uint256 rate = navProvider.rate(); 79: require(rate != 0, "Rate should be defined"); 80: require(asset.balanceOf(msg.sender) >= _amount, "Redeemer has not enough balance"); 81: require...
same_firm_diff_protocol
Solodit
LOW
2
91
LOW severity: `claimUnassignedAsset` `_percentage` can be more than 1e18. **Impact** https://github.com/blkswnStudio/ap/blob/8fab2b32b4f55efd92819bd1d0da9bed4b339e87/packages/contracts/contracts/BorrowerOperations.sol#L614-L620 Maybe abused for exploit, I haven't spent a lot of time on this, it's best to cap it to 1e...
function claimUnassignedAssets( uint _percentage, address _upperHint, address _lowerHint, bytes[] memory _priceUpdateData ) external payable override { if (_percentage == 0) revert ZeroDebtChange(); if (_percentage > DECIMAL_PRECISION) revert Above100Pct();
"CalldataList: End index eqauls start index only when 4"
same_firm_diff_protocol
Solodit
LOW
2
92
MEDIUM severity: Preventing Unauthorized ZKLP Token Creation. **Severity** : Medium **Status** : Resolved **Description** The `ZkdlpManager.sol:getAum` function, presents two primary issues: Denial of Service (DoS) Risk: The function iterates over all tokens listed in the `allWhitelistedTokens` array. If the govern...
function clearTokenConfig(address _token) external override { _onlyGov(); require(whitelistedTokens[_token], "Token not whitelisted"); totalTokenWeights = totalTokenWeights.sub(tokenWeights[_token]); // Properly removing the token from allWhitelistedTokens array for (uint i = 0; i < allWhitelis...
constructor( address _bridge, string memory _name, string memory _symbol, uint8 _decimals ) ERC20(_name, _symbol) { if (_bridge == address(0)) { revert InvalidBridge(); } BRIDGE = _bridge; TOKEN_DECIMALS = _decimals; } function setBridge(addres...
same_firm_diff_protocol
Solodit
MEDIUM
2
93
MEDIUM severity: Insecure Generation of Randomness Used for Token Determination Logic. **Severity** Medium Risk **Description** `EmissionLogic.sol` contains the `determineTokenByLogic()` function that determines the rarity and `tokenId` of a `MaterialObject`. It generates a `uint256 random` value that relies on vari...
uint256 random = uint256(keccak256(abi.encodePacked(block.prevrandao, block.timestamp, tx.origin)));
referralRewards[gameId][Registry(registry).referrers(player)] += pool.ticketPrice * REFERRER_FEE;
random
Solodit
MEDIUM
2
94
HIGH severity: Reserve-weighted allocations use spot reserves. **Finding (Low): Reserve-weighted allocation uses spot reserves → price-manipulable** **Description:** [`L2RevenueDistributorV3::_computeReserveUnits`](https://github.com/0xKaizenLabs/staking-contracts-v3/blob/c78653ed5f2e5a6d5ace13c303a8765fe30679b0/src/L...
IAerodromePair pair = IAerodromePair(pairAddr); (uint256 r0, uint256 r1,) = pair.getReserves(); address t0 = pair.token0(); address t1 = pair.token1(); uint256 ilvReserve = t0 == address(ilv) ? r0 : (t1 == address(ilv) ? r1 : 0); // Extend the pair interface as needed for your Aerodrome build. interface IAerodromePair...
function _exit() internal { IInfraredVault vault = registry().iBgtStakingVault(); IInfraredVault.UserReward[] memory rewards = vault.getAllRewardsForUser(address(this)); vault.exit(); _handleRewards(rewards); } function _handleRewards(IInfraredVault.UserReward[] memory _rewards) internal { IIsola...
same_firm_diff_protocol
Solodit
HIGH
2
95
LOW severity: Issuer can underpay for AMKT because values are rounded down. When `issue()` is called to mint new `AMKT`, we calculate the `underlyingAmount` of each asset to be deposited by multiplying the real units (nominal units discounted for fees) by the amount of `AMKT` that is being minted. All multiplication v...
uint256 underlyingAmount = fmul(tokens[i].units, amount); function issue(uint256 amount) external { vault.tryInflation(); TokenInfo[] memory tokens = vault.realUnits(); // nominal[asset] * multiplier for (uint256 i; i < tokens.length; ) { - uint256 underlyingAmount = fmul(tokens[i].units, amount); +...
function castRefundableVoteInternal( uint256 proposalId, uint8 support, string memory reason ) internal { uint256 startGas = gasleft(); uint96 votes = castVoteInternal(msg.sender, proposalId, support); emit VoteCast(msg.sender, proposalId, support, votes, reason); if (votes > 0) { _r...
same_firm_diff_protocol
Solodit
LOW
2
96
LOW severity: `LiquidationsOperations` Comment around `_emitLiquidationSummaryEvent` is incorrect. **Impact** `_emitLiquidationSummaryEvent` has the following comment https://github.com/blkswnStudio/ap/blob/8fab2b32b4f55efd92819bd1d0da9bed4b339e87/packages/contracts/contracts/LiquidationOperations.sol#L447-L455 The c...
function _emitLiquidationSummaryEvent(LocalVariables_OuterLiquidationFunction memory vars) internal { TokenAmount[] memory liquidatedColl = new TokenAmount[](vars.priceCache.collPrices.length); for (uint i = 0; i < vars.priceCache.collPrices.length; i++) { liquidatedColl[i] = TokenAmount( vars.pri...
/// Refund receiver and gas params are not checked because the Safe itself /// does not hold funds or tokens.
same_firm_diff_protocol
Solodit
LOW
2
97
LOW severity: `removeCalldataCheckDatahash` could mistakenly remove a wildcard check if the wildcard check is added with an empty `dataHash`. **Impact** `_addCalldataCheck` doesn't enforce that a wildcard check has no `dataHashes` https://github.com/solidity-labs-io/kleidi/blob/1a06ac16bc99d0b4081281329d03064c3737f5e...
function _addCalldataCheck( address contractAddress, bytes4 selector, uint16 startIndex, uint16 endIndex, bytes[] memory data, bool[] memory isSelfAddressCheck ) private { require( contractAddress != address(0), "CalldataList: Address c...
// Apply upfront fee on premature adjustments if ( batch.annualInterestRate != _newAnnualInterestRate && block.timestamp < batch.lastInterestRateAdjTime + INTEREST_RATE_ADJ_COOLDOWN ) { uint256 price = _requireOraclesLive(); uint256 avgInterestRate = ...
same_firm_diff_protocol
Solodit
LOW
2
98
MEDIUM severity: Inconsistent CVI value handling during the deposit in `MegaThetaVault` contract. **Severity**: Medium **Status**: Resolved **Description** The `depositForOwner` function in the `MegaThetaVault` contract takes the `_realTimeCVIValue` as a parameter and assigns it to balanceCVIValue. The function then...
function depositForOwner(address _owner, uint168 _tokenAmount, uint32 _realTimeCVIValue) external override returns (uint256 thetaTokensMinted) { require(msg.sender == fulfiller); uint32 balanceCVIValue = _realTimeCVIValue; if (_realTimeCVIValue < balanceCVIValue) { balanceCVIValue = _r...
// If _utilization between kink1 and kink2, rates are flat if (_interestRate.kink1 < _utilization && _utilization <= _interestRate.kink2) { return _interestRate.baseRate + (_interestRate.kink1 * _interestRate.multiplier / SAFE_MULTIPLIER); } // If _utilization below kink1, calculate borrow rate for slope ...
same_firm_diff_protocol
Solodit
MEDIUM
2
99