diff --git a/src/aeso_ast_to_fcode.erl b/src/aeso_ast_to_fcode.erl index 2ee90d9..ed9fa5e 100644 --- a/src/aeso_ast_to_fcode.erl +++ b/src/aeso_ast_to_fcode.erl @@ -31,7 +31,7 @@ map_get | map_get_d | map_set | map_from_list | map_to_list | map_delete | map_member | map_size | string_length | string_concat | bits_set | bits_clear | bits_test | bits_sum | - bits_intersection | bits_union | bits_difference. + bits_intersection | bits_union | bits_difference | contract_address. -type flit() :: {int, integer()} | {string, binary()} @@ -385,6 +385,8 @@ expr_to_fcode(Env, _Type, {tuple, _, Es}) -> %% Records expr_to_fcode(Env, Type, {proj, _Ann, Rec = {typed, _, _, RecType}, {id, _, X}}) -> case RecType of + {con, _, _} when X == "address" -> + {op, contract_address, [expr_to_fcode(Env, Rec)]}; {con, _, _} -> {fun_t, _, Named, Args, _} = Type, Arity = length(Named) + length(Args), diff --git a/src/aeso_fcode_to_fate.erl b/src/aeso_fcode_to_fate.erl index 3841fbe..d20a8b9 100644 --- a/src/aeso_fcode_to_fate.erl +++ b/src/aeso_fcode_to_fate.erl @@ -539,7 +539,8 @@ op_to_scode(bits_intersection) -> aeb_fate_ops:bits_and(?a, ?a, ?a); op_to_scode(bits_union) -> aeb_fate_ops:bits_or(?a, ?a, ?a); op_to_scode(bits_difference) -> aeb_fate_ops:bits_diff(?a, ?a, ?a); op_to_scode(address_to_str) -> aeb_fate_ops:addr_to_str(?a, ?a); -op_to_scode(int_to_str) -> aeb_fate_ops:int_to_str(?a, ?a). +op_to_scode(int_to_str) -> aeb_fate_ops:int_to_str(?a, ?a); +op_to_scode(contract_address) -> ?TODO(fate_contract_to_address_conversion). %% PUSH and STORE ?a are the same, so we use STORE to make optimizations %% easier, and specialize to PUSH (which is cheaper) at the end.