DittoETH

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

Use of `assert()`

Summary

Hitting an assert() creates an error of type Panic(uint256) and consumes the remainder of the transaction's available gas rather than returning it, as require()/revert() do. Per the Solidity documentation, "Assert should only be used to test for internal errors, and to check invariants. Properly functioning code should never create a Panic, not even on invalid external input.".

Vulnerability Details

There are 3 instances of this issue.

File: contracts/bridges/BridgeReth.sol
106: assert(sent);
File Link Instance Count Instance Link
BridgeReth.sol 1 106

File: contracts/facets/MarginCallSecondaryFacet.sol
87: assert(tokenContract.balanceOf(msg.sender) < walletBalance);
File Link Instance Count Instance Link
MarginCallSecondaryFacet.sol 1 87

File: contracts/libraries/LibAsset.sol
16: assert(tokenContract.balanceOf(msg.sender) < walletBalance);
File Link Instance Count Instance Link
LibAsset.sol 1 16

Impact

Loss of a transaction's available gas.

Tools Used

baudit: a custom static code analysis tool; manual review

Recommendations

Use require() rather than assert().

Updates

Lead Judging Commences

0xnevi Lead Judge
almost 2 years ago
0xnevi Lead Judge almost 2 years ago
Submission Judgement Published
Invalidated
Reason: Gas optimizations

Support

FAQs

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