The contract does not check the return value of a low-level call, so if the call fails, Ether can become locked in the contract. An attacker could cause this by setting the intermediate token to a contract that fails when wrapping the Ether amount.
The joinTokenSingle function in SingleTokenJoin.sol and SingleTokenJoinV2.sol compares the contract's token balance to the user's expected output amount and reverts if they are unequal. An attacker can send a small amount of the basket's token to the contract, causing all subsequent joinTokenSingle calls to fail with 'FAILED_OUTPUT_AMOUNT'.
The SingleTokenJoinV2 contract only refunds leftover input tokens, not leftover underlying basket tokens, so users lose funds when the required basket token amounts decrease. An attacker can steal these leftover tokens by calling joinTokenSingle with fake outputBasket and swap.exchange contracts.
The annualized fee charged by the contract compounds based on how often the fee-charging function is called. An attacker could call the function frequently to increase the effective APY, or less frequently to decrease it, affecting the fee amount.
The joinPool function checks the maximum cap using only the base amount, ignoring the fee that is also minted to the fee beneficiary. An attacker could mint tokens beyond the intended maxCap by joining the pool when fees are enabled.
The contract does not check the boolean return value of ERC20 transfer and transferFrom calls. Tokens that return false instead of reverting could leave tokens stuck in the contract, potentially allowing someone else to steal them.
The `_call` function uses a low-level call and only checks the success flag, which can be true even if the target account does not exist. An attacker could cause ether to become stuck in the contract by interacting with a deleted contract.
The ERC20Facet contract's initialization status is determined by its name and symbol strings. An attacker could set these to empty strings, effectively uninitializing the contract and allowing the initialize function to be called again, enabling them to mint unlimited tokens or hide minting.
Some functions use block.timestamp as the deadline for token swaps instead of the deadline field provided in the input struct. An attacker could exploit this by delaying transactions to get unfavourable swap rates, as the deadline check is ineffective.
The fee calculation mints new tokens to the fee beneficiary based on the pre-mint total supply, which dilutes the beneficiary's share and results in them receiving less value than intended. An attacker could not directly exploit this, but the fee beneficiary receives less than the calculated fee.
The contract assumes the output token is the last token in the first exchange's trades, so users cannot exit to a different token via multiple exchanges. An attacker could not exploit this directly, but it breaks the intended exit functionality.
AC
Amun 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.