UNPKG

@neo-one/smart-contract-compiler

Version:

NEO•ONE TypeScript smart contract compiler.

20 lines (18 loc) 746 B
import { GlobalProperty } from '../../constants'; import { Helper } from '../Helper'; export class InvocationIsCallerHelper extends Helper { emit(sb, node, optionsIn) { if (!optionsIn.pushValue) { return; } const options = sb.pushValueOptions(optionsIn); sb.emitHelper(node, options, sb.helpers.getGlobalProperty({ property: GlobalProperty.CallingScriptHash })); sb.emitSysCall(node, 'System.ExecutionEngine.GetEntryScriptHash'); sb.emitOp(node, 'EQUAL'); sb.emitSysCall(node, 'Neo.Runtime.GetTrigger'); sb.emitPushInt(node, 0x00); sb.emitOp(node, 'NUMEQUAL'); sb.emitOp(node, 'BOOLOR'); } } //# sourceMappingURL=InvocationIsCallerHelper.js.map