@@ -148,14 +148,14 @@ and compile_public_function ?(response_only=false) features env index (name, _,
148148 else compile_body_with_any_return
149149 in
150150 let body = compile_body body |> List. concat in
151- let postlude = [ (* (ok ...) or (err ...) expected on top of stack *)
152- EVM. zero; (* offset = memory address 0 *)
153- EVM. MSTORE ; (* MSTORE offset, value *)
154- EVM. from_int 0x20 ; (* length = 256 bits *)
155- EVM. zero; (* offset = memory address 0 *)
156- EVM. RETURN ; (* RETURN offset, length * )
157- EVM. STOP ; (* redundant, but a good marker for EOF *)
158- ] in
151+ let postlude = (* (ok ...) or (err ...) expected on top of stack *)
152+ [
153+ EVM. zero ; (* offset = memory address 0 *)
154+ EVM. MSTORE ; (* MSTORE offset, value *)
155+ ]
156+ @ EVM. return' ( 0 , 32 )
157+ @ EVM. stop (* redundant, but a good marker for EOF *)
158+ in
159159 (1 + index, prelude @ body @ postlude)
160160
161161and compile_private_function _features env index (_ , _ , body ) =
@@ -295,7 +295,7 @@ and compile_expression env = function
295295 | UnwrapPanic input ->
296296 let input = compile_expression env input in
297297 input @ compile_branch [EVM. DUP 1 ; EVM. ISZERO ]
298- [ EVM. POP ; EVM. zero; EVM. zero; EVM. REVERT ]
298+ ( EVM. pop @ EVM. revert ( 0 , 0 ))
299299 [EVM. SLOAD ]
300300
301301 | VarGet var ->
@@ -332,7 +332,7 @@ and compile_expression env = function
332332 | Clarity. Buff _ | Int | Uint ->
333333 let input_size = size_of_expression value in
334334 let input_mstore = compile_mstore_of_expression env value in
335- input_mstore @ EVM. staticcall_hash160 0 input_size 0 @ EVM. pop
335+ input_mstore @ EVM. staticcall_hash160 ( 0 , input_size) 0 @ EVM. pop
336336 | t -> unsupported_function " hash160" t
337337 end
338338
@@ -341,7 +341,7 @@ and compile_expression env = function
341341 | Clarity. Buff _ | Int | Uint ->
342342 let input_size = size_of_expression value in
343343 let value = compile_expression env value in
344- EVM. mstore 0 value @ EVM. sha3 0 input_size
344+ EVM. mstore 0 value @ EVM. sha3 ( 0 , input_size)
345345 | t -> unsupported_function " keccak256" t
346346 end
347347
@@ -367,7 +367,7 @@ and compile_expression env = function
367367 | Clarity. Buff _ | Int | Uint ->
368368 let input_size = size_of_expression value in
369369 let input_mstore = compile_mstore_of_expression env value in
370- input_mstore @ EVM. staticcall_sha256 0 input_size 0 @ EVM. pop
370+ input_mstore @ EVM. staticcall_sha256 ( 0 , input_size) 0 @ EVM. pop
371371 | t -> unsupported_function " sha256" t
372372 end
373373
@@ -413,7 +413,7 @@ and compile_static_print_call value =
413413 let payload = EVM.ABI. encode_with_signature signature args in
414414 let payload_size = String. length payload in
415415 let mstore = EVM. mstore_bytes 0 payload in
416- mstore @ EVM. staticcall log_addr 0 payload_size 0 0 @ EVM. pop
416+ mstore @ EVM. staticcall log_addr ( 0 , payload_size) ( 0 , 0 ) @ EVM. pop
417417
418418and compile_mstore_of_expression ?(offset =0 ) env expr =
419419 EVM. mstore offset (compile_expression env expr)
0 commit comments