neo_solidity/cli/bytecode/bytecode_builtins/builtin_call/
abi.rs1fn emit_abi_encode(
2 bytecode: &mut Vec<u8>,
3 arg_count: usize,
4 use_callt: bool,
5 token_patches: &mut Vec<MethodTokenPatch>,
6) {
7 let total_bigint = BigInt::from(arg_count);
8 push_integer_bigint(bytecode, &total_bigint);
9 bytecode.push(0xC0); if arg_count > 1 {
13 bytecode.push(0x4A); bytecode.push(0xD1); }
16 emit_native_contract_call(
17 bytecode,
18 ir::NativeContract::StdLib,
19 "serialize",
20 1,
21 use_callt,
22 token_patches,
23 );
24}
25
26fn emit_abi_decode(
27 bytecode: &mut Vec<u8>,
28 use_callt: bool,
29 token_patches: &mut Vec<MethodTokenPatch>,
30) {
31 emit_native_contract_call(
32 bytecode,
33 ir::NativeContract::StdLib,
34 "deserialize",
35 1,
36 use_callt,
37 token_patches,
38 );
39}
40
41fn emit_notify_serialized(
42 bytecode: &mut Vec<u8>,
43 use_callt: bool,
44 token_patches: &mut Vec<MethodTokenPatch>,
45) {
46 emit_native_contract_call(
48 bytecode,
49 ir::NativeContract::StdLib,
50 "deserialize",
51 1,
52 use_callt,
53 token_patches,
54 );
55 bytecode.push(0x4A); bytecode.push(0x10); bytecode.push(0xCE); bytecode.push(0x50); bytecode.push(0x4A); bytecode.push(0x11); bytecode.push(0xCE); bytecode.push(0x46); bytecode.push(0x50); emit_syscall(bytecode, "System.Runtime.Notify");
66 bytecode.push(0x11); }