MCPcopy Create free account
hub / github.com/d1ll0n/stack-packer / shouldCheckForOverflow

Function shouldCheckForOverflow

src/code-gen/fields.ts:122–126  ·  view source on GitHub ↗
(field: AbiStructField)

Source from the content-addressed store, hash-verified

120)
121
122export const shouldCheckForOverflow = (field: AbiStructField): boolean => {
123 if (field.coderType === 'unchecked' || field.coderType === 'exact' || !(uintAllowed(field.type) || intAllowed(field.type))) return false;
124 // Check for overflow if type size is not divisible by 8
125 return field.coderType === 'checked' || field.type.size % 8 > 0;
126}
127
128export const getParameterDefinition = (field: AbiStructField) => {
129 // If field is not a uint or enum, or `exact` is true, use real type

Callers 3

getOverflowCheckFunction · 0.90

Calls 2

uintAllowedFunction · 0.85
intAllowedFunction · 0.85

Tested by

no test coverage detected