UNPKG

@neo-one/smart-contract-compiler

Version:

NEO•ONE TypeScript smart contract compiler.

28 lines (26 loc) 978 B
import { GlobalProperty } from '../../constants'; import { Helper } from '../Helper'; export class CreateGlobalObjectHelper extends Helper { emit(sb, node, optionsIn) { sb.emitOp(node, 'DEPTH'); sb.emitOp(node, 'PACK'); sb.emitOp(node, 'NEWMAP'); sb.emitOp(node, 'TUCK'); sb.emitPushInt(node, GlobalProperty.Arguments); sb.emitOp(node, 'ROT'); sb.emitOp(node, 'SETITEM'); sb.emitOp(node, 'DUP'); sb.emitPushInt(node, GlobalProperty.Modules); sb.emitPushInt(node, 0); sb.emitOp(node, 'NEWARRAY'); sb.emitOp(node, 'SETITEM'); sb.emitOp(node, 'DUP'); sb.emitPushInt(node, GlobalProperty.CallingScriptHash); sb.emitSysCall(node, 'System.ExecutionEngine.GetCallingScriptHash'); sb.emitOp(node, 'SETITEM'); if (!optionsIn.pushValue) { sb.emitOp(node, 'DROP'); } } } //# sourceMappingURL=CreateGlobalObjectHelper.js.map