You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
103289PUSHINT// owner_addr c7 md mc args get_jwa_method_id"
73
73
50REVERSE// owner_addr get_jwa_method_id args mc md c7"
74
-
53RUNVM// address exit_code c4' c5'"
75
-
//TODO check RUNVM exit code
76
-
3BLKDROP// address";
74
+
ONE2-ROLL// Moves the top stack value (ONE) to the third position: [A, B, C] -> [B, C, A]. We expect only 1 return value. Flag +256 for runvm enables this argument
75
+
// Here is the full list of modes of RUNVM
76
+
// +1 = same_c3 (set c3 to code)
77
+
// +2 = push_0 (push an implicit 0 before running the code); only works with +1 enabled
78
+
// +4 = load c4 (persistent data) from stack and return its final value
79
+
// +8 = load gas limit from stack and return consumed gas
80
+
// +16 = load c7 (smart-contract context)
81
+
// +32 = return c5 (actions)
82
+
// +64 = pop hard gas limit (enabled by ACCEPT) from stack as well
83
+
// +128 = isolated gas consumption (separate set of visited cells, reset CHKSIGNU counter)
84
+
// +256 = pop number N, return exactly N values from stack (only if res=0 or 1; if not enough then res=stk_und)
85
+
//
86
+
// We use only +1 +4 +16 +256 = 277
87
+
// Mode 256 is crucial, because it ignores all stack values except the first one, and protects us from stack poisoning
0 commit comments