DittoETH

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

Unsafe downcast

Summary

Unsafe downcast

Vulnerability Details

When a type is downcast to a smaller type, the higher-order bits are truncated, effectively applying a modulo to the original value. Without any other checks, this wrapping will lead to unexpected behavior and bugs

File: contracts/facets/OwnerFacet.sol
//@audit `vault` is getting converted from `uint256` to `uint8`
281: s.bridge[bridge].vault = uint8(vault);

Link to code

File: contracts/libraries/LibOracle.sol
//@audit `oraclePrice` is getting converted from `uint256` to `uint80`
136: s.bids[asset][Constants.HEAD].ercAmount = uint80(oraclePrice);

Link to code

Impact

Possible overflows

Tools Used

Manual

Recommendations

Check the values before/after performing the cast

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.