DittoETH

Ditto
DeFiFoundryOracle
55,000 USDC
View results
Submission Details
Severity: low
Invalid

Zero-value transfers may revert

Zero-value transfers may revert

  • Severity: LOW

  • Confidence: High

Description

This detector identifies instances where zero-valued ERC20 token transfers are made. Even though EIP-20 states that zero-valued transfers must be treated as normal transfers and events must be triggered, some tokens may revert if this is attempted, which can cause transactions that involve other tokens (such as batch operations) to fully revert. Therefore, it may be safer and more gas-efficient to skip the transfer if the amount is zero.

There are 4 instances of this issue:

File: contracts/bridges/BridgeReth.sol
64 rocketETHToken.transferFrom(from, address(this), amount)

This variable might be zero: amount

https://github.com/Cyfrin/2023-09-ditto/blob/main/contracts/bridges/BridgeReth.sol#L64

File: contracts/bridges/BridgeReth.sol
94 rocketETHToken.transfer(to, rethValue)

This variable might be zero: rethValue

https://github.com/Cyfrin/2023-09-ditto/blob/main/contracts/bridges/BridgeReth.sol#L94

File: contracts/bridges/BridgeSteth.sol
66 steth.transferFrom(from, address(this), amount)

This variable might be zero: amount

https://github.com/Cyfrin/2023-09-ditto/blob/main/contracts/bridges/BridgeSteth.sol#L66

File: contracts/bridges/BridgeSteth.sol
87 steth.transfer(to, amount)

This variable might be zero: amount

https://github.com/Cyfrin/2023-09-ditto/blob/main/contracts/bridges/BridgeSteth.sol#L87

Updates

Lead Judging Commences

0xnevi Lead Judge
over 1 year ago
0xnevi Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Other

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.