The removeAddress function used delete instead of properly removing an array element, leaving a zero address in the array. This could cause a denial of service because the contract would later try to call canBatchContracts on address(0).
The transferFrom function checks only the allowance, not the actual credit balance, so a user could transfer more than their credit balance and cause an underflow in the subtraction. This could allow the attacker to create credits out of thin air or break the contract's accounting.
The burn function allows any address with the MINTER_BURNER_ROLE to burn tokens from any other address, not just its own. A malicious or compromised holder of that role could destroy arbitrary amounts of tokens belonging to any user.
The stake function calls rebase before depositing, allowing a user to deposit just before a rebase and then instantly unstake to capture rewards without burning the yield token. This can increase the profit distributed on the next rebase and disrupt rewards for other holders.
A smart contract allows only one withdrawal request per cycle, so withdrawals initiated after the request but before the cycle ends are recorded but not actually processed. This causes a mismatch between tokens withdrawn and tokens users are allowed to withdraw, meaning some eligible users cannot withdraw due to insufficient tokens.
The Staking contract allows the owner to change the CURVE_POOL address, but token approvals are only set in the constructor, so the new pool cannot spend tokens. All calls to exchange() on the new pool will fail.
The staking contract records the token balance after a safe transfer, which can be lower than the amount actually staked if the token charges a transfer fee. An attacker could exploit this to cause an inconsistent accounting of staked balances.
When a rebase would push the total supply above the maximum, the code caps the supply but still passes the full profit to the rebase storage function, so the rebase percentage is calculated on an amount that was not fully applied. This could misreport the rebase percentage, though the maximum supply is so large it is unlikely to be reached.
The contracts stake and addLiquidity functions transfer tokens from the user and assume the full amount is received, but if the token is deflationary (charges a fee on transfer), the contract receives less than the requested amount while still minting or crediting the full amount to the user. This can cause other stakers to lose funds because the user receives more than they contributed.
A user can prevent others from withdrawing liquidity from the LiquidityReserve by making a small instant unstake that sets a non-zero cooldown amount, causing the unstakeAllRewardTokens function to skip unstaking. This can lock funds until the cooldown expires or the contract is paused.
The addLiquidity function calculates minted shares using a ratio that can be inflated by sending tokens directly to the contract, causing later depositors to receive fewer shares due to rounding. An attacker could manipulate this ratio to make users lose funds, though the benefit to the attacker is unclear.
The withdrawal function calculated a capped amount but then requested the uncapped amount from the Tokemak pool, so when the balance was lower than the requested amount, the contract asked to withdraw more than it held. An attacker could trigger this to request an excessive withdrawal, potentially causing a failure or draining more than intended.
The preSign function accepts any orderUid without validating its contents, so the owner could sign an order with an arbitrary receiver and other parameters. This could act as a rug vector, allowing the owner to redirect funds or set unfavourable terms.
The staking contract's constructor did not check that the first epoch end time was in the future, so a very low or zero value could be passed. An attacker could then call rebase repeatedly to push the epoch number forward and bypass the warm-up and cool-down waiting periods before claiming or withdrawing.
The instantUnstake fee calculation rounds down, allowing users to avoid the fee by unstaking small amounts in a loop. An attacker could unstake tokens without paying the liquidity provider fee, though only in small increments per call.
The unstake function allowed users to skip the rebase call, leaving the epoch number stale. An attacker could then initiate a withdrawal that was recorded in the previous epoch, letting them withdraw funds earlier than intended.
The transferFrom function does not check if the recipient address is the zero address, allowing tokens to be burned without calling the burn function. This bypasses the access control that restricts burning to the MINTER_BURNER_ROLE.
The smart contract's minting function uses a strict less-than check against the maximum supply, so it reverts when the total supply equals the max. An attacker could not exploit this; it is a functional bug that prevents minting the final token.
The contract lacks a check to ensure that after a liquidity provider withdraws, the remaining liquidity stays above the MINIMUM_LIQUIDITY threshold. A large liquidity provider could remove all their funds, leaving the pool below the required minimum, which the report says is incorrect.
The withdraw function of the ETH Tokemak pool has an extra parameter asEth, unlike other pools, so when the staking token is ETH/WETH, withdrawals are impossible and funds become locked.
The stake function allows anyone to specify an arbitrary recipient, and when the warm-up period is greater than zero, a tiny deposit resets the recipient's warm-up expiry. An attacker could repeatedly push back the expiry for any user, preventing them from claiming their staked tokens.
The yield from LiquidityReserve is distributed instantly when a user calls instantUnstakeReserve, and liquidity can be added and removed without penalty. An attacker could sandwich the user's call by adding liquidity before and removing it after, thereby capturing most of the fee that would otherwise go to existing liquidity providers.
The Staking contract's rebase function calls Yieldy.rebase with a profit derived from the contract's token balance, and if the ratio of rebasing credits to updated total supply becomes zero the call reverts. An attacker could send tokens directly to the Staking contract to make that ratio zero, causing most Staking functions to revert, or make it very low so rounding errors lose user funds.
The contract's batch functions iterate over an unbounded array of contracts, so if many contracts are pending withdrawal the loop can run out of gas and the transaction fails. An attacker could add many contracts to make the function unusable.
A user can stake just before an epoch ends, bypassing the forced rebase in the stake function, then immediately unstake in the next block to collect the rebase rewards without staying staked. This allows the user to get in, collect the rebase, and get out with minimal token downtime.
The migration function calls instantUnstake with the rebase flag set to false, so any pending rebase is skipped. A user migrating funds at that moment would forfeit the rewards from that pending rebase.
The batch withdrawal function loops over an unbounded list of contracts, so if many contracts are added, the transaction can exceed the block gas limit and fail. An attacker could potentially cause a denial of service by making the list too large, though only the owner can add contracts.
The contract's rebase function passed the updated total supply to an internal event-storing function instead of the previous circulating supply. As a result, the emitted rebase event recorded the wrong previous value, so the event data did not reflect the actual change.
The rebase function in the staking contract applies the current epoch's reward distribution before recalculating it, so the rewards used for an epoch are stale. This can cause rewards to be updated incorrectly and lead to an incorrect distribution of user rewards.
YC
Yieldy contest
Medium
Instant results are busy. Press Enter to search every report.
No direct matches. Search every report above, or try a bug class like IDOR or SSRF.