Skip to content
$1,000,000 in security audit grants are live now, Apply here →

Security review · December 2024

USD0 Updates

for Abracadabra Money

Guardian's review of USD0 Updates for Abracadabra Money, published December 2024. The report records 4 findings, including 1 high and 1 medium.

Published
Review window
December 22 to 28, 2024
Language
Solidity
Chains
Ethereum
Sector
Lending, Stablecoins
  • 0 Critical
  • 1 High
  • 1 Medium
  • 2 Low
  • 0 Informational

3 resolved · 1 acknowledged

Findings 4

  1. H-01 High Swapped Funds Are Trapped In The Router Resolved
    Location
    MagicUSD0ppHarvester.sol

    Description

    In the run function the reward tokens are transferred to the router address instead of approving the router address and allowing the router to transferFrom the harvester contract. The Odos router is planned to be used, based upon deploy scripts, and attempts to transferFrom the caller instead of relying on the router contract balance, thus any funds sent to the Odos router would be trapped. As long as a nonzero amountOut is specified and the asset balance of the harvester is zero then this swap will simply fail rendering the harvester incapable of performing harvest actions.

    Recommendation

    Include optionality for whether to transfer funds to the router address or to approve the router address in the run function.

  2. M-01 Medium Harvest Extractable Value Sandwhich Attack Acknowledged
    Location
    MagicUSD0pp.sol

    Description

    The Harvester run function calls distribute rewards on the MagicUSD0pp vault which immediately increases the value of the MagicUsd0++ shares. Given the vault exists on ethereum mainnet this value increase may be arbitraged by an actor observing the mempool for a large harvest. The attacker may deposit directly before and withdraw directly after the share value increase for risk free gain.

    Recommendation

    Consider introducing a deposit/withdrawal fee to ensure that a reasonable sized harvest cannot be profitably arbitraged. Otherwise consider adding logic such that the harvested rewards are distributed to the vault over time to avoid stepwise jumps in share value.

  3. L-01 Low Events Emitted On No Update Events Resolved
    Location
    MagicUsd0ppHarvester.sol

    Description

    In the setAllowedRouter and setFeeParameters functions events are emitted indicating that a configuration change has taken place even when the configurations have not changed.

    Recommendation

    Be aware of this behavior and consider reverting/not emitting these events when the new configurations are the same as the existing configurations.

  4. L-02 Low Ownership Not Transferred In Deploy Script Warning Resolved
    Location
    MagicUsd0pp.s.sol

    Description

    In MagicUsd0pp.s.sol script the ownership of the vault is transferred to the safe.ops toolkit address, however the ownership for the harvester contract is left with the EOA executing the script.

    Recommendation

    Consider transferring the harvester ownership to the safe.ops address in the toolkit at the end of the deploy script.

More from Abracadabra Money

All 19 reports
  1. MagicGLP Upgrade

    11 findings1 high 11 findings: 1 high, 10 low
  2. PurrSwap Aerodrome

    105 findings9 high 105 findings: 9 high, 23 medium, 45 low, 28 informational
  3. PurrSwap ve33

    74 findings5 critical · 10 high 74 findings: 5 critical, 10 high, 20 medium, 39 low
  4. Hyperliquid OFT Deployment

    3 findings 3 findings: 1 low, 2 informational

Put your code through the same review.

This review started with a conversation about scope. Tell us what you are building and we will plan yours with you.

Get a quote