diff --git a/rebar.config b/rebar.config index ed141dc..d948037 100644 --- a/rebar.config +++ b/rebar.config @@ -2,7 +2,8 @@ {erl_opts, [debug_info]}. -{deps, [ {aebytecode, {git, "https://github.com/aeternity/aebytecode.git", {tag, "v3.4.1"}}} +{deps, [ {gmbytecode, {git, "https://git.qpq.swiss/QPQ-AG/gmbytecode.git", + {ref, "691b9742bf7e4aa6a4e8e209397916be5abe1763"}}} , {eblake2, "1.0.0"} , {jsx, {git, "https://github.com/talentdeficit/jsx.git", {tag, "2.8.0"}}} ]}. @@ -13,8 +14,8 @@ {base_plt_apps, [erts, kernel, stdlib, crypto, mnesia]} ]}. -{relx, [{release, {aesophia, "8.0.1"}, - [aesophia, aebytecode]}, +{relx, [{release, {sophia, "8.0.1"}, + [sophia, gmbytecode]}, {dev_mode, true}, {include_erts, false}, diff --git a/rebar.lock b/rebar.lock index 8a19f04..c491f51 100644 --- a/rebar.lock +++ b/rebar.lock @@ -1,22 +1,22 @@ {"1.2.0", -[{<<"aebytecode">>, - {git,"https://github.com/aeternity/aebytecode.git", - {ref,"6bd6f82c70d800950ea1a2c70c364a4181ff5291"}}, - 0}, - {<<"aeserialization">>, - {git,"https://github.com/aeternity/aeserialization.git", - {ref,"b26e6d105424748ba1c27917267b7cff07f37802"}}, - 1}, - {<<"base58">>, - {git,"https://github.com/aeternity/erl-base58.git", - {ref,"60a335668a60328a29f9731b67c4a0e9e3d50ab6"}}, +[{<<"base58">>, + {git,"https://git.qpq.swiss/QPQ-AG/erl-base58.git", + {ref,"e6aa62eeae3d4388311401f06e4b939bf4e94b9c"}}, 2}, {<<"eblake2">>,{pkg,<<"eblake2">>,<<"1.0.0">>},0}, {<<"enacl">>, - {git,"https://github.com/aeternity/enacl.git", + {git,"https://git.qpq.swiss/QPQ-AG/enacl.git", {ref,"4eb7ec70084ba7c87b1af8797c4c4e90c84f95a2"}}, 2}, {<<"getopt">>,{pkg,<<"getopt">>,<<"1.0.1">>},1}, + {<<"gmbytecode">>, + {git,"https://git.qpq.swiss/QPQ-AG/gmbytecode.git", + {ref,"691b9742bf7e4aa6a4e8e209397916be5abe1763"}}, + 0}, + {<<"gmserialization">>, + {git,"https://git.qpq.swiss/QPQ-AG/gmserialization.git", + {ref,"ac64e01b0f675c1a34c70a827062f381920742db"}}, + 1}, {<<"jsx">>, {git,"https://github.com/talentdeficit/jsx.git", {ref,"3074d4865b3385a050badf7828ad31490d860df5"}}, diff --git a/src/aeso_compiler.erl b/src/aeso_compiler.erl index 1cc72c3..8d5713e 100644 --- a/src/aeso_compiler.erl +++ b/src/aeso_compiler.erl @@ -27,7 +27,7 @@ , validate_byte_code/3 ]). --include_lib("aebytecode/include/aeb_opcodes.hrl"). +-include_lib("gmbytecode/include/gmb_opcodes.hrl"). -include("aeso_utils.hrl"). @@ -124,14 +124,14 @@ from_string1(ContractString, Options) -> SavedFreshNames = maps:get(saved_fresh_names, FCodeEnv, #{}), FateCode = aeso_fcode_to_fate:compile(ChildContracts, FCode, SavedFreshNames, Options), pp_assembler(FateCode, Options), - ByteCode = aeb_fate_code:serialize(FateCode, []), + ByteCode = gmb_fate_code:serialize(FateCode, []), {ok, Version} = version(), Res = #{byte_code => ByteCode, compiler_version => Version, contract_source => ContractString, type_info => [], fate_code => FateCode, - abi_version => aeb_fate_abi:abi_version(), + abi_version => gmb_fate_abi:abi_version(), payable => maps:get(payable, FCode), warnings => Warnings }, @@ -203,7 +203,7 @@ add_extra_call(Contract0, Call, Options) -> , ast := Ast} = string_to_code(Contract0, Options), FateCode = aeso_fcode_to_fate:compile(ChildContracts, OrgFcode, #{}, []), %% collect all hashes and compute the first name without hash collision to - SymbolHashes = maps:keys(aeb_fate_code:symbols(FateCode)), + SymbolHashes = maps:keys(gmb_fate_code:symbols(FateCode)), CallName = first_none_match(?CALL_NAME, SymbolHashes, lists:seq($1, $9) ++ lists:seq($A, $Z) ++ lists:seq($a, $z)), Contract = insert_call_function(Ast, Contract0, CallName, Call), @@ -220,7 +220,7 @@ encode_value(Contract0, Type, Value, Options) -> case add_extra_call(Contract0, {value, Type, Value}, Options) of {ok, CallName, Code} -> Body = get_call_body(CallName, Code), - {ok, aeb_fate_encoding:serialize(aeso_fcode_to_fate:term_to_fate(Body))}; + {ok, gmb_fate_encoding:serialize(aeso_fcode_to_fate:term_to_fate(Body))}; Err = {error, _} -> Err end. @@ -243,7 +243,7 @@ decode_value(Contract0, Type, FateValue, Options) -> first_none_match(_CallName, _Hashes, []) -> error(unable_to_find_unique_call_name); first_none_match(CallName, Hashes, [Char|Chars]) -> - case not lists:member(aeb_fate_code:symbol_identifier(list_to_binary(CallName)), Hashes) of + case not lists:member(gmb_fate_code:symbol_identifier(list_to_binary(CallName)), Hashes) of true -> CallName; false -> @@ -303,7 +303,7 @@ to_sophia_value(ContractString, Fun, ResType, Data) -> to_sophia_value(_, _, error, Err, _Options) -> {ok, {app, [], {id, [], "error"}, [{string, [], Err}]}}; to_sophia_value(_, _, revert, Data, _Options) -> - try aeso_vm_decode:from_fate({id, [], "string"}, aeb_fate_encoding:deserialize(Data)) of + try aeso_vm_decode:from_fate({id, [], "string"}, gmb_fate_encoding:deserialize(Data)) of Err -> {ok, {app, [], {id, [], "abort"}, [Err]}} catch _:_ -> @@ -328,11 +328,11 @@ to_sophia_value(ContractString, FunName, ok, Data, Options0) -> fate_data_to_sophia_value(Type, UnfoldedType, FateData) -> try - {ok, aeso_vm_decode:from_fate(UnfoldedType, aeb_fate_encoding:deserialize(FateData))} + {ok, aeso_vm_decode:from_fate(UnfoldedType, gmb_fate_encoding:deserialize(FateData))} catch throw:cannot_translate_to_sophia -> Type1 = prettypr:format(aeso_pretty:type(Type)), Msg = io_lib:format("Cannot translate FATE value ~p\n of Sophia type ~s", - [aeb_fate_encoding:deserialize(FateData), Type1]), + [gmb_fate_encoding:deserialize(FateData), Type1]), {error, [aeso_errors:new(data_error, Msg)]}; _:_ -> Type1 = prettypr:format(aeso_pretty:type(Type)), @@ -350,7 +350,7 @@ create_calldata(Code, Fun, Args, Options0) -> Options = [no_code | Options0], case check_call(Code, Fun, Args, Options) of {ok, FunName, FateArgs} -> - aeb_fate_abi:create_calldata(FunName, FateArgs); + gmb_fate_abi:create_calldata(FunName, FateArgs); {error, _} = Err -> Err end. @@ -377,7 +377,7 @@ decode_calldata(ContractString, FunName, Calldata, Options0) -> [ unfold_record_types , unfold_variant_types , not_unfold_system_alias_types]), - case aeb_fate_abi:decode_calldata(FunName, Calldata) of + case gmb_fate_abi:decode_calldata(FunName, Calldata) of {ok, FateArgs} -> try {tuple_t, [], ArgTypes1} = Type, @@ -424,7 +424,7 @@ pp_sophia_code(C, Opts)-> pp(C, Opts, pp_sophia_code, fun(Code) -> pp_ast(C, Opts) -> pp(C, Opts, pp_ast, fun aeso_ast:pp/1). pp_typed_ast(C, Opts)-> pp(C, Opts, pp_typed_ast, fun aeso_ast:pp_typed/1). -pp_assembler(C, Opts) -> pp(C, Opts, pp_assembler, fun(Asm) -> io:format("~s", [aeb_fate_asm:pp(Asm)]) end). +pp_assembler(C, Opts) -> pp(C, Opts, pp_assembler, fun(Asm) -> io:format("~s", [gmb_fate_asm:pp(Asm)]) end). pp(Code, Options, Option, PPFun) -> case proplists:lookup(Option, Options) of @@ -442,14 +442,14 @@ pp(Code, Options, Option, PPFun) -> validate_byte_code(#{ byte_code := ByteCode, payable := Payable }, Source, Options) -> Fail = fun(Err) -> {error, [aeso_errors:new(data_error, Err)]} end, try - FCode1 = ?protect(deserialize, aeb_fate_code:strip_init_function(aeb_fate_code:deserialize(ByteCode))), + FCode1 = ?protect(deserialize, gmb_fate_code:strip_init_function(gmb_fate_code:deserialize(ByteCode))), {FCode2, SrcPayable} = ?protect(compile, begin {ok, #{ byte_code := SrcByteCode, payable := SrcPayable }} = from_string1(Source, Options), - FCode = aeb_fate_code:deserialize(SrcByteCode), - {aeb_fate_code:strip_init_function(FCode), SrcPayable} + FCode = gmb_fate_code:deserialize(SrcByteCode), + {gmb_fate_code:strip_init_function(FCode), SrcPayable} end), case compare_fate_code(FCode1, FCode2) of ok when SrcPayable /= Payable -> @@ -465,10 +465,10 @@ validate_byte_code(#{ byte_code := ByteCode, payable := Payable }, Source, Optio end. compare_fate_code(FCode1, FCode2) -> - Funs1 = aeb_fate_code:functions(FCode1), - Funs2 = aeb_fate_code:functions(FCode2), - Syms1 = aeb_fate_code:symbols(FCode1), - Syms2 = aeb_fate_code:symbols(FCode2), + Funs1 = gmb_fate_code:functions(FCode1), + Funs2 = gmb_fate_code:functions(FCode2), + Syms1 = gmb_fate_code:symbols(FCode1), + Syms2 = gmb_fate_code:symbols(FCode2), FunHashes1 = maps:keys(Funs1), FunHashes2 = maps:keys(Funs2), case FunHashes1 == FunHashes2 of diff --git a/src/aeso_vm_decode.erl b/src/aeso_vm_decode.erl index b0e2f78..94001d5 100644 --- a/src/aeso_vm_decode.erl +++ b/src/aeso_vm_decode.erl @@ -8,9 +8,9 @@ -export([ from_fate/2 ]). --include_lib("aebytecode/include/aeb_fate_data.hrl"). +-include_lib("gmbytecode/include/gmb_fate_data.hrl"). --spec from_fate(aeso_syntax:type(), aeb_fate_data:fate_type()) -> aeso_syntax:expr(). +-spec from_fate(aeso_syntax:type(), gmb_fate_data:fate_type()) -> aeso_syntax:expr(). from_fate({id, _, "address"}, ?FATE_ADDRESS(Bin)) -> {account_pubkey, [], Bin}; from_fate({id, _, "signature"}, ?FATE_BYTES(Bin)) -> {signature, [], Bin}; from_fate({id, _, "hash"}, ?FATE_BYTES(Bin)) -> {bytes, [], Bin}; diff --git a/src/aesophia.app.src b/src/aesophia.app.src index 926f26a..f9ceb41 100644 --- a/src/aesophia.app.src +++ b/src/aesophia.app.src @@ -7,7 +7,7 @@ stdlib, jsx, syntax_tools, - aebytecode, + gmbytecode, eblake2 ]}, {env,[]},