Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/rules/gas-consumption/gas-small-strings.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ class GasSmallStrings extends BaseChecker {

isStringLargerThan32Bytes(inputString) {
if (inputString.startsWith('0x') && inputString.length === 42) {
// Check if the input is a valid Ethereum address
// Exempt 42-character strings starting with '0x' without validating hex digits or checksum
return false
} else {
// Convert the string to Buffer and get its byte length
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/gas-consumption/gas-struct-packing.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class GasStructPacking extends BaseChecker {
// calculateCurrentSlotsUsed
const currentSlots = this.calculateCurrentSlotsUsed(members)

// calculate optimal slots by rounding up the total size of members in descending order
// Estimate improved packing by sorting members by descending size and simulating slot usage
const sortedMembers = [...members].sort((a, b) => b.size - a.size)
const optimalSlots = this.calculateCurrentSlotsUsed(sortedMembers)

Expand Down