OrderBook

First Flight #43
Beginner FriendlySolidity
100 EXP
View results
Submission Details
Impact: low
Likelihood: low
Invalid

Unnecessary Use of Strings Utility Library, Increases Bytecode of the Contract

# Unnecessary Use of Strings Utility Library, Increases Bytecode of the Contract
## Description
The `Strings` utility is imported and used solely for the `getOrderDetailsString()` function, which is an off-chain utility. Including the entire `Strings` library increases bytecode size and gas usage during deployment, unnecessarily.
```solidity
import {Strings} from "@openzeppelin/contracts/utils/Strings.sol";
```
## Risk
**Likelihood:**
* Always present at compile/deployment time
**Impact:**
* Increased bytecode size
* Higher deployment cost
## Proof of Concept
Remove `getOrderDetailsString()` and the `Strings` import — observe reduced bytecode size.
## Recommended Mitigation
Consider moving the logic off-chain (via The Graph or frontend rendering), or keep it in a separate view-only helper contract.
```diff
- import {Strings} from "@openzeppelin/contracts/utils/Strings.sol";
```
Updates

Lead Judging Commences

yeahchibyke Lead Judge 10 days ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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