40,000 USDC
View results
Submission Details
Severity: gas

Use `bytes.concat()` on bytes instead of `abi.encodePacked()`

Summary

Starting with version 0.8.4, Solidity has the bytes.concat function which can concatenate an arbitrary number of bytes or bytes1 ... bytes32 values. The function returns a single bytes memory array that contains the contents of the arguments without padding. See The functions bytes.concat and string.concat.

Vulnerability Details

There is 1 instance of this issue.

File: src/EscrowFactory.sol
76: abi.encodePacked(
77: byteCode, abi.encode(price, tokenContract, buyer, seller, arbiter, arbiterFee)
78: )
File Link Instance Count Instance Link
EscrowFactory.sol 1 76

Impact

Decreased readability/maintainability of project source code.

Tools Used

baudit: a custom static code analysis tool; manual review

Recommendations

For clearer semantics, when concatenating bytes, use bytes.concat() rather than abi.encodePacked().

Support

FAQs

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