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

Function generateIsNullFunction

src/code-gen/functions.ts:44–66  ·  view source on GitHub ↗
(struct: AbiStruct)

Source from the content-addressed store, hash-verified

42}
43
44export const generateIsNullFunction = (struct: AbiStruct): CodeGenFunction => {
45 const defaultName = `Default${struct.name}`;
46 const body = [
47 `_isNull = equals(a, ${defaultName});`
48 ]
49 return {
50 internalType: 'comparison',
51 name: 'isNull',
52 location: 'internal',
53 visibility: 'pure',
54 inputFields: [],
55 outputFields: [],
56 inputs: [
57 { type: struct, name: 'a', definition: `${struct.name} a`, },
58 ],
59 outputs: [{
60 type: elementaryToTypeDef('bool'),
61 name: '_isNull',
62 definition: `bool _isNull`,
63 }],
64 body
65 }
66}
67
68export const generateEqualityFunction = (struct: AbiStruct): CodeGenFunction => {
69 const body = buildAssemblyBlock([

Callers 1

Calls 1

elementaryToTypeDefFunction · 0.90

Tested by

no test coverage detected