Severity: Low
Confidence: High
When a type is downcast to a smaller type, the higher-order bits are truncated, effectively applying a modulo operation to the original value. This can introduce vulnerabilities and cause the program to behave unexpectedly.
If you intend to perform an unchecked modulo operation, it is advisable to use the syntax uncheck{ x % y}. This not only makes the code clearer but also helps prevent potential bugs and ensures the intended behavior of the operation.
usafe downcast size from - 256 to size 88
https://github.com/Cyfrin/2023-09-ditto/blob/main/contracts/facets/BridgeRouterFacet.sol#L53
usafe downcast size from - 256 to size 88
https://github.com/Cyfrin/2023-09-ditto/blob/main/contracts/facets/BridgeRouterFacet.sol#L82
usafe downcast size from - 256 to size 40
https://github.com/Cyfrin/2023-09-ditto/blob/main/contracts/facets/ERC721Facet.sol#L162
usafe downcast size from - 256 to size 88
https://github.com/Cyfrin/2023-09-ditto/blob/main/contracts/facets/MarginCallPrimaryFacet.sol#L252
usafe downcast size from - 256 to size 88
usafe downcast size from - 256 to size 88
https://github.com/Cyfrin/2023-09-ditto/blob/main/contracts/facets/MarginCallPrimaryFacet.sol#L284
usafe downcast size from - 256 to size 88
https://github.com/Cyfrin/2023-09-ditto/blob/main/contracts/facets/MarginCallSecondaryFacet.sol#L192
usafe downcast size from - 256 to size 8
https://github.com/Cyfrin/2023-09-ditto/blob/main/contracts/facets/OwnerFacet.sol#L55
usafe downcast size from - 256 to size 80
https://github.com/Cyfrin/2023-09-ditto/blob/main/contracts/facets/OwnerFacet.sol#L68
usafe downcast size from - 256 to size 8
https://github.com/Cyfrin/2023-09-ditto/blob/main/contracts/facets/OwnerFacet.sol#L281
usafe downcast size from - 256 to size 80
https://github.com/Cyfrin/2023-09-ditto/blob/main/contracts/facets/YieldFacet.sol#L142
usafe downcast size from - 256 to size 16
https://github.com/Cyfrin/2023-09-ditto/blob/main/contracts/facets/YieldFacet.sol#L170
usafe downcast size from - 256 to size 96
https://github.com/Cyfrin/2023-09-ditto/blob/main/contracts/facets/YieldFacet.sol#L175
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.