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

Function getParameterDefinition

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

Source from the content-addressed store, hash-verified

126}
127
128export const getParameterDefinition = (field: AbiStructField) => {
129 // If field is not a uint or enum, or `exact` is true, use real type
130 // otherwise, use uint256
131 const typeUsed = field.coderType === 'exact'
132 ? toTypeName(field.type, true)
133 : uintAllowed(field.type)
134 ? 'uint256'
135 : intAllowed(field.type)
136 ? 'int256'
137 : toTypeName(field.type)
138
139/* (
140 (field.coderType === 'exact') || !uintAllowed(field.type)
141 ) ? toTypeName(field.type, true) : 'uint256'; */
142
143 return `${typeUsed} ${field.name}`
144}
145
146const getMaxUintForField = (field: AbiStructField) => {
147 const name = field.type.meta === 'elementary' && field.type.type === 'int'

Callers 2

applyCoderTypeFunction · 0.85
processFieldsFunction · 0.85

Calls 3

toTypeNameFunction · 0.85
uintAllowedFunction · 0.85
intAllowedFunction · 0.85

Tested by

no test coverage detected