Skip to main content
Version: 11.x

Function: isNoConstructorValid()

isNoConstructorValid(method, argsCalldata, abiMethod?): boolean

Defined in: src/utils/calldata/parser/index.ts:120

Checks a constructor call to a contract that has no constructor in its abi: it is valid only with an empty calldata, an empty array or an empty object.

Parameters​

method​

string

argsCalldata​

RawArgs

abiMethod?​

FunctionAbi

Returns​

boolean

boolean

Example​

const result1 = isNoConstructorValid('constructor', [])
// result1 === true
const result2 = isNoConstructorValid('test', ['test'])
// result2 === false
const result3 = isNoConstructorValid('constructor', { a: 1 })
// result3 === false