diff --git a/docs/alpha/liquidity_baking.rst b/docs/alpha/liquidity_baking.rst new file mode 100644 index 0000000000000000000000000000000000000000..b394d5aebe9f816e1e4417c1b09669e3de556816 --- /dev/null +++ b/docs/alpha/liquidity_baking.rst @@ -0,0 +1,38 @@ +.. _liquidity_baking_009: + +Liquidity Baking +================ + +Liquidity baking incentivizes large amounts of decentralized liquidity provision between tez and tzBTC by minting a small amount of tez every block and depositing it inside of a constant product market making smart-contract. It includes an escape hatch mechanism as a contingency. + +Contract +~~~~~~~~ + +A constant product market making (CPMM) Michelson contract is first deployed on the chain. This contract maintains a balance of ``a`` tez and ``b`` `tzBTC`_, where tzBTC is the `FA1.2 token`_ found at address KT1PWx2mnDueood7fEmfbBDKx1D9BAnnXitn. The smart contract accepts deposits of ``da`` tez and returns ``db`` tzBTC (or vice versa) where the invariant ``(a + da * (1 - f)) * (b - db) = a * b`` is preserved, and ``f`` is a fee, set at 0.1%. + +To implement this contract, we use a fork of the open source code base used by the "Dexter" project. The implementation of this contract has been `formally verified`_ against its functional specification and `audited by Trail of Bits`_. The contract code is modified in the following way: + +1. The fee is set to 0.1% as compared to 0.3% in Dexter. Rationale: given the subsidy it is not necessary to charge a large fee and better to improve liquidity. +2. The ability to set a delegate and receive rewards has been removed. Rationale: the subsidy means there is no need for a baker for that contract and having one would create an imbalance. +3. The ability to set a manager has been removed since it is only used in Dexter to set the delegate. + +Subsidy +~~~~~~~ + +At every block in the chain, a small amount of tez is minted and credited to the CPMM contract, and the CPMM's ``%default`` entrypoint is called to update the ``xtz_pool`` balance in its storage. The amount that is minted and sent to the CPMM contract is 1/16th of the rewards for a block of priority 0 with all endorsements; currently the rewards are 80 tez per block so the amount that is sent to the CPMM contract is 5 tez per block. + +So the credits to the CPMM contract can be accounted for by indexers, they are included in block metadata as a balance update with a new constructor for ``update_origin``, ``Subsidy``. + +As a safety precaution, the subsidy expires automatically after 6 months but it can be renewed periodically by protocol amendment. + +Escape hatch +~~~~~~~~~~~~ + +In addition to the 6 months sunset, an escape hatch is included. At every block, a baker can choose to include a flag that requests ending the subsidy. The context maintains an exponential moving average of that flag calculated as such with integer arithmetic: + +``e[0] = 0`` +``e[n+1] = (999 * e[n] // 1000) + (1000 if flag[n] else 0)`` + +If at any block `e[n] >= 500000` then it means that an exponential moving average with a window size on the order of one thousand blocks has had roughly a majority of blocks demanding the end of the subsidy. If that is the case, the subsidy is permanently halted (though it can be reactivated by a protocol upgrade). + +For indicative purposes, if a fraction ``f`` of blocks start signalling the flag, the threshold is reached after roughly ``log(1-1/(2f)) / log(0.999)`` blocks, about 693 blocks if everyone signals, 980 blocks if 80% do, 1790 blocks if 60% do, etc. diff --git a/docs/alpha/proof_of_stake.rst b/docs/alpha/proof_of_stake.rst index 25883f5accae91efdd571ad5276e4f6a18cf879c..8b64638ed8aea704d3b75f7d358963e9250cb7ca 100644 --- a/docs/alpha/proof_of_stake.rst +++ b/docs/alpha/proof_of_stake.rst @@ -322,7 +322,7 @@ blocks of priority 1 or higher will be rewarded ``e * 0.8333333`` Security deposits ~~~~~~~~~~~~~~~~~ -The cost of a security deposit is ``BLOCK_SECURITY_DEPOSIT`` = 512 ꜩ +The cost of a security deposit is ``BLOCK_SECURITY_DEPOSIT`` = 544 ꜩ per block created and ``ENDORSEMENT_SECURITY_DEPOSIT`` = 64 ꜩ per endorsement slot. diff --git a/docs/index.rst b/docs/index.rst index 30661e2222a6a23c09bf21fdbedfa8eb88d502bf..6bc273b8f2134583afb807cd6042979a21969ac0 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -159,6 +159,7 @@ in the :ref:`introduction `. alpha/glossary alpha/cli-commands alpha/rpc + alpha/liquidity_baking .. toctree:: :maxdepth: 2 diff --git a/docs/introduction/install-opam.sh b/docs/introduction/install-opam.sh index 7aa9d6286fe4e8e061888484421650c7c174c6a0..ee5f606ae5e01198e86b267df3b28ec18a2bb8c1 100644 --- a/docs/introduction/install-opam.sh +++ b/docs/introduction/install-opam.sh @@ -2,7 +2,7 @@ trap 'exit $?' ERR set -x sudo apt-get update export OPAMYES=true -export OPAMSOLVERTIMEOUT=1200 +export OPAMSOLVERTIMEOUT=60000 # [install ocaml compiler] opam switch create for_tezos 4.09.1 eval $(opam env) diff --git a/docs/protocols/alpha.rst b/docs/protocols/alpha.rst index 6549615973813ab9a4bf955cfe289ba1de70eebd..7913ff23950473e62817c25ad3dcf1309a12dc54 100644 --- a/docs/protocols/alpha.rst +++ b/docs/protocols/alpha.rst @@ -12,8 +12,24 @@ The code can be found in the ``src/proto_alpha`` directory of the This page documents the changes brought by protocol Alpha with respect to Florence. +The main novelties in the Alpha protocol are: .. contents:: Summary of changes - Fix handling of potential integer overflow in `Time_repr` addition `Protocol/time_repr: check for potential overflow on addition `_ + +Liquidity Baking +~~~~~~~~~~~~~~~~ + +5 tez per block is credited to a CPMM contract, the contract's ``%default`` entrypoint is called to update its storage, and the credit is included in block metadata as a balance update with a new ``update_origin`` type, ``Subsidy``. + +The liquidity baking subsidy shuts off automatically at six months from protocol activation if not renewed in a future upgrade. The sunset duration is included in constants and sunset level calculated during stitching. + +At any time bakers can vote to shut off the liquidity baking subsidy by setting a boolean flag in protocol_data. An exponential moving average (ema) of this escape flag is calculated with a window size of 1000 blocks and the subsidy permanently shuts off if the ema is ever over a threshold included in constants (half the window size with precision of 1000 added for integer computation). + +- `TZIP `_ +- MR: + :gl:`tezos!2473` + +More information can be found on the :ref:`liquidity baking reference page`. diff --git a/scripts/update_opam_repo.sh b/scripts/update_opam_repo.sh index 53b1531af2247c53d134ebfb6150cd8ba3d23ca0..682a4681dc9bbecd038e1148c77c3377057dc52e 100755 --- a/scripts/update_opam_repo.sh +++ b/scripts/update_opam_repo.sh @@ -88,7 +88,7 @@ done ## Filtering unrequired packages cd $tmp_dir git reset --hard "$full_opam_repository_tag" -OPAMSOLVERTIMEOUT=600 opam admin filter --yes --resolve \ +OPAMSOLVERTIMEOUT=600000 opam admin filter --yes --resolve \ $packages,ocaml,ocaml-base-compiler,odoc,opam-depext,js_of_ocaml-ppx,reactiveData,opam-ed ## Adding useful compiler variants diff --git a/scripts/user_activated_upgrade.sh b/scripts/user_activated_upgrade.sh index 6c72b1ec3f2004066068dc16172aa53ff37a41e0..250421dada3a4890a5a5bd45e41602328adf1edc 100755 --- a/scripts/user_activated_upgrade.sh +++ b/scripts/user_activated_upgrade.sh @@ -1,4 +1,4 @@ -#! /bin/bash +#! /usr/bin/env bash set -e diff --git a/src/proto_alpha/lib_client/mockup.ml b/src/proto_alpha/lib_client/mockup.ml index 3b92c8b18ad08f87da60674986e7a6dd02ff6ca9..323d7d7827f1d916ad720c9941150987c22fd8a4 100644 --- a/src/proto_alpha/lib_client/mockup.ml +++ b/src/proto_alpha/lib_client/mockup.ml @@ -59,6 +59,9 @@ module Protocol_constants_overrides = struct min_proposal_quorum : int32 option; initial_endorsers : int option; delay_per_missing_endorsement : Period.t option; + liquidity_baking_subsidy : Tez.t option; + liquidity_baking_sunset_duration : int32 option; + liquidity_baking_escape_ema_threshold : int32 option; (* Additional, "bastard" parameters (they are not protocol constants but partially treated the same way). *) chain_id : Chain_id.t option; timestamp : Time.Protocol.t option; @@ -77,25 +80,27 @@ module Protocol_constants_overrides = struct c.time_between_blocks, c.endorsers_per_block, c.hard_gas_limit_per_operation, - c.hard_gas_limit_per_block ), - ( ( c.proof_of_work_threshold, - c.tokens_per_roll, + c.hard_gas_limit_per_block, + c.proof_of_work_threshold ), + ( ( c.tokens_per_roll, c.michelson_maximum_type_size, c.seed_nonce_revelation_tip, c.origination_size, c.block_security_deposit, c.endorsement_security_deposit, - c.baking_reward_per_endorsement ), - ( c.endorsement_reward, + c.baking_reward_per_endorsement, + c.endorsement_reward, c.cost_per_byte, - c.hard_storage_limit_per_operation, - c.quorum_min, - c.quorum_max, - c.min_proposal_quorum, - c.initial_endorsers, - c.delay_per_missing_endorsement, - c.chain_id, - c.timestamp ) ) )) + c.hard_storage_limit_per_operation ), + ( ( c.quorum_min, + c.quorum_max, + c.min_proposal_quorum, + c.initial_endorsers, + c.delay_per_missing_endorsement, + c.liquidity_baking_subsidy, + c.liquidity_baking_sunset_duration, + c.liquidity_baking_escape_ema_threshold ), + (c.chain_id, c.timestamp) ) ) )) (fun ( ( preserved_cycles, blocks_per_cycle, blocks_per_commitment, @@ -104,25 +109,27 @@ module Protocol_constants_overrides = struct time_between_blocks, endorsers_per_block, hard_gas_limit_per_operation, - hard_gas_limit_per_block ), - ( ( proof_of_work_threshold, - tokens_per_roll, + hard_gas_limit_per_block, + proof_of_work_threshold ), + ( ( tokens_per_roll, michelson_maximum_type_size, seed_nonce_revelation_tip, origination_size, block_security_deposit, endorsement_security_deposit, - baking_reward_per_endorsement ), - ( endorsement_reward, + baking_reward_per_endorsement, + endorsement_reward, cost_per_byte, - hard_storage_limit_per_operation, - quorum_min, - quorum_max, - min_proposal_quorum, - initial_endorsers, - delay_per_missing_endorsement, - chain_id, - timestamp ) ) ) -> + hard_storage_limit_per_operation ), + ( ( quorum_min, + quorum_max, + min_proposal_quorum, + initial_endorsers, + delay_per_missing_endorsement, + liquidity_baking_subsidy, + liquidity_baking_sunset_duration, + liquidity_baking_escape_ema_threshold ), + (chain_id, timestamp) ) ) ) -> { preserved_cycles; blocks_per_cycle; @@ -149,11 +156,14 @@ module Protocol_constants_overrides = struct min_proposal_quorum; initial_endorsers; delay_per_missing_endorsement; + liquidity_baking_subsidy; + liquidity_baking_sunset_duration; + liquidity_baking_escape_ema_threshold; chain_id; timestamp; }) (merge_objs - (obj9 + (obj10 (opt "preserved_cycles" uint8) (opt "blocks_per_cycle" int32) (opt "blocks_per_commitment" int32) @@ -162,28 +172,33 @@ module Protocol_constants_overrides = struct (opt "time_between_blocks" (list Period.encoding)) (opt "endorsers_per_block" uint16) (opt "hard_gas_limit_per_operation" Gas.Arith.z_integral_encoding) - (opt "hard_gas_limit_per_block" Gas.Arith.z_integral_encoding)) + (opt "hard_gas_limit_per_block" Gas.Arith.z_integral_encoding) + (opt "proof_of_work_threshold" int64)) (merge_objs - (obj8 - (opt "proof_of_work_threshold" int64) + (obj10 (opt "tokens_per_roll" Tez.encoding) (opt "michelson_maximum_type_size" uint16) (opt "seed_nonce_revelation_tip" Tez.encoding) (opt "origination_size" int31) (opt "block_security_deposit" Tez.encoding) (opt "endorsement_security_deposit" Tez.encoding) - (opt "baking_reward_per_endorsement" (list Tez.encoding))) - (obj10 + (opt "baking_reward_per_endorsement" (list Tez.encoding)) (opt "endorsement_reward" (list Tez.encoding)) (opt "cost_per_byte" Tez.encoding) - (opt "hard_storage_limit_per_operation" z) - (opt "quorum_min" int32) - (opt "quorum_max" int32) - (opt "min_proposal_quorum" int32) - (opt "initial_endorsers" uint16) - (opt "delay_per_missing_endorsement" Period.encoding) - (opt "chain_id" Chain_id.encoding) - (opt "initial_timestamp" Time.Protocol.encoding)))) + (opt "hard_storage_limit_per_operation" z)) + (merge_objs + (obj8 + (opt "quorum_min" int32) + (opt "quorum_max" int32) + (opt "min_proposal_quorum" int32) + (opt "initial_endorsers" uint16) + (opt "delay_per_missing_endorsement" Period.encoding) + (opt "liquidity_baking_subsidy" Tez.encoding) + (opt "liquidity_baking_sunset_duration" int32) + (opt "liquidity_baking_escape_ema_threshold" int32)) + (obj2 + (opt "chain_id" Chain_id.encoding) + (opt "initial_timestamp" Time.Protocol.encoding))))) let default_value (cctxt : Tezos_client_base.Client_context.full) : t tzresult Lwt.t = @@ -230,6 +245,11 @@ module Protocol_constants_overrides = struct initial_endorsers = Some parametric.initial_endorsers; delay_per_missing_endorsement = Some parametric.delay_per_missing_endorsement; + liquidity_baking_subsidy = Some parametric.liquidity_baking_subsidy; + liquidity_baking_sunset_duration = + Some parametric.liquidity_baking_sunset_duration; + liquidity_baking_escape_ema_threshold = + Some parametric.liquidity_baking_escape_ema_threshold; (* Bastard, additional parameters. *) chain_id = to_chain_id_opt cpctxt#chain; timestamp = Some header.timestamp; @@ -262,6 +282,9 @@ module Protocol_constants_overrides = struct min_proposal_quorum = None; initial_endorsers = None; delay_per_missing_endorsement = None; + liquidity_baking_subsidy = None; + liquidity_baking_sunset_duration = None; + liquidity_baking_escape_ema_threshold = None; chain_id = None; timestamp = None; } @@ -438,6 +461,24 @@ module Protocol_constants_overrides = struct override_value = o.delay_per_missing_endorsement; pp = Period.pp; }; + O + { + name = "liquidity_baking_subsidy"; + override_value = o.liquidity_baking_subsidy; + pp = Tez.pp; + }; + O + { + name = "liquidity_baking_sunset_duration"; + override_value = o.liquidity_baking_sunset_duration; + pp = pp_print_int32; + }; + O + { + name = "liquidity_baking_escape_ema_threshold"; + override_value = o.liquidity_baking_escape_ema_threshold; + pp = pp_print_int32; + }; O {name = "chain_id"; override_value = o.chain_id; pp = Chain_id.pp}; O { @@ -532,7 +573,19 @@ module Protocol_constants_overrides = struct delay_per_missing_endorsement = Option.value ~default:c.delay_per_missing_endorsement - o.delay_per_missing_endorsement + o.delay_per_missing_endorsement; + liquidity_baking_subsidy = + Option.value + ~default:c.liquidity_baking_subsidy + o.liquidity_baking_subsidy; + liquidity_baking_sunset_duration = + Option.value + ~default:c.liquidity_baking_sunset_duration + o.liquidity_baking_sunset_duration; + liquidity_baking_escape_ema_threshold = + Option.value + ~default:c.liquidity_baking_escape_ema_threshold + o.liquidity_baking_escape_ema_threshold (* Notice that the chain_id and the timestamp are not used here as they are not protocol constants... *); } : Constants.parametric ) @@ -643,7 +696,7 @@ module Bootstrap_contract = struct (fun {delegate; amount; script} -> (delegate, amount, script)) (fun (delegate, amount, script) -> {delegate; amount; script}) (obj3 - (req "delegate" Signature.Public_key_hash.encoding) + (opt "delegate" Signature.Public_key_hash.encoding) (req "amount" Tez.encoding) (req "script" Script.encoding)) end diff --git a/src/proto_alpha/lib_client/operation_result.ml b/src/proto_alpha/lib_client/operation_result.ml index 80370e7c9d6ff34965ef83f07be995b90eabb577..39cde840a0ff4927469a2da7a2b36d6cc9b91263 100644 --- a/src/proto_alpha/lib_client/operation_result.ml +++ b/src/proto_alpha/lib_client/operation_result.ml @@ -166,6 +166,8 @@ let pp_balance_updates ppf = function balance | Protocol_migration -> Format.asprintf "migration %s" balance + | Subsidy -> + Format.asprintf "subsidy %s" balance in (balance, update)) balance_updates diff --git a/src/proto_alpha/lib_delegate/client_baking_forge.ml b/src/proto_alpha/lib_delegate/client_baking_forge.ml index 2a3cba4ac8a4ab96d593a79a2948d8643e6fc8da..e3287e99eafe692df14d7be089fa25e70db3d6c4 100644 --- a/src/proto_alpha/lib_delegate/client_baking_forge.ml +++ b/src/proto_alpha/lib_delegate/client_baking_forge.ml @@ -113,9 +113,14 @@ let generate_seed_nonce () = nonce let forge_block_header (cctxt : #Protocol_client_context.full) ~chain block - delegate_sk shell priority seed_nonce_hash = + delegate_sk shell priority seed_nonce_hash liquidity_baking_escape_vote = Client_baking_pow.mine cctxt chain block shell (fun proof_of_work_nonce -> - {Block_header.priority; seed_nonce_hash; proof_of_work_nonce}) + { + Block_header.priority; + seed_nonce_hash; + proof_of_work_nonce; + liquidity_baking_escape_vote; + }) >>=? fun contents -> let unsigned_header = Data_encoding.Binary.to_bytes_exn @@ -130,7 +135,8 @@ let forge_block_header (cctxt : #Protocol_client_context.full) ~chain block ~watermark:(Block_header chain_id) unsigned_header -let forge_faked_protocol_data ~priority ~seed_nonce_hash = +let forge_faked_protocol_data ~priority ~seed_nonce_hash + ~liquidity_baking_escape_vote = Alpha_context.Block_header. { contents = @@ -138,6 +144,7 @@ let forge_faked_protocol_data ~priority ~seed_nonce_hash = priority; seed_nonce_hash; proof_of_work_nonce = Client_baking_pow.empty_proof_of_work_nonce; + liquidity_baking_escape_vote; }; signature = Signature.zero; } @@ -178,7 +185,8 @@ let compute_endorsing_power cctxt ~chain ~block operations = operations let inject_block cctxt ?(force = false) ?seed_nonce_hash ~chain ~shell_header - ~priority ~delegate_pkh ~delegate_sk ~level operations = + ~priority ~delegate_pkh ~delegate_sk ~level operations + ~liquidity_baking_escape_vote = assert_valid_operations_hash shell_header operations >>=? fun () -> let block = `Hash (shell_header.Tezos_base.Block_header.predecessor, 0) in @@ -190,6 +198,7 @@ let inject_block cctxt ?(force = false) ?seed_nonce_hash ~chain ~shell_header shell_header priority seed_nonce_hash + liquidity_baking_escape_vote >>=? fun signed_header -> (* Record baked blocks to prevent double baking *) let open Client_baking_highwatermarks in @@ -828,8 +837,8 @@ let forge_block cctxt ?force ?operations ?(best_effort = operations = None) ?(sort = best_effort) ?(minimal_fees = default_minimal_fees) ?(minimal_nanotez_per_gas_unit = default_minimal_nanotez_per_gas_unit) ?(minimal_nanotez_per_byte = default_minimal_nanotez_per_byte) ?timestamp - ?mempool ?context_path ?seed_nonce_hash ~chain ~priority ~delegate_pkh - ~delegate_sk block = + ?mempool ?context_path ?seed_nonce_hash ~liquidity_baking_escape_vote + ~chain ~priority ~delegate_pkh ~delegate_sk block = (* making the arguments usable *) unopt_operations cctxt chain mempool operations >>=? fun operations_arg -> @@ -840,7 +849,12 @@ let forge_block cctxt ?force ?operations ?(best_effort = operations = None) unopt_timestamp ?force timestamp minimal_timestamp >>=? fun timestamp -> (* get basic building blocks *) - let protocol_data = forge_faked_protocol_data ~priority ~seed_nonce_hash in + let protocol_data = + forge_faked_protocol_data + ~priority + ~seed_nonce_hash + ~liquidity_baking_escape_vote + in Alpha_services.Constants.all cctxt (chain, block) >>=? fun Constants. { parametric = {hard_gas_limit_per_block; endorsers_per_block; _}; @@ -1017,6 +1031,7 @@ let forge_block cctxt ?force ?operations ?(best_effort = operations = None) ~delegate_sk ~level operations + ~liquidity_baking_escape_vote >>= function | Ok hash -> return hash @@ -1035,7 +1050,13 @@ let forge_block cctxt ?force ?operations ?(best_effort = operations = None) let shell_prevalidation (cctxt : #Protocol_client_context.full) ~chain ~block ~timestamp seed_nonce_hash operations ((_, (bi, priority, delegate)) as _slot) = - let protocol_data = forge_faked_protocol_data ~priority ~seed_nonce_hash in + let liquidity_baking_escape_vote = false in + let protocol_data = + forge_faked_protocol_data + ~priority + ~seed_nonce_hash + ~liquidity_baking_escape_vote + in Alpha_block_services.Helpers.Preapply.block cctxt ~chain @@ -1172,7 +1193,8 @@ let fetch_operations (cctxt : #Protocol_client_context.full) ~chain with consistent operations that went through the client-side validation *) let build_block cctxt ~user_activated_upgrades state seed_nonce_hash - ((slot_timestamp, (bi, priority, delegate)) as slot) = + ((slot_timestamp, (bi, priority, delegate)) as slot) + ~liquidity_baking_escape_vote = let chain = `Hash bi.Client_baking_blocks.chain_id in let block = `Hash (bi.hash, 0) in Alpha_services.Helpers.current_level cctxt ~offset:1l (chain, block) @@ -1238,7 +1260,10 @@ let build_block cctxt ~user_activated_upgrades state seed_nonce_hash slot else let protocol_data = - forge_faked_protocol_data ~priority ~seed_nonce_hash + forge_faked_protocol_data + ~priority + ~seed_nonce_hash + ~liquidity_baking_escape_vote in filter_and_apply_operations cctxt @@ -1352,11 +1377,51 @@ let build_block cctxt ~user_activated_upgrades state seed_nonce_hash operations slot ) +type per_block_votes = {liquidity_baking_escape_vote : bool option} + +let per_block_votes_encoding = + let open Data_encoding in + def "per_block_votes.alpha" + @@ conv + (fun {liquidity_baking_escape_vote} -> liquidity_baking_escape_vote) + (fun liquidity_baking_escape_vote -> {liquidity_baking_escape_vote}) + (obj1 (opt "liquidity_baking_escape_vote" Data_encoding.bool)) + +let read_liquidity_baking_escape_vote per_block_vote_file = + match per_block_vote_file with + | None -> + return false + | Some vote_file -> ( + Lwt.catch + (fun () -> + Lwt_utils_unix.Json.read_file vote_file + >>= function + | Ok votes_json -> + Lwt.return_some votes_json + | Error _ -> + Lwt.fail Not_found) + (fun _ -> Lwt.return_none) + >>= function + | Some votes_json -> ( + match + Data_encoding.Json.destruct per_block_votes_encoding votes_json + with + | exception _ -> + return false + | votes -> ( + match votes.liquidity_baking_escape_vote with + | None -> + return false + | Some liquidity_baking_escape_vote -> + return liquidity_baking_escape_vote ) ) + | None -> + return false ) + (** [bake cctxt state] create a single block when woken up to do so. All the necessary information is available in the [state.best_slot]. *) -let bake (cctxt : #Protocol_client_context.full) ~user_activated_upgrades - ~chain state = +let bake ?per_block_vote_file (cctxt : #Protocol_client_context.full) + ~user_activated_upgrades ~chain state = ( match state.best_slot with | None -> assert false (* unreachable *) @@ -1365,7 +1430,15 @@ let bake (cctxt : #Protocol_client_context.full) ~user_activated_upgrades >>=? fun slot -> let seed_nonce = generate_seed_nonce () in let seed_nonce_hash = Nonce.hash seed_nonce in - build_block cctxt ~user_activated_upgrades state seed_nonce_hash slot + read_liquidity_baking_escape_vote per_block_vote_file + >>=? fun liquidity_baking_escape_vote -> + build_block + cctxt + ~user_activated_upgrades + state + seed_nonce_hash + slot + ~liquidity_baking_escape_vote >>=? function | Some (head, priority, shell_header, operations, delegate, seed_nonce_hash) -> ( @@ -1396,6 +1469,7 @@ let bake (cctxt : #Protocol_client_context.full) ~user_activated_upgrades ~delegate_sk ~level operations + ~liquidity_baking_escape_vote >>= function | Error errs -> lwt_log_error @@ -1589,7 +1663,8 @@ let reveal_potential_nonces (cctxt : #Client_context.full) constants ~chain the [delegates] *) let create (cctxt : #Protocol_client_context.full) ~user_activated_upgrades ?minimal_fees ?minimal_nanotez_per_gas_unit ?minimal_nanotez_per_byte - ?max_priority ~chain ~context_path delegates block_stream = + ?max_priority ?per_block_vote_file ~chain ~context_path delegates + block_stream = let state_maker bi = Alpha_services.Constants.all cctxt (chain, `Head 0) >>=? fun constants -> @@ -1639,7 +1714,7 @@ let create (cctxt : #Protocol_client_context.full) ~user_activated_upgrades timeout ) in let timeout_k cctxt state () = - bake cctxt ~user_activated_upgrades ~chain state + bake ?per_block_vote_file cctxt ~user_activated_upgrades ~chain state >>= function | Error err -> if state.retry_counter = 0 then ( diff --git a/src/proto_alpha/lib_delegate/client_baking_forge.mli b/src/proto_alpha/lib_delegate/client_baking_forge.mli index 508e06a270e708603827c8aaef8d71d78b735789..28bd86c529b5f599dd01a4f1f7a58f4988b94b18 100644 --- a/src/proto_alpha/lib_delegate/client_baking_forge.mli +++ b/src/proto_alpha/lib_delegate/client_baking_forge.mli @@ -33,7 +33,8 @@ open Alpha_context val generate_seed_nonce : unit -> Nonce.t (** [inject_block cctxt blk ?force ~priority ~timestamp ~fitness - ~seed_nonce ~src_sk ops] tries to inject a block in the node. If + ~seed_nonce ~src_sk ops liquidity_baking_escape_vote] + tries to inject a block in the node. If [?force] is set, the fitness check will be bypassed. [priority] will be used to compute the baking slot (level is precomputed). [src_sk] is used to sign the block header. *) @@ -48,6 +49,7 @@ val inject_block : delegate_sk:Client_keys.sk_uri -> level:Raw_level.t -> Operation.raw list list -> + liquidity_baking_escape_vote:bool -> Block_hash.t tzresult Lwt.t type error += Failed_to_preapply of Tezos_base.Operation.t * error list @@ -85,6 +87,7 @@ val forge_block : ?mempool:string -> ?context_path:string -> ?seed_nonce_hash:Nonce_hash.t -> + liquidity_baking_escape_vote:bool -> chain:Chain_services.chain -> priority:[`Set of int | `Auto of public_key_hash * int option] -> delegate_pkh:Signature.Public_key_hash.t -> @@ -99,6 +102,7 @@ val create : ?minimal_nanotez_per_gas_unit:Q.t -> ?minimal_nanotez_per_byte:Q.t -> ?max_priority:int -> + ?per_block_vote_file:string -> chain:Chain_services.chain -> context_path:string -> public_key_hash list -> diff --git a/src/proto_alpha/lib_delegate/client_baking_lib.ml b/src/proto_alpha/lib_delegate/client_baking_lib.ml index face4ba87e2cab04f1f057255ad447d39786268d..ec5c419041239ca64c08484bc09b617a44fde94a 100644 --- a/src/proto_alpha/lib_delegate/client_baking_lib.ml +++ b/src/proto_alpha/lib_delegate/client_baking_lib.ml @@ -29,7 +29,7 @@ open Alpha_context let bake_block (cctxt : #Protocol_client_context.full) ?minimal_fees ?minimal_nanotez_per_gas_unit ?minimal_nanotez_per_byte ?force ?max_priority ?(minimal_timestamp = false) ?mempool ?context_path ?src_sk - ~chain ~head delegate = + ~liquidity_baking_escape_vote ~chain ~head delegate = ( match src_sk with | None -> Client_keys.get_key cctxt delegate @@ -60,6 +60,7 @@ let bake_block (cctxt : #Protocol_client_context.full) ?minimal_fees ?seed_nonce_hash ?mempool ?context_path + ~liquidity_baking_escape_vote ~chain ~priority:(`Auto (delegate, max_priority)) ~delegate_pkh:delegate diff --git a/src/proto_alpha/lib_delegate/client_baking_lib.mli b/src/proto_alpha/lib_delegate/client_baking_lib.mli index dd8e00bf3565bba1dfe20646c50843e47155454b..a93daedc308c7cbb7669624e39e16892556415a2 100644 --- a/src/proto_alpha/lib_delegate/client_baking_lib.mli +++ b/src/proto_alpha/lib_delegate/client_baking_lib.mli @@ -38,6 +38,7 @@ val bake_block : ?mempool:string -> ?context_path:string -> ?src_sk:Client_keys.sk_uri -> + liquidity_baking_escape_vote:bool -> chain:Chain_services.chain -> head:Block_services.block -> public_key_hash -> diff --git a/src/proto_alpha/lib_delegate/client_daemon.ml b/src/proto_alpha/lib_delegate/client_daemon.ml index ba93851711876f242c92e83b61437bd3f00517b2..d3391fe6c95468b5abc06039b49aa5443db0812b 100644 --- a/src/proto_alpha/lib_delegate/client_daemon.ml +++ b/src/proto_alpha/lib_delegate/client_daemon.ml @@ -94,7 +94,7 @@ end module Baker = struct let run (cctxt : #Protocol_client_context.full) ?minimal_fees ?minimal_nanotez_per_gas_unit ?minimal_nanotez_per_byte ?max_priority - ~chain ~context_path ~keep_alive delegates = + ?per_block_vote_file ~chain ~context_path ~keep_alive delegates = let process () = Config_services.user_activated_upgrades cctxt >>=? fun user_activated_upgrades -> @@ -112,6 +112,7 @@ module Baker = struct ?minimal_nanotez_per_gas_unit ?minimal_nanotez_per_byte ?max_priority + ?per_block_vote_file ~chain ~context_path delegates diff --git a/src/proto_alpha/lib_delegate/client_daemon.mli b/src/proto_alpha/lib_delegate/client_daemon.mli index 410e71670ec9261f31e46671b30711739bfc6007..06ef103ca5b9d933d5baebb06c5aed03029e7912 100644 --- a/src/proto_alpha/lib_delegate/client_daemon.mli +++ b/src/proto_alpha/lib_delegate/client_daemon.mli @@ -43,6 +43,7 @@ module Baker : sig ?minimal_nanotez_per_gas_unit:Q.t -> ?minimal_nanotez_per_byte:Q.t -> ?max_priority:int -> + ?per_block_vote_file:string -> chain:Chain_services.chain -> context_path:string -> keep_alive:bool -> diff --git a/src/proto_alpha/lib_delegate/delegate_commands.ml b/src/proto_alpha/lib_delegate/delegate_commands.ml index f7bcf06e678c020aa3dfc3693719e79dae202f2d..ae166e62c1afc1e6bf58392044b1fcba82e4580f 100644 --- a/src/proto_alpha/lib_delegate/delegate_commands.ml +++ b/src/proto_alpha/lib_delegate/delegate_commands.ml @@ -86,6 +86,14 @@ let keep_alive_arg = ~long:"keep-alive" () +let per_block_vote_file_arg = + Clic.arg + ~doc:"read per block votes as json file" + ~short:'V' + ~long:"votefile" + ~placeholder:"filename" + (Clic.parameter (fun _ s -> return s)) + let delegate_commands () = let open Clic in [ command @@ -125,6 +133,7 @@ let delegate_commands () = ~minimal_timestamp ?mempool ?context_path + ~liquidity_baking_escape_vote:false ~chain:cctxt#chain ~head:cctxt#block delegate); @@ -247,13 +256,14 @@ let baker_commands () = [ command ~group ~desc:"Launch the baker daemon." - (args6 + (args7 pidfile_arg max_priority_arg minimal_fees_arg minimal_nanotez_per_gas_unit_arg minimal_nanotez_per_byte_arg - keep_alive_arg) + keep_alive_arg + per_block_vote_file_arg) ( prefixes ["run"; "with"; "local"; "node"] @@ param ~name:"context_path" @@ -265,7 +275,8 @@ let baker_commands () = minimal_fees, minimal_nanotez_per_gas_unit, minimal_nanotez_per_byte, - keep_alive ) + keep_alive, + per_block_vote_file ) node_path delegates cctxt -> @@ -282,6 +293,7 @@ let baker_commands () = ~minimal_nanotez_per_gas_unit ~minimal_nanotez_per_byte ?max_priority + ?per_block_vote_file ~context_path:(Filename.concat node_path "context") ~keep_alive (List.map snd delegates)) ] diff --git a/src/proto_alpha/lib_parameters/default_parameters.ml b/src/proto_alpha/lib_parameters/default_parameters.ml index 88537b786d65e98006919017a9ac7e2d843d868c..a7675877e608c20a12922bb163c0d91891eb044c 100644 --- a/src/proto_alpha/lib_parameters/default_parameters.ml +++ b/src/proto_alpha/lib_parameters/default_parameters.ml @@ -56,6 +56,13 @@ let constants_mainnet = min_proposal_quorum = 5_00l; initial_endorsers = 24; delay_per_missing_endorsement = Period.of_seconds_exn 8L; + (* liquidity_baking_subsidy is 1/16th of total rewards *) + liquidity_baking_subsidy = Tez.of_mutez_exn 5_000_000L; + (* level after protocol activation when liquidity baking shuts off *) + (* set to six months *) + liquidity_baking_sunset_duration = 262800l; + (* 1/2 window size of 1000 blocks with precision of 1000 for integer computation *) + liquidity_baking_escape_ema_threshold = 500_000l; } let constants_sandbox = @@ -71,6 +78,7 @@ let constants_sandbox = proof_of_work_threshold = Int64.of_int (-1); initial_endorsers = 1; delay_per_missing_endorsement = Period.of_seconds_exn 1L; + liquidity_baking_sunset_duration = 1024l; } let constants_test = @@ -85,6 +93,7 @@ let constants_test = proof_of_work_threshold = Int64.of_int (-1); initial_endorsers = 1; delay_per_missing_endorsement = Period.of_seconds_exn 1L; + liquidity_baking_sunset_duration = 2048l; } let bootstrap_accounts_strings = diff --git a/src/proto_alpha/lib_parameters/dune b/src/proto_alpha/lib_parameters/dune index 590563d8068d4b54950a6cc50a3d97c1da535160..a33342f225e830c1d91fa0db4cd58f0998175f4d 100644 --- a/src/proto_alpha/lib_parameters/dune +++ b/src/proto_alpha/lib_parameters/dune @@ -4,9 +4,11 @@ (modules :standard \ gen) (libraries tezos-base tezos-protocol-environment - tezos-protocol-alpha) + tezos-protocol-alpha + tezos-micheline) (flags (:standard -open Tezos_base__TzPervasives -open Tezos_protocol_alpha + -open Tezos_micheline -linkall)) ) diff --git a/src/proto_alpha/lib_parameters/gen.ml b/src/proto_alpha/lib_parameters/gen.ml index 93a0a459dd39e465da0a5689ad7e0ca609df5788..98178f61e3e0c71c179208f8fd0c4ea03a5eddfc 100644 --- a/src/proto_alpha/lib_parameters/gen.ml +++ b/src/proto_alpha/lib_parameters/gen.ml @@ -25,7 +25,7 @@ (* Prints the json encoding of the parametric constants of protocol alpha. $ dune utop src/proto_alpha/lib_protocol/test/helpers/ constants.ml -*) + *) let () = let print_usage_and_fail s = diff --git a/src/proto_alpha/lib_protocol/TEZOS_PROTOCOL b/src/proto_alpha/lib_protocol/TEZOS_PROTOCOL index 008eaefa29f5b77a5b58fcc544addb10654c4b19..ac348df0c9abe059ee4843e79853e051da74cd7a 100644 --- a/src/proto_alpha/lib_protocol/TEZOS_PROTOCOL +++ b/src/proto_alpha/lib_protocol/TEZOS_PROTOCOL @@ -16,6 +16,7 @@ "Fixed_point_repr", "Saturation_repr", "Gas_limit_repr", + "Contract_repr", "Constants_repr", "Fitness_repr", "Raw_level_repr", @@ -27,7 +28,6 @@ "Script_timestamp_repr", "Michelson_v1_primitives", "Script_repr", - "Contract_repr", "Roll_repr", "Vote_repr", "Block_header_repr", @@ -60,6 +60,10 @@ "Voting_period_storage", "Vote_storage", "Commitment_storage", + "Liquidity_baking_cpmm", + "Liquidity_baking_lqt", + "Liquidity_baking_test_fa12", + "Liquidity_baking_storage", "Init_storage", "Fees_storage", "Sapling_validator", diff --git a/src/proto_alpha/lib_protocol/alpha_context.ml b/src/proto_alpha/lib_protocol/alpha_context.ml index a0e2c784b8dfba5f78e104ce4c682de259e8640d..92528722cfd7664ec3a9fe3789650ceef8598ae2 100644 --- a/src/proto_alpha/lib_protocol/alpha_context.ml +++ b/src/proto_alpha/lib_protocol/alpha_context.ml @@ -297,3 +297,29 @@ let get_rewards = Raw_context.get_rewards let description = Raw_context.description module Parameters = Parameters_repr + +module Liquidity_baking = struct + let get_escape_ema = Storage.Liquidity_baking.Escape_ema.get + + let update_escape_ema ctxt ~escape_vote = + Storage.Liquidity_baking.Escape_ema.get ctxt + >>=? fun old_ema -> + (* if ema is over threshold, we don't update it because liquidity baking is permanently off *) + if + Compare.Int32.( + old_ema < Constants.liquidity_baking_escape_ema_threshold ctxt) + then + let new_ema = + Int32.( + add (div (mul 999l old_ema) 1000l) (if escape_vote then 1000l else 0l)) + in + Storage.Liquidity_baking.Escape_ema.update ctxt new_ema + >|=? fun ctxt -> (ctxt, new_ema) + else return (ctxt, old_ema) + + let get_sunset_level = Storage.Liquidity_baking.Sunset_level.get + + let set_sunset_level = Storage.Liquidity_baking.Sunset_level.update + + let get_cpmm_address = Storage.Liquidity_baking.Cpmm_address.get +end diff --git a/src/proto_alpha/lib_protocol/alpha_context.mli b/src/proto_alpha/lib_protocol/alpha_context.mli index ac3cb8fcee904de5e3be8e37c92641623b1d89b6..e92040d9916f59115f1c6a60ceb1e9f6b5cebe33 100644 --- a/src/proto_alpha/lib_protocol/alpha_context.mli +++ b/src/proto_alpha/lib_protocol/alpha_context.mli @@ -463,119 +463,6 @@ module Script : sig val strip_locations_cost : node -> Gas.cost end -module Constants : sig - (** Fixed constants *) - type fixed = { - proof_of_work_nonce_size : int; - nonce_length : int; - max_anon_ops_per_block : int; - max_operation_data_length : int; - max_proposals_per_delegate : int; - } - - val fixed_encoding : fixed Data_encoding.t - - val fixed : fixed - - val proof_of_work_nonce_size : int - - val nonce_length : int - - val max_anon_ops_per_block : int - - val max_operation_data_length : int - - val max_proposals_per_delegate : int - - (** Constants parameterized by context *) - type parametric = { - preserved_cycles : int; - blocks_per_cycle : int32; - blocks_per_commitment : int32; - blocks_per_roll_snapshot : int32; - blocks_per_voting_period : int32; - time_between_blocks : Period.t list; - endorsers_per_block : int; - hard_gas_limit_per_operation : Gas.Arith.integral; - hard_gas_limit_per_block : Gas.Arith.integral; - proof_of_work_threshold : int64; - tokens_per_roll : Tez.t; - michelson_maximum_type_size : int; - seed_nonce_revelation_tip : Tez.t; - origination_size : int; - block_security_deposit : Tez.t; - endorsement_security_deposit : Tez.t; - baking_reward_per_endorsement : Tez.t list; - endorsement_reward : Tez.t list; - cost_per_byte : Tez.t; - hard_storage_limit_per_operation : Z.t; - quorum_min : int32; - quorum_max : int32; - min_proposal_quorum : int32; - initial_endorsers : int; - delay_per_missing_endorsement : Period.t; - } - - val parametric_encoding : parametric Data_encoding.t - - val parametric : context -> parametric - - val preserved_cycles : context -> int - - val blocks_per_cycle : context -> int32 - - val blocks_per_commitment : context -> int32 - - val blocks_per_roll_snapshot : context -> int32 - - val blocks_per_voting_period : context -> int32 - - val time_between_blocks : context -> Period.t list - - val endorsers_per_block : context -> int - - val initial_endorsers : context -> int - - val delay_per_missing_endorsement : context -> Period.t - - val hard_gas_limit_per_operation : context -> Gas.Arith.integral - - val hard_gas_limit_per_block : context -> Gas.Arith.integral - - val cost_per_byte : context -> Tez.t - - val hard_storage_limit_per_operation : context -> Z.t - - val proof_of_work_threshold : context -> int64 - - val tokens_per_roll : context -> Tez.t - - val michelson_maximum_type_size : context -> int - - val baking_reward_per_endorsement : context -> Tez.t list - - val endorsement_reward : context -> Tez.t list - - val seed_nonce_revelation_tip : context -> Tez.t - - val origination_size : context -> int - - val block_security_deposit : context -> Tez.t - - val endorsement_security_deposit : context -> Tez.t - - val quorum_min : context -> int32 - - val quorum_max : context -> int32 - - val min_proposal_quorum : context -> int32 - - (** All constants: fixed and parametric *) - type t = {fixed : fixed; parametric : parametric} - - val encoding : t Data_encoding.t -end - module Level : sig type t = private { level : Raw_level.t; @@ -971,6 +858,132 @@ module Contract : sig val initial_origination_nonce : Operation_hash.t -> origination_nonce val originated_contract : origination_nonce -> contract + + val pp : Format.formatter -> contract -> unit + + val encoding : contract Data_encoding.t +end + +module Constants : sig + (** Fixed constants *) + type fixed = { + proof_of_work_nonce_size : int; + nonce_length : int; + max_anon_ops_per_block : int; + max_operation_data_length : int; + max_proposals_per_delegate : int; + } + + val fixed_encoding : fixed Data_encoding.t + + val fixed : fixed + + val proof_of_work_nonce_size : int + + val nonce_length : int + + val max_anon_ops_per_block : int + + val max_operation_data_length : int + + val max_proposals_per_delegate : int + + (** Constants parameterized by context *) + type parametric = { + preserved_cycles : int; + blocks_per_cycle : int32; + blocks_per_commitment : int32; + blocks_per_roll_snapshot : int32; + blocks_per_voting_period : int32; + time_between_blocks : Period.t list; + endorsers_per_block : int; + hard_gas_limit_per_operation : Gas.Arith.integral; + hard_gas_limit_per_block : Gas.Arith.integral; + proof_of_work_threshold : int64; + tokens_per_roll : Tez.t; + michelson_maximum_type_size : int; + seed_nonce_revelation_tip : Tez.t; + origination_size : int; + block_security_deposit : Tez.t; + endorsement_security_deposit : Tez.t; + baking_reward_per_endorsement : Tez.t list; + endorsement_reward : Tez.t list; + cost_per_byte : Tez.t; + hard_storage_limit_per_operation : Z.t; + quorum_min : int32; + quorum_max : int32; + min_proposal_quorum : int32; + initial_endorsers : int; + delay_per_missing_endorsement : Period.t; + liquidity_baking_subsidy : Tez.t; + liquidity_baking_sunset_duration : int32; + liquidity_baking_escape_ema_threshold : int32; + } + + val parametric_encoding : parametric Data_encoding.t + + val parametric : context -> parametric + + val preserved_cycles : context -> int + + val blocks_per_cycle : context -> int32 + + val blocks_per_commitment : context -> int32 + + val blocks_per_roll_snapshot : context -> int32 + + val blocks_per_voting_period : context -> int32 + + val time_between_blocks : context -> Period.t list + + val endorsers_per_block : context -> int + + val initial_endorsers : context -> int + + val delay_per_missing_endorsement : context -> Period.t + + val hard_gas_limit_per_operation : context -> Gas.Arith.integral + + val hard_gas_limit_per_block : context -> Gas.Arith.integral + + val cost_per_byte : context -> Tez.t + + val hard_storage_limit_per_operation : context -> Z.t + + val proof_of_work_threshold : context -> int64 + + val tokens_per_roll : context -> Tez.t + + val michelson_maximum_type_size : context -> int + + val baking_reward_per_endorsement : context -> Tez.t list + + val endorsement_reward : context -> Tez.t list + + val seed_nonce_revelation_tip : context -> Tez.t + + val origination_size : context -> int + + val block_security_deposit : context -> Tez.t + + val endorsement_security_deposit : context -> Tez.t + + val quorum_min : context -> int32 + + val quorum_max : context -> int32 + + val min_proposal_quorum : context -> int32 + + val liquidity_baking_subsidy : context -> Tez.t + + val liquidity_baking_sunset_duration : context -> int32 + + val liquidity_baking_escape_ema_threshold : context -> int32 + + (** All constants: fixed and parametric *) + type t = {fixed : fixed; parametric : parametric} + + val encoding : t Data_encoding.t end module Receipt : sig @@ -982,7 +995,7 @@ module Receipt : sig type balance_update = Debited of Tez.t | Credited of Tez.t - type update_origin = Block_application | Protocol_migration + type update_origin = Block_application | Protocol_migration | Subsidy type balance_updates = (balance * balance_update * update_origin) list @@ -1177,6 +1190,7 @@ module Block_header : sig priority : int; seed_nonce_hash : Nonce_hash.t option; proof_of_work_nonce : bytes; + liquidity_baking_escape_vote : bool; } type protocol_data = {contents : contents; signature : Signature.t} @@ -1368,6 +1382,9 @@ module Fees : sig val record_paid_storage_space : context -> Contract.t -> (context * Z.t * Z.t * Tez.t) tzresult Lwt.t + val record_paid_storage_space_subsidy : + context -> Contract.t -> (context * Z.t * Z.t) tzresult Lwt.t + val start_counting_storage_fees : context -> context val burn_storage_fees : @@ -1622,7 +1639,7 @@ module Parameters : sig } type bootstrap_contract = { - delegate : public_key_hash; + delegate : public_key_hash option; amount : Tez.t; script : Script.t; } @@ -1638,3 +1655,19 @@ module Parameters : sig val encoding : t Data_encoding.t end + +module Liquidity_baking : sig + val get_escape_ema : context -> Int32.t tzresult Lwt.t + + (** ema starts at zero + ema[n+1] = (999 * ema[n] // 1000) + (1000 if escape_vote[n] else 0) + where escape_vote is protocol_data.contents.liquidity_baking_escape_vote **) + val update_escape_ema : + context -> escape_vote:bool -> (context * Int32.t) tzresult Lwt.t + + val get_sunset_level : context -> Int32.t tzresult Lwt.t + + val set_sunset_level : context -> Int32.t -> context tzresult Lwt.t + + val get_cpmm_address : context -> Contract.t tzresult Lwt.t +end diff --git a/src/proto_alpha/lib_protocol/alpha_services.ml b/src/proto_alpha/lib_protocol/alpha_services.ml index c774f0c74215eb6258bf70b55daefafee125d3c6..9dc3cebfadbc62a4073be44b0a0e657eb7733de7 100644 --- a/src/proto_alpha/lib_protocol/alpha_services.ml +++ b/src/proto_alpha/lib_protocol/alpha_services.ml @@ -110,6 +110,26 @@ module Parse = Helpers_services.Parse module Voting = Voting_services module Sapling = Sapling_services +module Liquidity_baking = struct + module S = struct + let get_cpmm_address = + RPC_service.get_service + ~description:"Liquidity baking CPMM address" + ~query:RPC_query.empty + ~output:Alpha_context.Contract.encoding + RPC_path.( + custom_root / "context" / "liquidity_baking" / "cpmm_address") + end + + let register () = + let open Services_registration in + register0 S.get_cpmm_address (fun ctxt () () -> + Alpha_context.Liquidity_baking.get_cpmm_address ctxt) + + let get_cpmm_address ctxt block = + RPC_context.make_call0 S.get_cpmm_address ctxt block () () +end + let register () = Contract.register () ; Constants.register () ; @@ -117,4 +137,5 @@ let register () = Helpers.register () ; Nonce.register () ; Voting.register () ; - Sapling.register () + Sapling.register () ; + Liquidity_baking.register () diff --git a/src/proto_alpha/lib_protocol/alpha_services.mli b/src/proto_alpha/lib_protocol/alpha_services.mli index 7c59bf7f2a18d08464deb75e028f8172dac37953..c234ddf33ab3820e639257b7622588d13e697b28 100644 --- a/src/proto_alpha/lib_protocol/alpha_services.mli +++ b/src/proto_alpha/lib_protocol/alpha_services.mli @@ -46,4 +46,11 @@ module Parse = Helpers_services.Parse module Voting = Voting_services module Sapling = Sapling_services +module Liquidity_baking : sig + val get_cpmm_address : + 'a #RPC_context.simple -> + 'a -> + Alpha_context.Contract.t shell_tzresult Lwt.t +end + val register : unit -> unit diff --git a/src/proto_alpha/lib_protocol/apply.ml b/src/proto_alpha/lib_protocol/apply.ml index 745b239fcf3b52c76d4a8913d45c8d896247e724..2b25844843d202626d6914fb13ee4c37e850ee7c 100644 --- a/src/proto_alpha/lib_protocol/apply.ml +++ b/src/proto_alpha/lib_protocol/apply.ml @@ -1557,8 +1557,140 @@ let check_minimum_endorsements ctxt protocol_data block_delay timestamp; }) +let apply_liquidity_baking_subsidy ctxt ~escape_vote = + (* check level is below sunset *) + Liquidity_baking.get_sunset_level ctxt + >>=? fun sunset_level -> + let level = Raw_level.to_int32 (Level.current ctxt).level in + if Compare.Int32.(level >= sunset_level) then + (* don't set or get ema if past sunset *) + return (ctxt, [], 0l) + else + Liquidity_baking.update_escape_ema ctxt ~escape_vote + >>=? fun (ctxt, liquidity_baking_escape_ema) -> + (* liquidity baking permanently shuts off if threshold is reached once *) + if + Compare.Int32.( + liquidity_baking_escape_ema + >= Constants.liquidity_baking_escape_ema_threshold ctxt) + then return (ctxt, [], liquidity_baking_escape_ema) + else + Liquidity_baking.get_cpmm_address ctxt + >>=? fun liquidity_baking_cpmm_contract -> + Contract.exists ctxt liquidity_baking_cpmm_contract + >>=? function + | false -> + (* fail gracefully if the cpmm is not found *) + return (ctxt, [], liquidity_baking_escape_ema) + | true -> ( + let backtracking_ctxt = ctxt in + (let liquidity_baking_subsidy = + Constants.liquidity_baking_subsidy ctxt + in + (* credit liquidity baking subsidy to CPMM contract *) + Contract.credit + ctxt + liquidity_baking_cpmm_contract + liquidity_baking_subsidy + >>=? fun ctxt -> + Contract.get_script ctxt liquidity_baking_cpmm_contract + >>=? fun (ctxt, script) -> + match script with + | None -> + fail (Script_tc_errors.No_such_entrypoint "default") + | Some script -> ( + let step_constants = + let open Script_interpreter in + (* + Using dummy values since they are not used within the CPMM default entrypoint. + *) + { + source = liquidity_baking_cpmm_contract; + payer = liquidity_baking_cpmm_contract; + self = liquidity_baking_cpmm_contract; + amount = liquidity_baking_subsidy; + chain_id = Chain_id.zero; + } + in + let parameter = + Micheline.strip_locations + Michelson_v1_primitives.(Prim (0, D_Unit, [], [])) + in + (* + Call CPPM default entrypoint with parameter Unit. + This is necessary for the CPMM's xtz_pool in storage to + increase since it cannot use BALANCE due to a transfer attack. + + Mimicks a transaction. + + Gas limit for the operation is unlimited but the gas is still + counted towards the block allowance. + + There is no: + - storage burn (extra storage is free) + - fees (the operation is mandatory) + - gas for manager operation application, deserializing arguments + (constant per block). + *) + Script_interpreter.execute + ctxt + Optimized + step_constants + ~script + ~parameter + ~entrypoint:"default" + ~internal:true + >>=? fun {ctxt; storage; lazy_storage_diff; operations} -> + match operations with + | _ :: _ -> + (* No internal operations are expected here. Something bad may be happening. *) + return (backtracking_ctxt, []) + | [] -> + (* update CPMM storage *) + Contract.update_script_storage + ctxt + liquidity_baking_cpmm_contract + storage + lazy_storage_diff + >>=? fun ctxt -> + Fees.record_paid_storage_space_subsidy + ctxt + liquidity_baking_cpmm_contract + >>=? fun (ctxt, new_size, paid_storage_size_diff) -> + let balance_updates = + [ Receipt. + ( Contract liquidity_baking_cpmm_contract, + Credited liquidity_baking_subsidy, + Subsidy ) ] + in + let consumed_gas = + Gas.consumed ~since:backtracking_ctxt ~until:ctxt + in + let result = + Transaction_result + { + storage = Some storage; + lazy_storage_diff; + balance_updates; + (* At this point in application the origination nonce has not been initialized so we assume no new contracts are originated. *) + originated_contracts = []; + consumed_gas; + storage_size = new_size; + paid_storage_size_diff; + allocated_destination_contract = false; + } + in + return (ctxt, [Successful_manager_result result]) )) + >|= function + | Ok (ctxt, results) -> + Ok (ctxt, results, liquidity_baking_escape_ema) + | Error _ -> + (* Do not fail if something bad happens during CPMM contract call. *) + Ok (backtracking_ctxt, [], liquidity_baking_escape_ema) ) + let finalize_application ctxt protocol_data delegate ~block_delay - migration_balance_updates = + migration_balance_updates ~liquidity_baking_escape_ema + implicit_operations_results = let included_endorsements = included_endorsements ctxt in check_minimum_endorsements ctxt @@ -1643,6 +1775,8 @@ let finalize_application ctxt protocol_data delegate ~block_delay consumed_gas; deactivated; balance_updates; + liquidity_baking_escape_ema; + implicit_operations_results; } in (ctxt, receipt) diff --git a/src/proto_alpha/lib_protocol/apply.mli b/src/proto_alpha/lib_protocol/apply.mli index fbac491292c283bda50c67e81852496ff6794237..8a17350a2a3579f4470091dbda4120ce8b294b6a 100644 --- a/src/proto_alpha/lib_protocol/apply.mli +++ b/src/proto_alpha/lib_protocol/apply.mli @@ -126,12 +126,20 @@ val apply_operation : 'a operation -> (t * 'a operation_metadata, error trace) result Lwt.t +val apply_liquidity_baking_subsidy : + t -> + escape_vote:bool -> + (t * packed_successful_manager_operation_result list * Int32.t) tzresult + Lwt.t + val finalize_application : t -> Block_header.contents -> public_key_hash -> block_delay:Period.t -> Receipt.balance_updates -> + liquidity_baking_escape_ema:Int32.t -> + packed_successful_manager_operation_result list -> (t * block_metadata, error trace) result Lwt.t val apply_manager_contents_list : diff --git a/src/proto_alpha/lib_protocol/apply_results.ml b/src/proto_alpha/lib_protocol/apply_results.ml index 7bfaf2943301b36c574e208b7e0a49490a7af1da..493091b445bceb73e7442ee0b5954fb8a2f44294 100644 --- a/src/proto_alpha/lib_protocol/apply_results.ml +++ b/src/proto_alpha/lib_protocol/apply_results.ml @@ -403,6 +403,32 @@ let internal_operation_result_encoding : make Manager_result.origination_case; make Manager_result.delegation_case ] +let successful_manager_operation_result_encoding : + packed_successful_manager_operation_result Data_encoding.t = + let make (type kind) + (Manager_result.MCase res_case : kind Manager_result.case) = + let (Operation.Encoding.Manager_operations.MCase op_case) = + res_case.op_case + in + case + (Tag op_case.tag) + ~title:op_case.name + (merge_objs (obj1 (req "kind" (constant op_case.name))) res_case.encoding) + (fun res -> + match res_case.select res with + | Some res -> + Some ((), res_case.proj res) + | None -> + None) + (fun ((), res) -> Successful_manager_result (res_case.inj res)) + in + def "operation.alpha.successful_manager_operation_result" + @@ union + [ make Manager_result.reveal_case; + make Manager_result.transaction_case; + make Manager_result.origination_case; + make Manager_result.delegation_case ] + type 'kind contents_result = | Endorsement_result : { balance_updates : Receipt.balance_updates; @@ -1237,6 +1263,8 @@ type block_metadata = { consumed_gas : Gas.Arith.fp; deactivated : Signature.Public_key_hash.t list; balance_updates : Receipt.balance_updates; + liquidity_baking_escape_ema : int32; + implicit_operations_results : packed_successful_manager_operation_result list; } let block_metadata_encoding = @@ -1251,25 +1279,31 @@ let block_metadata_encoding = nonce_hash; consumed_gas; deactivated; - balance_updates } -> - ( baker, - level, - level_info, - voting_period_kind, - voting_period_info, - nonce_hash, - consumed_gas, - deactivated, - balance_updates )) - (fun ( baker, - level, - level_info, - voting_period_kind, - voting_period_info, - nonce_hash, - consumed_gas, - deactivated, - balance_updates ) -> + balance_updates; + liquidity_baking_escape_ema; + implicit_operations_results } -> + ( ( baker, + level, + level_info, + voting_period_kind, + voting_period_info, + nonce_hash, + consumed_gas, + deactivated, + balance_updates, + liquidity_baking_escape_ema ), + implicit_operations_results )) + (fun ( ( baker, + level, + level_info, + voting_period_kind, + voting_period_info, + nonce_hash, + consumed_gas, + deactivated, + balance_updates, + liquidity_baking_escape_ema ), + implicit_operations_results ) -> { baker; level; @@ -1280,21 +1314,29 @@ let block_metadata_encoding = consumed_gas; deactivated; balance_updates; + liquidity_baking_escape_ema; + implicit_operations_results; }) - (obj9 - (req "baker" Signature.Public_key_hash.encoding) - (req - ~description:"This field is DEPRECATED: use level_info instead" - "level" - Level.compat_encoding) - (req "level_info" Level.encoding) - (req - ~description: - "This field is DEPRECATED: use voting_period_info instead" - "voting_period_kind" - Voting_period.kind_encoding) - (req "voting_period_info" Voting_period.info_encoding) - (req "nonce_hash" (option Nonce_hash.encoding)) - (req "consumed_gas" Gas.Arith.n_fp_encoding) - (req "deactivated" (list Signature.Public_key_hash.encoding)) - (req "balance_updates" Receipt.balance_updates_encoding)) + (merge_objs + (obj10 + (req "baker" Signature.Public_key_hash.encoding) + (req + ~description:"This field is DEPRECATED: use level_info instead" + "level" + Level.compat_encoding) + (req "level_info" Level.encoding) + (req + ~description: + "This field is DEPRECATED: use voting_period_info instead" + "voting_period_kind" + Voting_period.kind_encoding) + (req "voting_period_info" Voting_period.info_encoding) + (req "nonce_hash" (option Nonce_hash.encoding)) + (req "consumed_gas" Gas.Arith.n_fp_encoding) + (req "deactivated" (list Signature.Public_key_hash.encoding)) + (req "balance_updates" Receipt.balance_updates_encoding) + (req "liquidity_baking_escape_ema" int32)) + (obj1 + (req + "implicit_operations_results" + (list successful_manager_operation_result_encoding)))) diff --git a/src/proto_alpha/lib_protocol/apply_results.mli b/src/proto_alpha/lib_protocol/apply_results.mli index ac2877daa1c6d8ccab23bfd232f1c558e9978baf..f056a57cc59c1868e0cb8ee9f41b487bfadb5cc8 100644 --- a/src/proto_alpha/lib_protocol/apply_results.mli +++ b/src/proto_alpha/lib_protocol/apply_results.mli @@ -191,6 +191,8 @@ type block_metadata = { consumed_gas : Gas.Arith.fp; deactivated : Signature.Public_key_hash.t list; balance_updates : Receipt.balance_updates; + liquidity_baking_escape_ema : int32; + implicit_operations_results : packed_successful_manager_operation_result list; } val block_metadata_encoding : block_metadata Data_encoding.encoding diff --git a/src/proto_alpha/lib_protocol/block_header_repr.ml b/src/proto_alpha/lib_protocol/block_header_repr.ml index faf827278a93f29888bc1be9b967581fe91e74c7..72363616a0fd184149bcee21362180733cef2502 100644 --- a/src/proto_alpha/lib_protocol/block_header_repr.ml +++ b/src/proto_alpha/lib_protocol/block_header_repr.ml @@ -29,6 +29,7 @@ type contents = { priority : int; seed_nonce_hash : Nonce_hash.t option; proof_of_work_nonce : bytes; + liquidity_baking_escape_vote : bool; } type protocol_data = {contents : contents; signature : Signature.t} @@ -49,16 +50,31 @@ let contents_encoding = let open Data_encoding in def "block_header.alpha.unsigned_contents" @@ conv - (fun {priority; seed_nonce_hash; proof_of_work_nonce} -> - (priority, proof_of_work_nonce, seed_nonce_hash)) - (fun (priority, proof_of_work_nonce, seed_nonce_hash) -> - {priority; seed_nonce_hash; proof_of_work_nonce}) - (obj3 + (fun { priority; + seed_nonce_hash; + proof_of_work_nonce; + liquidity_baking_escape_vote } -> + ( priority, + proof_of_work_nonce, + seed_nonce_hash, + liquidity_baking_escape_vote )) + (fun ( priority, + proof_of_work_nonce, + seed_nonce_hash, + liquidity_baking_escape_vote ) -> + { + priority; + seed_nonce_hash; + proof_of_work_nonce; + liquidity_baking_escape_vote; + }) + (obj4 (req "priority" uint16) (req "proof_of_work_nonce" (Fixed.bytes Constants_repr.proof_of_work_nonce_size)) - (opt "seed_nonce_hash" Nonce_hash.encoding)) + (opt "seed_nonce_hash" Nonce_hash.encoding) + (req "liquidity_baking_escape_vote" Data_encoding.bool)) let protocol_data_encoding = let open Data_encoding in @@ -108,6 +124,7 @@ let max_header_length = proof_of_work_nonce = Bytes.make Constants_repr.proof_of_work_nonce_size '0'; seed_nonce_hash = Some Nonce_hash.zero; + liquidity_baking_escape_vote = false; } in Data_encoding.Binary.length diff --git a/src/proto_alpha/lib_protocol/block_header_repr.mli b/src/proto_alpha/lib_protocol/block_header_repr.mli index 374a0640ea1ea3ea47e8b134baf11c766cfb6172..65526cef810916c384a22679591c58fae19b29fc 100644 --- a/src/proto_alpha/lib_protocol/block_header_repr.mli +++ b/src/proto_alpha/lib_protocol/block_header_repr.mli @@ -27,6 +27,8 @@ type contents = { priority : int; seed_nonce_hash : Nonce_hash.t option; proof_of_work_nonce : bytes; + liquidity_baking_escape_vote : bool; + (* set by baker to vote in favor of permanently disabling liquidity baking *) } type protocol_data = {contents : contents; signature : Signature.t} diff --git a/src/proto_alpha/lib_protocol/bootstrap_storage.ml b/src/proto_alpha/lib_protocol/bootstrap_storage.ml index 26b59dfd0200d8312cc8069c651c2786667f5700..34e670b7aeec476f36be0369eeb88a1f76423063 100644 --- a/src/proto_alpha/lib_protocol/bootstrap_storage.ml +++ b/src/proto_alpha/lib_protocol/bootstrap_storage.ml @@ -51,7 +51,7 @@ let init_contract ~typecheck ctxt ~balance:amount ~prepaid_bootstrap_storage:true ~script - ~delegate:(Some delegate) + ~delegate let init ctxt ~typecheck ?ramp_up_cycles ?no_reward_cycles accounts contracts = let nonce = diff --git a/src/proto_alpha/lib_protocol/constants_repr.ml b/src/proto_alpha/lib_protocol/constants_repr.ml index 1697fc966de404e112e36d00f530ec41fdf21921..2596f5a4af4910094451e28e692050c9fb4b7a65 100644 --- a/src/proto_alpha/lib_protocol/constants_repr.ml +++ b/src/proto_alpha/lib_protocol/constants_repr.ml @@ -115,6 +115,9 @@ type parametric = { min_proposal_quorum : int32; initial_endorsers : int; delay_per_missing_endorsement : Period_repr.t; + liquidity_baking_subsidy : Tez_repr.t; + liquidity_baking_sunset_duration : int32; + liquidity_baking_escape_ema_threshold : int32; } let parametric_encoding = @@ -129,29 +132,26 @@ let parametric_encoding = c.time_between_blocks, c.endorsers_per_block, c.hard_gas_limit_per_operation, - c.hard_gas_limit_per_block ), - ( ( c.proof_of_work_threshold, - c.tokens_per_roll, + c.hard_gas_limit_per_block, + c.proof_of_work_threshold ), + ( ( c.tokens_per_roll, c.michelson_maximum_type_size, c.seed_nonce_revelation_tip, c.origination_size, c.block_security_deposit, c.endorsement_security_deposit, - c.baking_reward_per_endorsement ), - ( c.endorsement_reward, + c.baking_reward_per_endorsement, + c.endorsement_reward, c.cost_per_byte, - c.hard_storage_limit_per_operation, - 0L, - (* At this position in the encoding we used to have a test - chain duration but it is not used anymore and should be - removed when this encoding is updated. When the test - chain was removed, we did not want to change the - encoding for retrocompatibility. *) - c.quorum_min, + c.hard_storage_limit_per_operation ), + ( c.quorum_min, c.quorum_max, c.min_proposal_quorum, c.initial_endorsers, - c.delay_per_missing_endorsement ) ) )) + c.delay_per_missing_endorsement, + c.liquidity_baking_subsidy, + c.liquidity_baking_sunset_duration, + c.liquidity_baking_escape_ema_threshold ) ) )) (fun ( ( preserved_cycles, blocks_per_cycle, blocks_per_commitment, @@ -160,24 +160,26 @@ let parametric_encoding = time_between_blocks, endorsers_per_block, hard_gas_limit_per_operation, - hard_gas_limit_per_block ), - ( ( proof_of_work_threshold, - tokens_per_roll, + hard_gas_limit_per_block, + proof_of_work_threshold ), + ( ( tokens_per_roll, michelson_maximum_type_size, seed_nonce_revelation_tip, origination_size, block_security_deposit, endorsement_security_deposit, - baking_reward_per_endorsement ), - ( endorsement_reward, + baking_reward_per_endorsement, + endorsement_reward, cost_per_byte, - hard_storage_limit_per_operation, - _test_chain_duration, - quorum_min, + hard_storage_limit_per_operation ), + ( quorum_min, quorum_max, min_proposal_quorum, initial_endorsers, - delay_per_missing_endorsement ) ) ) -> + delay_per_missing_endorsement, + liquidity_baking_subsidy, + liquidity_baking_sunset_duration, + liquidity_baking_escape_ema_threshold ) ) ) -> { preserved_cycles; blocks_per_cycle; @@ -204,9 +206,12 @@ let parametric_encoding = min_proposal_quorum; initial_endorsers; delay_per_missing_endorsement; + liquidity_baking_subsidy; + liquidity_baking_sunset_duration; + liquidity_baking_escape_ema_threshold; }) (merge_objs - (obj9 + (obj10 (req "preserved_cycles" uint8) (req "blocks_per_cycle" int32) (req "blocks_per_commitment" int32) @@ -219,27 +224,29 @@ let parametric_encoding = Gas_limit_repr.Arith.z_integral_encoding) (req "hard_gas_limit_per_block" - Gas_limit_repr.Arith.z_integral_encoding)) + Gas_limit_repr.Arith.z_integral_encoding) + (req "proof_of_work_threshold" int64)) (merge_objs - (obj8 - (req "proof_of_work_threshold" int64) + (obj10 (req "tokens_per_roll" Tez_repr.encoding) (req "michelson_maximum_type_size" uint16) (req "seed_nonce_revelation_tip" Tez_repr.encoding) (req "origination_size" int31) (req "block_security_deposit" Tez_repr.encoding) (req "endorsement_security_deposit" Tez_repr.encoding) - (req "baking_reward_per_endorsement" (list Tez_repr.encoding))) - (obj9 + (req "baking_reward_per_endorsement" (list Tez_repr.encoding)) (req "endorsement_reward" (list Tez_repr.encoding)) (req "cost_per_byte" Tez_repr.encoding) - (req "hard_storage_limit_per_operation" z) - (req "test_chain_duration" int64) + (req "hard_storage_limit_per_operation" z)) + (obj8 (req "quorum_min" int32) (req "quorum_max" int32) (req "min_proposal_quorum" int32) (req "initial_endorsers" uint16) - (req "delay_per_missing_endorsement" Period_repr.encoding)))) + (req "delay_per_missing_endorsement" Period_repr.encoding) + (req "liquidity_baking_subsidy" Tez_repr.encoding) + (req "liquidity_baking_sunset_duration" int32) + (req "liquidity_baking_escape_ema_threshold" int32)))) type t = {fixed : fixed; parametric : parametric} @@ -249,3 +256,155 @@ let encoding = (fun {fixed; parametric} -> (fixed, parametric)) (fun (fixed, parametric) -> {fixed; parametric}) (merge_objs fixed_encoding parametric_encoding) + +module Proto_previous = struct + type parametric = { + preserved_cycles : int; + blocks_per_cycle : int32; + blocks_per_commitment : int32; + blocks_per_roll_snapshot : int32; + blocks_per_voting_period : int32; + time_between_blocks : Period_repr.t list; + endorsers_per_block : int; + hard_gas_limit_per_operation : Gas_limit_repr.Arith.integral; + hard_gas_limit_per_block : Gas_limit_repr.Arith.integral; + proof_of_work_threshold : int64; + tokens_per_roll : Tez_repr.t; + michelson_maximum_type_size : int; + seed_nonce_revelation_tip : Tez_repr.t; + origination_size : int; + block_security_deposit : Tez_repr.t; + endorsement_security_deposit : Tez_repr.t; + baking_reward_per_endorsement : Tez_repr.t list; + endorsement_reward : Tez_repr.t list; + cost_per_byte : Tez_repr.t; + hard_storage_limit_per_operation : Z.t; + test_chain_duration : int64; + (* in seconds *) + quorum_min : int32; + quorum_max : int32; + min_proposal_quorum : int32; + initial_endorsers : int; + delay_per_missing_endorsement : Period_repr.t; + } + + let parametric_encoding = + let open Data_encoding in + conv + (fun c -> + ( ( c.preserved_cycles, + c.blocks_per_cycle, + c.blocks_per_commitment, + c.blocks_per_roll_snapshot, + c.blocks_per_voting_period, + c.time_between_blocks, + c.endorsers_per_block, + c.hard_gas_limit_per_operation, + c.hard_gas_limit_per_block ), + ( ( c.proof_of_work_threshold, + c.tokens_per_roll, + c.michelson_maximum_type_size, + c.seed_nonce_revelation_tip, + c.origination_size, + c.block_security_deposit, + c.endorsement_security_deposit, + c.baking_reward_per_endorsement ), + ( c.endorsement_reward, + c.cost_per_byte, + c.hard_storage_limit_per_operation, + c.test_chain_duration, + c.quorum_min, + c.quorum_max, + c.min_proposal_quorum, + c.initial_endorsers, + c.delay_per_missing_endorsement ) ) )) + (fun ( ( preserved_cycles, + blocks_per_cycle, + blocks_per_commitment, + blocks_per_roll_snapshot, + blocks_per_voting_period, + time_between_blocks, + endorsers_per_block, + hard_gas_limit_per_operation, + hard_gas_limit_per_block ), + ( ( proof_of_work_threshold, + tokens_per_roll, + michelson_maximum_type_size, + seed_nonce_revelation_tip, + origination_size, + block_security_deposit, + endorsement_security_deposit, + baking_reward_per_endorsement ), + ( endorsement_reward, + cost_per_byte, + hard_storage_limit_per_operation, + test_chain_duration, + quorum_min, + quorum_max, + min_proposal_quorum, + initial_endorsers, + delay_per_missing_endorsement ) ) ) -> + { + preserved_cycles; + blocks_per_cycle; + blocks_per_commitment; + blocks_per_roll_snapshot; + blocks_per_voting_period; + time_between_blocks; + endorsers_per_block; + hard_gas_limit_per_operation; + hard_gas_limit_per_block; + proof_of_work_threshold; + tokens_per_roll; + michelson_maximum_type_size; + seed_nonce_revelation_tip; + origination_size; + block_security_deposit; + endorsement_security_deposit; + baking_reward_per_endorsement; + endorsement_reward; + cost_per_byte; + hard_storage_limit_per_operation; + test_chain_duration; + quorum_min; + quorum_max; + min_proposal_quorum; + initial_endorsers; + delay_per_missing_endorsement; + }) + (merge_objs + (obj9 + (req "preserved_cycles" uint8) + (req "blocks_per_cycle" int32) + (req "blocks_per_commitment" int32) + (req "blocks_per_roll_snapshot" int32) + (req "blocks_per_voting_period" int32) + (req "time_between_blocks" (list Period_repr.encoding)) + (req "endorsers_per_block" uint16) + (req + "hard_gas_limit_per_operation" + Gas_limit_repr.Arith.z_integral_encoding) + (req + "hard_gas_limit_per_block" + Gas_limit_repr.Arith.z_integral_encoding)) + (merge_objs + (obj8 + (req "proof_of_work_threshold" int64) + (req "tokens_per_roll" Tez_repr.encoding) + (req "michelson_maximum_type_size" uint16) + (req "seed_nonce_revelation_tip" Tez_repr.encoding) + (req "origination_size" int31) + (req "block_security_deposit" Tez_repr.encoding) + (req "endorsement_security_deposit" Tez_repr.encoding) + (req "baking_reward_per_endorsement" (list Tez_repr.encoding))) + (obj9 + (req "endorsement_reward" (list Tez_repr.encoding)) + (req "cost_per_byte" Tez_repr.encoding) + (req "hard_storage_limit_per_operation" z) + (req "test_chain_duration" int64) + (req "quorum_min" int32) + (req "quorum_max" int32) + (req "min_proposal_quorum" int32) + (req "initial_endorsers" uint16) + (req "delay_per_missing_endorsement" Period_repr.encoding)))) +end diff --git a/src/proto_alpha/lib_protocol/constants_repr.mli b/src/proto_alpha/lib_protocol/constants_repr.mli index 3d560ee1ba7afc0912706fe9c324a4c31db7e36c..9ac4358282a11320b4bb51846f5adad128d8d355 100644 --- a/src/proto_alpha/lib_protocol/constants_repr.mli +++ b/src/proto_alpha/lib_protocol/constants_repr.mli @@ -77,6 +77,9 @@ type parametric = { min_proposal_quorum : int32; initial_endorsers : int; delay_per_missing_endorsement : Period_repr.t; + liquidity_baking_subsidy : Tez_repr.t; + liquidity_baking_sunset_duration : int32; + liquidity_baking_escape_ema_threshold : int32; } val parametric_encoding : parametric Data_encoding.encoding @@ -84,3 +87,37 @@ val parametric_encoding : parametric Data_encoding.encoding type t = {fixed : fixed; parametric : parametric} val encoding : t Data_encoding.encoding + +module Proto_previous : sig + type parametric = { + preserved_cycles : int; + blocks_per_cycle : int32; + blocks_per_commitment : int32; + blocks_per_roll_snapshot : int32; + blocks_per_voting_period : int32; + time_between_blocks : Period_repr.t list; + endorsers_per_block : int; + hard_gas_limit_per_operation : Gas_limit_repr.Arith.integral; + hard_gas_limit_per_block : Gas_limit_repr.Arith.integral; + proof_of_work_threshold : int64; + tokens_per_roll : Tez_repr.t; + michelson_maximum_type_size : int; + seed_nonce_revelation_tip : Tez_repr.t; + origination_size : int; + block_security_deposit : Tez_repr.t; + endorsement_security_deposit : Tez_repr.t; + baking_reward_per_endorsement : Tez_repr.t list; + endorsement_reward : Tez_repr.t list; + cost_per_byte : Tez_repr.t; + hard_storage_limit_per_operation : Z.t; + test_chain_duration : int64; + (* in seconds *) + quorum_min : int32; + quorum_max : int32; + min_proposal_quorum : int32; + initial_endorsers : int; + delay_per_missing_endorsement : Period_repr.t; + } + + val parametric_encoding : parametric Data_encoding.encoding +end diff --git a/src/proto_alpha/lib_protocol/constants_storage.ml b/src/proto_alpha/lib_protocol/constants_storage.ml index 772b11e875bc2ddda890b995375926f97da42e59..c8ac586717f394ee3bd83f51a0f8dcc6c1066582 100644 --- a/src/proto_alpha/lib_protocol/constants_storage.ml +++ b/src/proto_alpha/lib_protocol/constants_storage.ml @@ -123,4 +123,16 @@ let min_proposal_quorum c = let constants = Raw_context.constants c in constants.min_proposal_quorum +let liquidity_baking_subsidy c = + let constants = Raw_context.constants c in + constants.liquidity_baking_subsidy + +let liquidity_baking_sunset_duration c = + let constants = Raw_context.constants c in + constants.liquidity_baking_sunset_duration + +let liquidity_baking_escape_ema_threshold c = + let constants = Raw_context.constants c in + constants.liquidity_baking_escape_ema_threshold + let parametric c = Raw_context.constants c diff --git a/src/proto_alpha/lib_protocol/constants_storage.mli b/src/proto_alpha/lib_protocol/constants_storage.mli index 34fa2f6228b1bdad0a2dca6b8030321de072087e..8d579bccb67caf3c3c477463becfd8ba579d8b77 100644 --- a/src/proto_alpha/lib_protocol/constants_storage.mli +++ b/src/proto_alpha/lib_protocol/constants_storage.mli @@ -75,4 +75,10 @@ val quorum_max : Raw_context.t -> int32 val min_proposal_quorum : Raw_context.t -> int32 +val liquidity_baking_subsidy : Raw_context.t -> Tez_repr.t + +val liquidity_baking_sunset_duration : Raw_context.t -> int32 + +val liquidity_baking_escape_ema_threshold : Raw_context.t -> int32 + val parametric : Raw_context.t -> Constants_repr.parametric diff --git a/src/proto_alpha/lib_protocol/dune.inc b/src/proto_alpha/lib_protocol/dune.inc index d859045eda8a4d965bdf9bbf1546bd41f50d6311..50d455bcd0470f7b5dd1e5e992f05c315505a0f3 100644 --- a/src/proto_alpha/lib_protocol/dune.inc +++ b/src/proto_alpha/lib_protocol/dune.inc @@ -32,6 +32,7 @@ module CamlinternalFormatBasics = struct include CamlinternalFormatBasics end fixed_point_repr.mli fixed_point_repr.ml saturation_repr.mli saturation_repr.ml gas_limit_repr.mli gas_limit_repr.ml + contract_repr.mli contract_repr.ml constants_repr.mli constants_repr.ml fitness_repr.mli fitness_repr.ml raw_level_repr.mli raw_level_repr.ml @@ -43,7 +44,6 @@ module CamlinternalFormatBasics = struct include CamlinternalFormatBasics end script_timestamp_repr.mli script_timestamp_repr.ml michelson_v1_primitives.mli michelson_v1_primitives.ml script_repr.mli script_repr.ml - contract_repr.mli contract_repr.ml roll_repr.mli roll_repr.ml vote_repr.mli vote_repr.ml block_header_repr.mli block_header_repr.ml @@ -74,6 +74,10 @@ module CamlinternalFormatBasics = struct include CamlinternalFormatBasics end voting_period_storage.mli voting_period_storage.ml vote_storage.mli vote_storage.ml commitment_storage.mli commitment_storage.ml + liquidity_baking_cpmm.ml + liquidity_baking_lqt.ml + liquidity_baking_test_fa12.ml + liquidity_baking_storage.mli liquidity_baking_storage.ml init_storage.mli init_storage.ml fees_storage.mli fees_storage.ml sapling_validator.ml @@ -119,6 +123,7 @@ module CamlinternalFormatBasics = struct include CamlinternalFormatBasics end fixed_point_repr.mli fixed_point_repr.ml saturation_repr.mli saturation_repr.ml gas_limit_repr.mli gas_limit_repr.ml + contract_repr.mli contract_repr.ml constants_repr.mli constants_repr.ml fitness_repr.mli fitness_repr.ml raw_level_repr.mli raw_level_repr.ml @@ -130,7 +135,6 @@ module CamlinternalFormatBasics = struct include CamlinternalFormatBasics end script_timestamp_repr.mli script_timestamp_repr.ml michelson_v1_primitives.mli michelson_v1_primitives.ml script_repr.mli script_repr.ml - contract_repr.mli contract_repr.ml roll_repr.mli roll_repr.ml vote_repr.mli vote_repr.ml block_header_repr.mli block_header_repr.ml @@ -161,6 +165,10 @@ module CamlinternalFormatBasics = struct include CamlinternalFormatBasics end voting_period_storage.mli voting_period_storage.ml vote_storage.mli vote_storage.ml commitment_storage.mli commitment_storage.ml + liquidity_baking_cpmm.ml + liquidity_baking_lqt.ml + liquidity_baking_test_fa12.ml + liquidity_baking_storage.mli liquidity_baking_storage.ml init_storage.mli init_storage.ml fees_storage.mli fees_storage.ml sapling_validator.ml @@ -206,6 +214,7 @@ module CamlinternalFormatBasics = struct include CamlinternalFormatBasics end fixed_point_repr.mli fixed_point_repr.ml saturation_repr.mli saturation_repr.ml gas_limit_repr.mli gas_limit_repr.ml + contract_repr.mli contract_repr.ml constants_repr.mli constants_repr.ml fitness_repr.mli fitness_repr.ml raw_level_repr.mli raw_level_repr.ml @@ -217,7 +226,6 @@ module CamlinternalFormatBasics = struct include CamlinternalFormatBasics end script_timestamp_repr.mli script_timestamp_repr.ml michelson_v1_primitives.mli michelson_v1_primitives.ml script_repr.mli script_repr.ml - contract_repr.mli contract_repr.ml roll_repr.mli roll_repr.ml vote_repr.mli vote_repr.ml block_header_repr.mli block_header_repr.ml @@ -248,6 +256,10 @@ module CamlinternalFormatBasics = struct include CamlinternalFormatBasics end voting_period_storage.mli voting_period_storage.ml vote_storage.mli vote_storage.ml commitment_storage.mli commitment_storage.ml + liquidity_baking_cpmm.ml + liquidity_baking_lqt.ml + liquidity_baking_test_fa12.ml + liquidity_baking_storage.mli liquidity_baking_storage.ml init_storage.mli init_storage.ml fees_storage.mli fees_storage.ml sapling_validator.ml @@ -313,6 +325,7 @@ include Tezos_raw_protocol_alpha.Main Fixed_point_repr Saturation_repr Gas_limit_repr + Contract_repr Constants_repr Fitness_repr Raw_level_repr @@ -324,7 +337,6 @@ include Tezos_raw_protocol_alpha.Main Script_timestamp_repr Michelson_v1_primitives Script_repr - Contract_repr Roll_repr Vote_repr Block_header_repr @@ -355,6 +367,10 @@ include Tezos_raw_protocol_alpha.Main Voting_period_storage Vote_storage Commitment_storage + Liquidity_baking_cpmm + Liquidity_baking_lqt + Liquidity_baking_test_fa12 + Liquidity_baking_storage Init_storage Fees_storage Sapling_validator @@ -436,6 +452,7 @@ include Tezos_raw_protocol_alpha.Main fixed_point_repr.mli fixed_point_repr.ml saturation_repr.mli saturation_repr.ml gas_limit_repr.mli gas_limit_repr.ml + contract_repr.mli contract_repr.ml constants_repr.mli constants_repr.ml fitness_repr.mli fitness_repr.ml raw_level_repr.mli raw_level_repr.ml @@ -447,7 +464,6 @@ include Tezos_raw_protocol_alpha.Main script_timestamp_repr.mli script_timestamp_repr.ml michelson_v1_primitives.mli michelson_v1_primitives.ml script_repr.mli script_repr.ml - contract_repr.mli contract_repr.ml roll_repr.mli roll_repr.ml vote_repr.mli vote_repr.ml block_header_repr.mli block_header_repr.ml @@ -478,6 +494,10 @@ include Tezos_raw_protocol_alpha.Main voting_period_storage.mli voting_period_storage.ml vote_storage.mli vote_storage.ml commitment_storage.mli commitment_storage.ml + liquidity_baking_cpmm.ml + liquidity_baking_lqt.ml + liquidity_baking_test_fa12.ml + liquidity_baking_storage.mli liquidity_baking_storage.ml init_storage.mli init_storage.ml fees_storage.mli fees_storage.ml sapling_validator.ml diff --git a/src/proto_alpha/lib_protocol/fees_storage.ml b/src/proto_alpha/lib_protocol/fees_storage.ml index ddd82707c321e9697eda35863457b0354a79506b..3f6f855d61e68d7244d6acccd590aeda0ca98945 100644 --- a/src/proto_alpha/lib_protocol/fees_storage.ml +++ b/src/proto_alpha/lib_protocol/fees_storage.ml @@ -81,6 +81,19 @@ let record_paid_storage_space c contract = ( Tez_repr.(cost_per_byte *? Z.to_int64 to_be_paid) >|? fun to_burn -> (c, size, to_be_paid, to_burn) ) +let record_paid_storage_space_subsidy c contract = + match Raw_context.storage_space_to_pay c with + | Some _ -> + assert false + | None -> + Contract_storage.used_storage_space c contract + >>=? fun size -> + Contract_storage.set_paid_storage_space_and_return_fees_to_pay + c + contract + size + >>=? fun (to_be_paid, c) -> return (c, size, to_be_paid) + let burn_storage_fees c ~storage_limit ~payer = let origination_size = Constants_storage.origination_size c in let (c, storage_space_to_pay, allocated_contracts) = diff --git a/src/proto_alpha/lib_protocol/fees_storage.mli b/src/proto_alpha/lib_protocol/fees_storage.mli index 8e6a417c63932313b8bd0883666726b3ce43527e..a4691c5ff21bfce762a2727cc659777fd29a2d5f 100644 --- a/src/proto_alpha/lib_protocol/fees_storage.mli +++ b/src/proto_alpha/lib_protocol/fees_storage.mli @@ -38,6 +38,14 @@ val record_paid_storage_space : Contract_repr.t -> (Raw_context.t * Z.t * Z.t * Tez_repr.t) tzresult Lwt.t +(** Record paid storage space for contract without burn. + For use only in subsidies. + Will fail if storage_space_to_pay has been initialized.*) +val record_paid_storage_space_subsidy : + Raw_context.t -> + Contract_repr.t -> + (Raw_context.t * Z.t * Z.t) tzresult Lwt.t + val check_storage_limit : Raw_context.t -> storage_limit:Z.t -> unit tzresult val start_counting_storage_fees : Raw_context.t -> Raw_context.t diff --git a/src/proto_alpha/lib_protocol/helpers_services.ml b/src/proto_alpha/lib_protocol/helpers_services.ml index 7c7183623415612ec9ea9ed6ce24404cfe852d25..12147317a92a91f82b2b4f4d984f9432ddabee63 100644 --- a/src/proto_alpha/lib_protocol/helpers_services.ml +++ b/src/proto_alpha/lib_protocol/helpers_services.ml @@ -852,13 +852,14 @@ module Forge = struct ~description:"Forge the protocol-specific part of a block header" ~query:RPC_query.empty ~input: - (obj3 + (obj4 (req "priority" uint16) (opt "nonce_hash" Nonce_hash.encoding) (dft "proof_of_work_nonce" (Fixed.bytes Alpha_context.Constants.proof_of_work_nonce_size) - empty_proof_of_work_nonce)) + empty_proof_of_work_nonce) + (req "liquidity_baking_escape_vote" bool)) ~output:(obj1 (req "protocol_data" bytes)) RPC_path.(path / "protocol_data") end @@ -872,11 +873,21 @@ module Forge = struct (shell, proto))) ; register0_noctxt S.protocol_data - (fun () (priority, seed_nonce_hash, proof_of_work_nonce) -> + (fun () + ( priority, + seed_nonce_hash, + proof_of_work_nonce, + liquidity_baking_escape_vote ) + -> return (Data_encoding.Binary.to_bytes_exn Block_header.contents_encoding - {priority; seed_nonce_hash; proof_of_work_nonce})) + { + priority; + seed_nonce_hash; + proof_of_work_nonce; + liquidity_baking_escape_vote; + })) module Manager = struct let[@coq_axiom_with_reason "cast on e"] operations ctxt block ~branch @@ -1030,13 +1041,17 @@ module Forge = struct Bytes.make Constants_repr.proof_of_work_nonce_size '\000' let protocol_data ctxt block ~priority ?seed_nonce_hash - ?(proof_of_work_nonce = empty_proof_of_work_nonce) () = + ?(proof_of_work_nonce = empty_proof_of_work_nonce) + ~liquidity_baking_escape_vote () = RPC_context.make_call0 S.protocol_data ctxt block () - (priority, seed_nonce_hash, proof_of_work_nonce) + ( priority, + seed_nonce_hash, + proof_of_work_nonce, + liquidity_baking_escape_vote ) end module Parse = struct diff --git a/src/proto_alpha/lib_protocol/helpers_services.mli b/src/proto_alpha/lib_protocol/helpers_services.mli index 399a441929bc3a470721c03253091873d347f4e3..de50450bc82ee8cdccbe8302a12afb122d471c9f 100644 --- a/src/proto_alpha/lib_protocol/helpers_services.mli +++ b/src/proto_alpha/lib_protocol/helpers_services.mli @@ -289,6 +289,7 @@ module Forge : sig priority:int -> ?seed_nonce_hash:Nonce_hash.t -> ?proof_of_work_nonce:bytes -> + liquidity_baking_escape_vote:bool -> unit -> bytes shell_tzresult Lwt.t end diff --git a/src/proto_alpha/lib_protocol/init_storage.ml b/src/proto_alpha/lib_protocol/init_storage.ml index 6ed181c481e9f9950c3679d7ae4753779266872a..bd364e1570634b7aff8f97618b21f9d7e54a536c 100644 --- a/src/proto_alpha/lib_protocol/init_storage.ml +++ b/src/proto_alpha/lib_protocol/init_storage.ml @@ -74,7 +74,9 @@ let prepare_first_block ctxt ~typecheck ~level ~timestamp ~fitness = ~start_position:(Level_storage.current ctxt).level_position >>=? fun ctxt -> Storage.Block_priority.init ctxt 0 - >>=? fun ctxt -> Vote_storage.update_listings ctxt + >>=? fun ctxt -> + Vote_storage.update_listings ctxt + >>=? fun ctxt -> Liquidity_baking_storage.init_test ctxt | Edo_008 -> (* Add balance updates receipts to be attached on the first block of this protocol - see [[prepare]] function below. Any balance updates attached @@ -86,6 +88,7 @@ let prepare_first_block ctxt ~typecheck ~level ~timestamp ~fitness = ~amount_mutez:100_000_000L >>= fun (ctxt, balance_updates) -> Storage.Pending_migration_balance_updates.init ctxt balance_updates + >>=? fun ctxt -> Liquidity_baking_storage.init ctxt let prepare ctxt ~level ~predecessor_timestamp ~timestamp ~fitness = Raw_context.prepare ~level ~predecessor_timestamp ~timestamp ~fitness ctxt diff --git a/src/proto_alpha/lib_protocol/liquidity_baking_cpmm.ml b/src/proto_alpha/lib_protocol/liquidity_baking_cpmm.ml new file mode 100644 index 0000000000000000000000000000000000000000..fb45fc8d55466970fb1f11ded6162799cfcc8d46 --- /dev/null +++ b/src/proto_alpha/lib_protocol/liquidity_baking_cpmm.ml @@ -0,0 +1,10154 @@ +open Michelson_v1_primitives +open Micheline + +let script = + Seq + ( 0, + [ Prim + ( 1, + K_parameter, + [ Prim + ( 2, + T_or, + [ Prim + ( 3, + T_or, + [ Prim + ( 4, + T_or, + [ Prim + ( 5, + T_pair, + [ Prim (6, T_address, [], ["%owner"]); + Prim + ( 7, + T_pair, + [ Prim + (8, T_nat, [], ["%minLqtMinted"]); + Prim + ( 9, + T_pair, + [ Prim + ( 10, + T_nat, + [], + ["%maxTokensDeposited"] + ); + Prim + ( 11, + T_timestamp, + [], + ["%deadline"] ) ], + [] ) ], + [] ) ], + ["%addLiquidity"] ); + Prim (12, T_unit, [], ["%default"]) ], + [] ); + Prim + ( 13, + T_or, + [ Prim + ( 14, + T_pair, + [ Prim (15, T_address, [], ["%to"]); + Prim + ( 16, + T_pair, + [ Prim (17, T_nat, [], ["%lqtBurned"]); + Prim + ( 18, + T_pair, + [ Prim + ( 19, + T_mutez, + [], + ["%minXtzWithdrawn"] ); + Prim + ( 20, + T_pair, + [ Prim + ( 21, + T_nat, + [], + [ "%minTokensWithdrawn" + ] ); + Prim + ( 22, + T_timestamp, + [], + ["%deadline"] ) ], + [] ) ], + [] ) ], + [] ) ], + ["%removeLiquidity"] ); + Prim + ( 23, + T_pair, + [ Prim (24, T_address, [], ["%to"]); + Prim + ( 25, + T_pair, + [ Prim + (26, T_nat, [], ["%tokensSold"]); + Prim + ( 27, + T_pair, + [ Prim + ( 28, + T_mutez, + [], + ["%minXtzBought"] ); + Prim + ( 29, + T_timestamp, + [], + ["%deadline"] ) ], + [] ) ], + [] ) ], + ["%tokenToXtz"] ) ], + [] ) ], + [] ); + Prim + ( 30, + T_or, + [ Prim + ( 31, + T_or, + [ Prim (32, T_unit, [], ["%updateTokenPool"]); + Prim + (33, T_nat, [], ["%updateTokenPoolInternal"]) + ], + [] ); + Prim + ( 34, + T_pair, + [ Prim (35, T_address, [], ["%to"]); + Prim + ( 36, + T_pair, + [ Prim (37, T_nat, [], ["%minTokensBought"]); + Prim (38, T_timestamp, [], ["%deadline"]) + ], + [] ) ], + ["%xtzToToken"] ) ], + [] ) ], + [] ) ], + [] ); + Prim + ( 39, + K_storage, + [ Prim + ( 40, + T_pair, + [ Prim (41, T_nat, [], ["%tokenPool"]); + Prim + ( 42, + T_pair, + [ Prim (43, T_mutez, [], ["%xtzPool"]); + Prim + ( 44, + T_pair, + [ Prim (45, T_nat, [], ["%lqtTotal"]); + Prim + ( 46, + T_pair, + [ Prim + ( 47, + T_bool, + [], + ["%selfIsUpdatingTokenPool"] ); + Prim + ( 48, + T_pair, + [ Prim + ( 49, + T_address, + [], + ["%tokenAddress"] ); + Prim + ( 50, + T_address, + [], + ["%lqtAddress"] ) ], + [] ) ], + [] ) ], + [] ) ], + [] ) ], + [] ) ], + [] ); + Prim + ( 51, + K_code, + [ Seq + ( 52, + [ Prim (53, I_DUP, [], []); + Prim (54, I_CDR, [], []); + Prim (55, I_SWAP, [], []); + Prim (56, I_CAR, [], []); + Prim + ( 57, + I_IF_LEFT, + [ Seq + ( 58, + [ Prim + ( 59, + I_IF_LEFT, + [ Seq + ( 60, + [ Prim + ( 61, + I_IF_LEFT, + [ Seq + ( 62, + [ Prim (63, I_DUP, [], []); + Prim (64, I_CDR, [], []); + Prim + (65, I_SWAP, [], []); + Prim (66, I_CAR, [], []); + Prim + (67, I_SWAP, [], []); + Prim (68, I_DUP, [], []); + Prim (69, I_CDR, [], []); + Prim + (70, I_SWAP, [], []); + Prim (71, I_CAR, [], []); + Prim + (72, I_SWAP, [], []); + Prim (73, I_DUP, [], []); + Prim (74, I_CDR, [], []); + Prim + (75, I_SWAP, [], []); + Prim (76, I_CAR, [], []); + Prim + ( 77, + I_DIG, + [ Int + (78, Z.of_int 4) + ], + [] ); + Prim (79, I_DUP, [], []); + Prim + ( 80, + I_DUG, + [ Int + (81, Z.of_int 5) + ], + [] ); + Prim (82, I_CDR, [], []); + Prim (83, I_CDR, [], []); + Prim (84, I_CDR, [], []); + Prim (85, I_CAR, [], []); + Prim + ( 86, + I_IF, + [ Seq + ( 87, + [ Prim + ( 88, + I_DROP, + [ Int + ( 89, + Z + .of_int + 5 + ) + ], + [] ); + Prim + ( 90, + I_PUSH, + [ Prim + ( 91, + T_nat, + [], + [] + ); + Int + ( 92, + Z + .of_int + 2 + ) + ], + [] ); + Prim + ( 93, + I_FAILWITH, + [], + [] ) ] + ); + Seq + ( 94, + [ Prim + ( 95, + I_SWAP, + [], + [] ); + Prim + ( 96, + I_NOW, + [], + [] ); + Prim + ( 97, + I_COMPARE, + [], + [] ); + Prim + ( 98, + I_GE, + [], + [] ); + Prim + ( 99, + I_IF, + [ Seq + ( 100, + [ + Prim + ( + 101, + I_DROP, + [ + Int + ( + 102, + Z + .of_int + 4 + ) + ], + [] + ); + Prim + ( + 103, + I_PUSH, + [ + Prim + ( + 104, + T_nat, + [], + [] + ); + Int + ( + 105, + Z + .of_int + 3 + ) + ], + [] + ); + Prim + ( + 106, + I_FAILWITH, + [], + [] + ) + ] + ); + Seq + ( 107, + [ + Prim + ( + 108, + I_PUSH, + [ + Prim + ( + 109, + T_mutez, + [], + [] + ); + Int + ( + 110, + Z + .one + ) + ], + [] + ); + Prim + ( + 111, + I_DIG, + [ + Int + ( + 112, + Z + .of_int + 4 + ) + ], + [] + ); + Prim + ( + 113, + I_DUP, + [], + [] + ); + Prim + ( + 114, + I_DUG, + [ + Int + ( + 115, + Z + .of_int + 5 + ) + ], + [] + ); + Prim + ( + 116, + I_CDR, + [], + [] + ); + Prim + ( + 117, + I_CAR, + [], + [] + ); + Prim + ( + 118, + I_EDIV, + [], + [] + ); + Prim + ( + 119, + I_IF_NONE, + [ + Seq + ( + 120, + [ + Prim + ( + 121, + I_PUSH, + [ + Prim + ( + 122, + T_string, + [], + [] + ); + String + ( + 123, + "DIV \ + by \ + 0" + ) + ], + [] + ); + Prim + ( + 124, + I_FAILWITH, + [], + [] + ) + ] + ); + Seq + ( + 125, + [] + ) + ], + [] + ); + Prim + ( + 126, + I_CAR, + [], + [] + ); + Prim + ( + 127, + I_AMOUNT, + [], + [] + ); + Prim + ( + 128, + I_PUSH, + [ + Prim + ( + 129, + T_mutez, + [], + [] + ); + Int + ( + 130, + Z + .one + ) + ], + [] + ); + Prim + ( + 131, + I_SWAP, + [], + [] + ); + Prim + ( + 132, + I_EDIV, + [], + [] + ); + Prim + ( + 133, + I_IF_NONE, + [ + Seq + ( + 134, + [ + Prim + ( + 135, + I_PUSH, + [ + Prim + ( + 136, + T_string, + [], + [] + ); + String + ( + 137, + "DIV \ + by \ + 0" + ) + ], + [] + ); + Prim + ( + 138, + I_FAILWITH, + [], + [] + ) + ] + ); + Seq + ( + 139, + [] + ) + ], + [] + ); + Prim + ( + 140, + I_CAR, + [], + [] + ); + Prim + ( + 141, + I_SWAP, + [], + [] + ); + Prim + ( + 142, + I_DUP, + [], + [] + ); + Prim + ( + 143, + I_DUG, + [ + Int + ( + 144, + Z + .of_int + 2 + ) + ], + [] + ); + Prim + ( + 145, + I_DIG, + [ + Int + ( + 146, + Z + .of_int + 6 + ) + ], + [] + ); + Prim + ( + 147, + I_DUP, + [], + [] + ); + Prim + ( + 148, + I_DUG, + [ + Int + ( + 149, + Z + .of_int + 7 + ) + ], + [] + ); + Prim + ( + 150, + I_CDR, + [], + [] + ); + Prim + ( + 151, + I_CDR, + [], + [] + ); + Prim + ( + 152, + I_CAR, + [], + [] + ); + Prim + ( + 153, + I_DIG, + [ + Int + ( + 154, + Z + .of_int + 2 + ) + ], + [] + ); + Prim + ( + 155, + I_DUP, + [], + [] + ); + Prim + ( + 156, + I_DUG, + [ + Int + ( + 157, + Z + .of_int + 3 + ) + ], + [] + ); + Prim + ( + 158, + I_MUL, + [], + [] + ); + Prim + ( + 159, + I_EDIV, + [], + [] + ); + Prim + ( + 160, + I_IF_NONE, + [ + Seq + ( + 161, + [ + Prim + ( + 162, + I_PUSH, + [ + Prim + ( + 163, + T_string, + [], + [] + ); + String + ( + 164, + "DIV \ + by \ + 0" + ) + ], + [] + ); + Prim + ( + 165, + I_FAILWITH, + [], + [] + ) + ] + ); + Seq + ( + 166, + [] + ) + ], + [] + ); + Prim + ( + 167, + I_CAR, + [], + [] + ); + Prim + ( + 168, + I_DIG, + [ + Int + ( + 169, + Z + .of_int + 2 + ) + ], + [] + ); + Prim + ( + 170, + I_DIG, + [ + Int + ( + 171, + Z + .of_int + 6 + ) + ], + [] + ); + Prim + ( + 172, + I_DUP, + [], + [] + ); + Prim + ( + 173, + I_DUG, + [ + Int + ( + 174, + Z + .of_int + 7 + ) + ], + [] + ); + Prim + ( + 175, + I_CAR, + [], + [] + ); + Prim + ( + 176, + I_DIG, + [ + Int + ( + 177, + Z + .of_int + 3 + ) + ], + [] + ); + Prim + ( + 178, + I_MUL, + [], + [] + ); + Prim + ( + 179, + I_EDIV, + [], + [] + ); + Prim + ( + 180, + I_IF_NONE, + [ + Seq + ( + 181, + [ + Prim + ( + 182, + I_PUSH, + [ + Prim + ( + 183, + T_string, + [], + [] + ); + String + ( + 184, + "DIV \ + by \ + 0" + ) + ], + [] + ); + Prim + ( + 185, + I_FAILWITH, + [], + [] + ) + ] + ); + Seq + ( + 186, + [ + Prim + ( + 187, + I_DUP, + [], + [] + ); + Prim + ( + 188, + I_CDR, + [], + [] + ); + Prim + ( + 189, + I_SWAP, + [], + [] + ); + Prim + ( + 190, + I_CAR, + [], + [] + ); + Prim + ( + 191, + I_PUSH, + [ + Prim + ( + 192, + T_nat, + [], + [] + ); + Int + ( + 193, + Z + .zero + ) + ], + [] + ); + Prim + ( + 194, + I_DIG, + [ + Int + ( + 195, + Z + .of_int + 2 + ) + ], + [] + ); + Prim + ( + 196, + I_COMPARE, + [], + [] + ); + Prim + ( + 197, + I_EQ, + [], + [] + ); + Prim + ( + 198, + I_IF, + [ + Seq + ( + 199, + [] + ); + Seq + ( + 200, + [ + Prim + ( + 201, + I_PUSH, + [ + Prim + ( + 202, + T_nat, + [], + [] + ); + Int + ( + 203, + Z + .one + ) + ], + [] + ); + Prim + ( + 204, + I_ADD, + [], + [] + ) + ] + ) + ], + [] + ) + ] + ) + ], + [] + ); + Prim + ( + 205, + I_DIG, + [ + Int + ( + 206, + Z + .of_int + 2 + ) + ], + [] + ); + Prim + ( + 207, + I_SWAP, + [], + [] + ); + Prim + ( + 208, + I_DUP, + [], + [] + ); + Prim + ( + 209, + I_DUG, + [ + Int + ( + 210, + Z + .of_int + 2 + ) + ], + [] + ); + Prim + ( + 211, + I_COMPARE, + [], + [] + ); + Prim + ( + 212, + I_GT, + [], + [] + ); + Prim + ( + 213, + I_IF, + [ + Seq + ( + 214, + [ + Prim + ( + 215, + I_DROP, + [ + Int + ( + 216, + Z + .of_int + 5 + ) + ], + [] + ); + Prim + ( + 217, + I_PUSH, + [ + Prim + ( + 218, + T_nat, + [], + [] + ); + Int + ( + 219, + Z + .of_int + 4 + ) + ], + [] + ); + Prim + ( + 220, + I_FAILWITH, + [], + [] + ) + ] + ); + Seq + ( + 221, + [ + Prim + ( + 222, + I_DUG, + [ + Int + ( + 223, + Z + .of_int + 2 + ) + ], + [] + ); + Prim + ( + 224, + I_DUP, + [], + [] + ); + Prim + ( + 225, + I_DUG, + [ + Int + ( + 226, + Z + .of_int + 3 + ) + ], + [] + ); + Prim + ( + 227, + I_COMPARE, + [], + [] + ); + Prim + ( + 228, + I_LT, + [], + [] + ); + Prim + ( + 229, + I_IF, + [ + Seq + ( + 230, + [ + Prim + ( + 231, + I_DROP, + [ + Int + ( + 232, + Z + .of_int + 4 + ) + ], + [] + ); + Prim + ( + 233, + I_PUSH, + [ + Prim + ( + 234, + T_nat, + [], + [] + ); + Int + ( + 235, + Z + .of_int + 5 + ) + ], + [] + ); + Prim + ( + 236, + I_FAILWITH, + [], + [] + ) + ] + ); + Seq + ( + 237, + [ + Prim + ( + 238, + I_DIG, + [ + Int + ( + 239, + Z + .of_int + 3 + ) + ], + [] + ); + Prim + ( + 240, + I_DUP, + [], + [] + ); + Prim + ( + 241, + I_DUG, + [ + Int + ( + 242, + Z + .of_int + 4 + ) + ], + [] + ); + Prim + ( + 243, + I_CDR, + [], + [] + ); + Prim + ( + 244, + I_CDR, + [], + [] + ); + Prim + ( + 245, + I_CDR, + [], + [] + ); + Prim + ( + 246, + I_DIG, + [ + Int + ( + 247, + Z + .of_int + 2 + ) + ], + [] + ); + Prim + ( + 248, + I_DUP, + [], + [] + ); + Prim + ( + 249, + I_DUG, + [ + Int + ( + 250, + Z + .of_int + 3 + ) + ], + [] + ); + Prim + ( + 251, + I_DIG, + [ + Int + ( + 252, + Z + .of_int + 5 + ) + ], + [] + ); + Prim + ( + 253, + I_DUP, + [], + [] + ); + Prim + ( + 254, + I_DUG, + [ + Int + ( + 255, + Z + .of_int + 6 + ) + ], + [] + ); + Prim + ( + 256, + I_CDR, + [], + [] + ); + Prim + ( + 257, + I_CDR, + [], + [] + ); + Prim + ( + 258, + I_CAR, + [], + [] + ); + Prim + ( + 259, + I_ADD, + [], + [] + ); + Prim + ( + 260, + I_PAIR, + [], + [] + ); + Prim + ( + 261, + I_DIG, + [ + Int + ( + 262, + Z + .of_int + 4 + ) + ], + [] + ); + Prim + ( + 263, + I_DUP, + [], + [] + ); + Prim + ( + 264, + I_DUG, + [ + Int + ( + 265, + Z + .of_int + 5 + ) + ], + [] + ); + Prim + ( + 266, + I_CDR, + [], + [] + ); + Prim + ( + 267, + I_CAR, + [], + [] + ); + Prim + ( + 268, + I_PAIR, + [], + [] + ); + Prim + ( + 269, + I_DIG, + [ + Int + ( + 270, + Z + .of_int + 4 + ) + ], + [] + ); + Prim + ( + 271, + I_DUP, + [], + [] + ); + Prim + ( + 272, + I_DUG, + [ + Int + ( + 273, + Z + .of_int + 5 + ) + ], + [] + ); + Prim + ( + 274, + I_CAR, + [], + [] + ); + Prim + ( + 275, + I_PAIR, + [], + [] + ); + Prim + ( + 276, + I_CDR, + [], + [] + ); + Prim + ( + 277, + I_SWAP, + [], + [] + ); + Prim + ( + 278, + I_DUP, + [], + [] + ); + Prim + ( + 279, + I_DUG, + [ + Int + ( + 280, + Z + .of_int + 2 + ) + ], + [] + ); + Prim + ( + 281, + I_DIG, + [ + Int + ( + 282, + Z + .of_int + 5 + ) + ], + [] + ); + Prim + ( + 283, + I_DUP, + [], + [] + ); + Prim + ( + 284, + I_DUG, + [ + Int + ( + 285, + Z + .of_int + 6 + ) + ], + [] + ); + Prim + ( + 286, + I_CAR, + [], + [] + ); + Prim + ( + 287, + I_ADD, + [], + [] + ); + Prim + ( + 288, + I_PAIR, + [], + [] + ); + Prim + ( + 289, + I_DUP, + [], + [] + ); + Prim + ( + 290, + I_CDR, + [], + [] + ); + Prim + ( + 291, + I_CDR, + [], + [] + ); + Prim + ( + 292, + I_AMOUNT, + [], + [] + ); + Prim + ( + 293, + I_DIG, + [ + Int + ( + 294, + Z + .of_int + 6 + ) + ], + [] + ); + Prim + ( + 295, + I_CDR, + [], + [] + ); + Prim + ( + 296, + I_CAR, + [], + [] + ); + Prim + ( + 297, + I_ADD, + [], + [] + ); + Prim + ( + 298, + I_PAIR, + [], + [] + ); + Prim + ( + 299, + I_SWAP, + [], + [] + ); + Prim + ( + 300, + I_CAR, + [], + [] + ); + Prim + ( + 301, + I_PAIR, + [], + [] + ); + Prim + ( + 302, + I_SWAP, + [], + [] + ); + Prim + ( + 303, + I_SELF, + [], + [] + ); + Prim + ( + 304, + I_ADDRESS, + [], + [] + ); + Prim + ( + 305, + I_PAIR, + [], + [] + ); + Prim + ( + 306, + I_SENDER, + [], + [] + ); + Prim + ( + 307, + I_PAIR, + [], + [] + ); + Prim + ( + 308, + I_SWAP, + [], + [] + ); + Prim + ( + 309, + I_DUP, + [], + [] + ); + Prim + ( + 310, + I_DUG, + [ + Int + ( + 311, + Z + .of_int + 2 + ) + ], + [] + ); + Prim + ( + 312, + I_SWAP, + [], + [] + ); + Prim + ( + 313, + I_DUP, + [], + [] + ); + Prim + ( + 314, + I_CDR, + [], + [] + ); + Prim + ( + 315, + I_SWAP, + [], + [] + ); + Prim + ( + 316, + I_CAR, + [], + [] + ); + Prim + ( + 317, + I_SWAP, + [], + [] + ); + Prim + ( + 318, + I_DUP, + [], + [] + ); + Prim + ( + 319, + I_CDR, + [], + [] + ); + Prim + ( + 320, + I_SWAP, + [], + [] + ); + Prim + ( + 321, + I_CAR, + [], + [] + ); + Prim + ( + 322, + I_DIG, + [ + Int + ( + 323, + Z + .of_int + 3 + ) + ], + [] + ); + Prim + ( + 324, + I_CDR, + [], + [] + ); + Prim + ( + 325, + I_CDR, + [], + [] + ); + Prim + ( + 326, + I_CDR, + [], + [] + ); + Prim + ( + 327, + I_CDR, + [], + [] + ); + Prim + ( + 328, + I_CAR, + [], + [] + ); + Prim + ( + 329, + I_CONTRACT, + [ + Prim + ( + 330, + T_pair, + [ + Prim + ( + 331, + T_address, + [], + [] + ); + Prim + ( + 332, + T_pair, + [ + Prim + ( + 333, + T_address, + [], + [] + ); + Prim + ( + 334, + T_nat, + [], + [] + ) + ], + [] + ) + ], + [] + ) + ], + [ + "%transfer" + ] + ); + Prim + ( + 335, + I_IF_NONE, + [ + Seq + ( + 336, + [ + Prim + ( + 337, + I_PUSH, + [ + Prim + ( + 338, + T_nat, + [], + [] + ); + Int + ( + 339, + Z + .zero + ) + ], + [] + ); + Prim + ( + 340, + I_FAILWITH, + [], + [] + ) + ] + ); + Seq + ( + 341, + [] + ) + ], + [] + ); + Prim + ( + 342, + I_PUSH, + [ + Prim + ( + 343, + T_mutez, + [], + [] + ); + Int + ( + 344, + Z + .zero + ) + ], + [] + ); + Prim + ( + 345, + I_DIG, + [ + Int + ( + 346, + Z + .of_int + 3 + ) + ], + [] + ); + Prim + ( + 347, + I_DIG, + [ + Int + ( + 348, + Z + .of_int + 3 + ) + ], + [] + ); + Prim + ( + 349, + I_PAIR, + [], + [] + ); + Prim + ( + 350, + I_DIG, + [ + Int + ( + 351, + Z + .of_int + 3 + ) + ], + [] + ); + Prim + ( + 352, + I_PAIR, + [], + [] + ); + Prim + ( + 353, + I_TRANSFER_TOKENS, + [], + [] + ); + Prim + ( + 354, + I_DIG, + [ + Int + ( + 355, + Z + .of_int + 2 + ) + ], + [] + ); + Prim + ( + 356, + I_INT, + [], + [] + ); + Prim + ( + 357, + I_DIG, + [ + Int + ( + 358, + Z + .of_int + 3 + ) + ], + [] + ); + Prim + ( + 359, + I_PAIR, + [], + [] + ); + Prim + ( + 360, + I_DIG, + [ + Int + ( + 361, + Z + .of_int + 2 + ) + ], + [] + ); + Prim + ( + 362, + I_DUP, + [], + [] + ); + Prim + ( + 363, + I_DUG, + [ + Int + ( + 364, + Z + .of_int + 3 + ) + ], + [] + ); + Prim + ( + 365, + I_SWAP, + [], + [] + ); + Prim + ( + 366, + I_DUP, + [], + [] + ); + Prim + ( + 367, + I_CDR, + [], + [] + ); + Prim + ( + 368, + I_SWAP, + [], + [] + ); + Prim + ( + 369, + I_CAR, + [], + [] + ); + Prim + ( + 370, + I_DIG, + [ + Int + ( + 371, + Z + .of_int + 2 + ) + ], + [] + ); + Prim + ( + 372, + I_CDR, + [], + [] + ); + Prim + ( + 373, + I_CDR, + [], + [] + ); + Prim + ( + 374, + I_CDR, + [], + [] + ); + Prim + ( + 375, + I_CDR, + [], + [] + ); + Prim + ( + 376, + I_CDR, + [], + [] + ); + Prim + ( + 377, + I_CONTRACT, + [ + Prim + ( + 378, + T_pair, + [ + Prim + ( + 379, + T_int, + [], + [ + "%quantity" + ] + ); + Prim + ( + 380, + T_address, + [], + [ + "%target" + ] + ) + ], + [] + ) + ], + [ + "%mintOrBurn" + ] + ); + Prim + ( + 381, + I_IF_NONE, + [ + Seq + ( + 382, + [ + Prim + ( + 383, + I_PUSH, + [ + Prim + ( + 384, + T_nat, + [], + [] + ); + Int + ( + 385, + Z + .of_int + 12 + ) + ], + [] + ); + Prim + ( + 386, + I_FAILWITH, + [], + [] + ) + ] + ); + Seq + ( + 387, + [] + ) + ], + [] + ); + Prim + ( + 388, + I_PUSH, + [ + Prim + ( + 389, + T_mutez, + [], + [] + ); + Int + ( + 390, + Z + .zero + ) + ], + [] + ); + Prim + ( + 391, + I_DIG, + [ + Int + ( + 392, + Z + .of_int + 2 + ) + ], + [] + ); + Prim + ( + 393, + I_DIG, + [ + Int + ( + 394, + Z + .of_int + 3 + ) + ], + [] + ); + Prim + ( + 395, + I_PAIR, + [], + [] + ); + Prim + ( + 396, + I_TRANSFER_TOKENS, + [], + [] + ); + Prim + ( + 397, + I_DIG, + [ + Int + ( + 398, + Z + .of_int + 2 + ) + ], + [] + ); + Prim + ( + 399, + I_NIL, + [ + Prim + ( + 400, + T_operation, + [], + [] + ) + ], + [] + ); + Prim + ( + 401, + I_DIG, + [ + Int + ( + 402, + Z + .of_int + 2 + ) + ], + [] + ); + Prim + ( + 403, + I_CONS, + [], + [] + ); + Prim + ( + 404, + I_DIG, + [ + Int + ( + 405, + Z + .of_int + 2 + ) + ], + [] + ); + Prim + ( + 406, + I_CONS, + [], + [] + ); + Prim + ( + 407, + I_PAIR, + [], + [] + ) + ] + ) + ], + [] + ) + ] + ) + ], + [] + ) + ] + ) + ], + [] ) ] + ) ], + [] ) ] ); + Seq + ( 408, + [ Prim + (409, I_DROP, [], []); + Prim + (410, I_DUP, [], []); + Prim + (411, I_CDR, [], []); + Prim + (412, I_CDR, [], []); + Prim + (413, I_CDR, [], []); + Prim + (414, I_CAR, [], []); + Prim + ( 415, + I_IF, + [ Seq + ( 416, + [ Prim + ( 417, + I_DROP, + [], + [] ); + Prim + ( 418, + I_PUSH, + [ Prim + ( 419, + T_nat, + [], + [] + ); + Int + ( 420, + Z + .of_int + 2 + ) + ], + [] ); + Prim + ( 421, + I_FAILWITH, + [], + [] ) ] + ); + Seq + ( 422, + [ Prim + ( 423, + I_DUP, + [], + [] ); + Prim + ( 424, + I_CDR, + [], + [] ); + Prim + ( 425, + I_CDR, + [], + [] ); + Prim + ( 426, + I_AMOUNT, + [], + [] ); + Prim + ( 427, + I_DIG, + [ Int + ( 428, + Z + .of_int + 2 + ) + ], + [] ); + Prim + ( 429, + I_DUP, + [], + [] ); + Prim + ( 430, + I_DUG, + [ Int + ( 431, + Z + .of_int + 3 + ) + ], + [] ); + Prim + ( 432, + I_CDR, + [], + [] ); + Prim + ( 433, + I_CAR, + [], + [] ); + Prim + ( 434, + I_ADD, + [], + [] ); + Prim + ( 435, + I_PAIR, + [], + [] ); + Prim + ( 436, + I_SWAP, + [], + [] ); + Prim + ( 437, + I_CAR, + [], + [] ); + Prim + ( 438, + I_PAIR, + [], + [] ); + Prim + ( 439, + I_NIL, + [ Prim + ( 440, + T_operation, + [], + [] + ) + ], + [] ); + Prim + ( 441, + I_PAIR, + [], + [] ) ] + ) ], + [] ) ] ) ], + [] ) ] ); + Seq + ( 442, + [ Prim + ( 443, + I_IF_LEFT, + [ Seq + ( 444, + [ Prim + (445, I_DUP, [], []); + Prim + (446, I_CDR, [], []); + Prim + (447, I_SWAP, [], []); + Prim + (448, I_CAR, [], []); + Prim + (449, I_SWAP, [], []); + Prim + (450, I_DUP, [], []); + Prim + (451, I_CDR, [], []); + Prim + (452, I_SWAP, [], []); + Prim + (453, I_CAR, [], []); + Prim + (454, I_SWAP, [], []); + Prim + (455, I_DUP, [], []); + Prim + (456, I_CDR, [], []); + Prim + (457, I_SWAP, [], []); + Prim + (458, I_CAR, [], []); + Prim + (459, I_SWAP, [], []); + Prim + (460, I_DUP, [], []); + Prim + (461, I_CDR, [], []); + Prim + (462, I_SWAP, [], []); + Prim + (463, I_CAR, [], []); + Prim + ( 464, + I_DIG, + [ Int + ( 465, + Z.of_int 5 ) + ], + [] ); + Prim + (466, I_DUP, [], []); + Prim + ( 467, + I_DUG, + [ Int + ( 468, + Z.of_int 6 ) + ], + [] ); + Prim + (469, I_CDR, [], []); + Prim + (470, I_CDR, [], []); + Prim + (471, I_CDR, [], []); + Prim + (472, I_CAR, [], []); + Prim + ( 473, + I_IF, + [ Seq + ( 474, + [ Prim + ( 475, + I_DROP, + [ Int + ( 476, + Z + .of_int + 6 + ) + ], + [] ); + Prim + ( 477, + I_PUSH, + [ Prim + ( 478, + T_nat, + [], + [] + ); + Int + ( 479, + Z + .of_int + 2 + ) + ], + [] ); + Prim + ( 480, + I_FAILWITH, + [], + [] ) ] + ); + Seq + ( 481, + [ Prim + ( 482, + I_SWAP, + [], + [] ); + Prim + ( 483, + I_NOW, + [], + [] ); + Prim + ( 484, + I_COMPARE, + [], + [] ); + Prim + ( 485, + I_GE, + [], + [] ); + Prim + ( 486, + I_IF, + [ Seq + ( 487, + [ + Prim + ( + 488, + I_DROP, + [ + Int + ( + 489, + Z + .of_int + 5 + ) + ], + [] + ); + Prim + ( + 490, + I_PUSH, + [ + Prim + ( + 491, + T_nat, + [], + [] + ); + Int + ( + 492, + Z + .of_int + 3 + ) + ], + [] + ); + Prim + ( + 493, + I_FAILWITH, + [], + [] + ) + ] + ); + Seq + ( 494, + [ + Prim + ( + 495, + I_PUSH, + [ + Prim + ( + 496, + T_mutez, + [], + [] + ); + Int + ( + 497, + Z + .zero + ) + ], + [] + ); + Prim + ( + 498, + I_AMOUNT, + [], + [] + ); + Prim + ( + 499, + I_COMPARE, + [], + [] + ); + Prim + ( + 500, + I_GT, + [], + [] + ); + Prim + ( + 501, + I_IF, + [ + Seq + ( + 502, + [ + Prim + ( + 503, + I_DROP, + [ + Int + ( + 504, + Z + .of_int + 5 + ) + ], + [] + ); + Prim + ( + 505, + I_PUSH, + [ + Prim + ( + 506, + T_nat, + [], + [] + ); + Int + ( + 507, + Z + .of_int + 10 + ) + ], + [] + ); + Prim + ( + 508, + I_FAILWITH, + [], + [] + ) + ] + ); + Seq + ( + 509, + [ + Prim + ( + 510, + I_DIG, + [ + Int + ( + 511, + Z + .of_int + 4 + ) + ], + [] + ); + Prim + ( + 512, + I_DUP, + [], + [] + ); + Prim + ( + 513, + I_DUG, + [ + Int + ( + 514, + Z + .of_int + 5 + ) + ], + [] + ); + Prim + ( + 515, + I_CDR, + [], + [] + ); + Prim + ( + 516, + I_CDR, + [], + [] + ); + Prim + ( + 517, + I_CAR, + [], + [] + ); + Prim + ( + 518, + I_PUSH, + [ + Prim + ( + 519, + T_mutez, + [], + [] + ); + Int + ( + 520, + Z + .one + ) + ], + [] + ); + Prim + ( + 521, + I_DIG, + [ + Int + ( + 522, + Z + .of_int + 6 + ) + ], + [] + ); + Prim + ( + 523, + I_DUP, + [], + [] + ); + Prim + ( + 524, + I_DUG, + [ + Int + ( + 525, + Z + .of_int + 7 + ) + ], + [] + ); + Prim + ( + 526, + I_CDR, + [], + [] + ); + Prim + ( + 527, + I_CAR, + [], + [] + ); + Prim + ( + 528, + I_EDIV, + [], + [] + ); + Prim + ( + 529, + I_IF_NONE, + [ + Seq + ( + 530, + [ + Prim + ( + 531, + I_PUSH, + [ + Prim + ( + 532, + T_string, + [], + [] + ); + String + ( + 533, + "DIV \ + by \ + 0" + ) + ], + [] + ); + Prim + ( + 534, + I_FAILWITH, + [], + [] + ) + ] + ); + Seq + ( + 535, + [] + ) + ], + [] + ); + Prim + ( + 536, + I_CAR, + [], + [] + ); + Prim + ( + 537, + I_DIG, + [ + Int + ( + 538, + Z + .of_int + 4 + ) + ], + [] + ); + Prim + ( + 539, + I_DUP, + [], + [] + ); + Prim + ( + 540, + I_DUG, + [ + Int + ( + 541, + Z + .of_int + 5 + ) + ], + [] + ); + Prim + ( + 542, + I_MUL, + [], + [] + ); + Prim + ( + 543, + I_EDIV, + [], + [] + ); + Prim + ( + 544, + I_IF_NONE, + [ + Seq + ( + 545, + [ + Prim + ( + 546, + I_PUSH, + [ + Prim + ( + 547, + T_string, + [], + [] + ); + String + ( + 548, + "DIV \ + by \ + 0" + ) + ], + [] + ); + Prim + ( + 549, + I_FAILWITH, + [], + [] + ) + ] + ); + Seq + ( + 550, + [] + ) + ], + [] + ); + Prim + ( + 551, + I_CAR, + [], + [] + ); + Prim + ( + 552, + I_PUSH, + [ + Prim + ( + 553, + T_mutez, + [], + [] + ); + Int + ( + 554, + Z + .one + ) + ], + [] + ); + Prim + ( + 555, + I_SWAP, + [], + [] + ); + Prim + ( + 556, + I_MUL, + [], + [] + ); + Prim + ( + 557, + I_DIG, + [ + Int + ( + 558, + Z + .of_int + 5 + ) + ], + [] + ); + Prim + ( + 559, + I_DUP, + [], + [] + ); + Prim + ( + 560, + I_DUG, + [ + Int + ( + 561, + Z + .of_int + 6 + ) + ], + [] + ); + Prim + ( + 562, + I_CDR, + [], + [] + ); + Prim + ( + 563, + I_CDR, + [], + [] + ); + Prim + ( + 564, + I_CAR, + [], + [] + ); + Prim + ( + 565, + I_DIG, + [ + Int + ( + 566, + Z + .of_int + 6 + ) + ], + [] + ); + Prim + ( + 567, + I_DUP, + [], + [] + ); + Prim + ( + 568, + I_DUG, + [ + Int + ( + 569, + Z + .of_int + 7 + ) + ], + [] + ); + Prim + ( + 570, + I_CAR, + [], + [] + ); + Prim + ( + 571, + I_DIG, + [ + Int + ( + 572, + Z + .of_int + 5 + ) + ], + [] + ); + Prim + ( + 573, + I_DUP, + [], + [] + ); + Prim + ( + 574, + I_DUG, + [ + Int + ( + 575, + Z + .of_int + 6 + ) + ], + [] + ); + Prim + ( + 576, + I_MUL, + [], + [] + ); + Prim + ( + 577, + I_EDIV, + [], + [] + ); + Prim + ( + 578, + I_IF_NONE, + [ + Seq + ( + 579, + [ + Prim + ( + 580, + I_PUSH, + [ + Prim + ( + 581, + T_string, + [], + [] + ); + String + ( + 582, + "DIV \ + by \ + 0" + ) + ], + [] + ); + Prim + ( + 583, + I_FAILWITH, + [], + [] + ) + ] + ); + Seq + ( + 584, + [] + ) + ], + [] + ); + Prim + ( + 585, + I_CAR, + [], + [] + ); + Prim + ( + 586, + I_DIG, + [ + Int + ( + 587, + Z + .of_int + 3 + ) + ], + [] + ); + Prim + ( + 588, + I_DIG, + [ + Int + ( + 589, + Z + .of_int + 2 + ) + ], + [] + ); + Prim + ( + 590, + I_DUP, + [], + [] + ); + Prim + ( + 591, + I_DUG, + [ + Int + ( + 592, + Z + .of_int + 3 + ) + ], + [] + ); + Prim + ( + 593, + I_COMPARE, + [], + [] + ); + Prim + ( + 594, + I_LT, + [], + [] + ); + Prim + ( + 595, + I_IF, + [ + Seq + ( + 596, + [ + Prim + ( + 597, + I_DROP, + [ + Int + ( + 598, + Z + .of_int + 6 + ) + ], + [] + ); + Prim + ( + 599, + I_PUSH, + [ + Prim + ( + 600, + T_nat, + [], + [] + ); + Int + ( + 601, + Z + .of_int + 11 + ) + ], + [] + ); + Prim + ( + 602, + I_FAILWITH, + [], + [] + ) + ] + ); + Seq + ( + 603, + [ + Prim + ( + 604, + I_DIG, + [ + Int + ( + 605, + Z + .of_int + 2 + ) + ], + [] + ); + Prim + ( + 606, + I_SWAP, + [], + [] + ); + Prim + ( + 607, + I_DUP, + [], + [] + ); + Prim + ( + 608, + I_DUG, + [ + Int + ( + 609, + Z + .of_int + 2 + ) + ], + [] + ); + Prim + ( + 610, + I_COMPARE, + [], + [] + ); + Prim + ( + 611, + I_LT, + [], + [] + ); + Prim + ( + 612, + I_IF, + [ + Seq + ( + 613, + [ + Prim + ( + 614, + I_DROP, + [ + Int + ( + 615, + Z + .of_int + 5 + ) + ], + [] + ); + Prim + ( + 616, + I_PUSH, + [ + Prim + ( + 617, + T_nat, + [], + [] + ); + Int + ( + 618, + Z + .of_int + 13 + ) + ], + [] + ); + Prim + ( + 619, + I_FAILWITH, + [], + [] + ) + ] + ); + Seq + ( + 620, + [ + Prim + ( + 621, + I_DIG, + [ + Int + ( + 622, + Z + .of_int + 2 + ) + ], + [] + ); + Prim + ( + 623, + I_DUP, + [], + [] + ); + Prim + ( + 624, + I_DUG, + [ + Int + ( + 625, + Z + .of_int + 3 + ) + ], + [] + ); + Prim + ( + 626, + I_DIG, + [ + Int + ( + 627, + Z + .of_int + 5 + ) + ], + [] + ); + Prim + ( + 628, + I_DUP, + [], + [] + ); + Prim + ( + 629, + I_DUG, + [ + Int + ( + 630, + Z + .of_int + 6 + ) + ], + [] + ); + Prim + ( + 631, + I_CDR, + [], + [] + ); + Prim + ( + 632, + I_CDR, + [], + [] + ); + Prim + ( + 633, + I_CAR, + [], + [] + ); + Prim + ( + 634, + I_SUB, + [], + [] + ); + Prim + ( + 635, + I_ISNAT, + [], + [] + ); + Prim + ( + 636, + I_IF_NONE, + [ + Seq + ( + 637, + [ + Prim + ( + 638, + I_PUSH, + [ + Prim + ( + 639, + T_nat, + [], + [] + ); + Int + ( + 640, + Z + .of_int + 14 + ) + ], + [] + ); + Prim + ( + 641, + I_FAILWITH, + [], + [] + ) + ] + ); + Seq + ( + 642, + [] + ) + ], + [] + ); + Prim + ( + 643, + I_SWAP, + [], + [] + ); + Prim + ( + 644, + I_DUP, + [], + [] + ); + Prim + ( + 645, + I_DUG, + [ + Int + ( + 646, + Z + .of_int + 2 + ) + ], + [] + ); + Prim + ( + 647, + I_DIG, + [ + Int + ( + 648, + Z + .of_int + 6 + ) + ], + [] + ); + Prim + ( + 649, + I_DUP, + [], + [] + ); + Prim + ( + 650, + I_DUG, + [ + Int + ( + 651, + Z + .of_int + 7 + ) + ], + [] + ); + Prim + ( + 652, + I_CAR, + [], + [] + ); + Prim + ( + 653, + I_SUB, + [], + [] + ); + Prim + ( + 654, + I_ISNAT, + [], + [] + ); + Prim + ( + 655, + I_IF_NONE, + [ + Seq + ( + 656, + [ + Prim + ( + 657, + I_PUSH, + [ + Prim + ( + 658, + T_nat, + [], + [] + ); + Int + ( + 659, + Z + .of_int + 15 + ) + ], + [] + ); + Prim + ( + 660, + I_FAILWITH, + [], + [] + ) + ] + ); + Seq + ( + 661, + [] + ) + ], + [] + ); + Prim + ( + 662, + I_DIG, + [ + Int + ( + 663, + Z + .of_int + 4 + ) + ], + [] + ); + Prim + ( + 664, + I_PUSH, + [ + Prim + ( + 665, + T_int, + [], + [] + ); + Int + ( + 666, + Z + .zero + ) + ], + [] + ); + Prim + ( + 667, + I_SUB, + [], + [] + ); + Prim + ( + 668, + I_SENDER, + [], + [] + ); + Prim + ( + 669, + I_PAIR, + [], + [] + ); + Prim + ( + 670, + I_DIG, + [ + Int + ( + 671, + Z + .of_int + 6 + ) + ], + [] + ); + Prim + ( + 672, + I_DUP, + [], + [] + ); + Prim + ( + 673, + I_DUG, + [ + Int + ( + 674, + Z + .of_int + 7 + ) + ], + [] + ); + Prim + ( + 675, + I_SWAP, + [], + [] + ); + Prim + ( + 676, + I_DUP, + [], + [] + ); + Prim + ( + 677, + I_CDR, + [], + [] + ); + Prim + ( + 678, + I_SWAP, + [], + [] + ); + Prim + ( + 679, + I_CAR, + [], + [] + ); + Prim + ( + 680, + I_DIG, + [ + Int + ( + 681, + Z + .of_int + 2 + ) + ], + [] + ); + Prim + ( + 682, + I_CDR, + [], + [] + ); + Prim + ( + 683, + I_CDR, + [], + [] + ); + Prim + ( + 684, + I_CDR, + [], + [] + ); + Prim + ( + 685, + I_CDR, + [], + [] + ); + Prim + ( + 686, + I_CDR, + [], + [] + ); + Prim + ( + 687, + I_CONTRACT, + [ + Prim + ( + 688, + T_pair, + [ + Prim + ( + 689, + T_int, + [], + [ + "%quantity" + ] + ); + Prim + ( + 690, + T_address, + [], + [ + "%target" + ] + ) + ], + [] + ) + ], + [ + "%mintOrBurn" + ] + ); + Prim + ( + 691, + I_IF_NONE, + [ + Seq + ( + 692, + [ + Prim + ( + 693, + I_PUSH, + [ + Prim + ( + 694, + T_nat, + [], + [] + ); + Int + ( + 695, + Z + .of_int + 12 + ) + ], + [] + ); + Prim + ( + 696, + I_FAILWITH, + [], + [] + ) + ] + ); + Seq + ( + 697, + [] + ) + ], + [] + ); + Prim + ( + 698, + I_PUSH, + [ + Prim + ( + 699, + T_mutez, + [], + [] + ); + Int + ( + 700, + Z + .zero + ) + ], + [] + ); + Prim + ( + 701, + I_DIG, + [ + Int + ( + 702, + Z + .of_int + 2 + ) + ], + [] + ); + Prim + ( + 703, + I_DIG, + [ + Int + ( + 704, + Z + .of_int + 3 + ) + ], + [] + ); + Prim + ( + 705, + I_PAIR, + [], + [] + ); + Prim + ( + 706, + I_TRANSFER_TOKENS, + [], + [] + ); + Prim + ( + 707, + I_DIG, + [ + Int + ( + 708, + Z + .of_int + 3 + ) + ], + [] + ); + Prim + ( + 709, + I_DIG, + [ + Int + ( + 710, + Z + .of_int + 5 + ) + ], + [] + ); + Prim + ( + 711, + I_DUP, + [], + [] + ); + Prim + ( + 712, + I_DUG, + [ + Int + ( + 713, + Z + .of_int + 6 + ) + ], + [] + ); + Prim + ( + 714, + I_PAIR, + [], + [] + ); + Prim + ( + 715, + I_SELF, + [], + [] + ); + Prim + ( + 716, + I_ADDRESS, + [], + [] + ); + Prim + ( + 717, + I_PAIR, + [], + [] + ); + Prim + ( + 718, + I_DIG, + [ + Int + ( + 719, + Z + .of_int + 6 + ) + ], + [] + ); + Prim + ( + 720, + I_DUP, + [], + [] + ); + Prim + ( + 721, + I_DUG, + [ + Int + ( + 722, + Z + .of_int + 7 + ) + ], + [] + ); + Prim + ( + 723, + I_SWAP, + [], + [] + ); + Prim + ( + 724, + I_DUP, + [], + [] + ); + Prim + ( + 725, + I_CDR, + [], + [] + ); + Prim + ( + 726, + I_SWAP, + [], + [] + ); + Prim + ( + 727, + I_CAR, + [], + [] + ); + Prim + ( + 728, + I_SWAP, + [], + [] + ); + Prim + ( + 729, + I_DUP, + [], + [] + ); + Prim + ( + 730, + I_CDR, + [], + [] + ); + Prim + ( + 731, + I_SWAP, + [], + [] + ); + Prim + ( + 732, + I_CAR, + [], + [] + ); + Prim + ( + 733, + I_DIG, + [ + Int + ( + 734, + Z + .of_int + 3 + ) + ], + [] + ); + Prim + ( + 735, + I_CDR, + [], + [] + ); + Prim + ( + 736, + I_CDR, + [], + [] + ); + Prim + ( + 737, + I_CDR, + [], + [] + ); + Prim + ( + 738, + I_CDR, + [], + [] + ); + Prim + ( + 739, + I_CAR, + [], + [] + ); + Prim + ( + 740, + I_CONTRACT, + [ + Prim + ( + 741, + T_pair, + [ + Prim + ( + 742, + T_address, + [], + [] + ); + Prim + ( + 743, + T_pair, + [ + Prim + ( + 744, + T_address, + [], + [] + ); + Prim + ( + 745, + T_nat, + [], + [] + ) + ], + [] + ) + ], + [] + ) + ], + [ + "%transfer" + ] + ); + Prim + ( + 746, + I_IF_NONE, + [ + Seq + ( + 747, + [ + Prim + ( + 748, + I_PUSH, + [ + Prim + ( + 749, + T_nat, + [], + [] + ); + Int + ( + 750, + Z + .zero + ) + ], + [] + ); + Prim + ( + 751, + I_FAILWITH, + [], + [] + ) + ] + ); + Seq + ( + 752, + [] + ) + ], + [] + ); + Prim + ( + 753, + I_PUSH, + [ + Prim + ( + 754, + T_mutez, + [], + [] + ); + Int + ( + 755, + Z + .zero + ) + ], + [] + ); + Prim + ( + 756, + I_DIG, + [ + Int + ( + 757, + Z + .of_int + 3 + ) + ], + [] + ); + Prim + ( + 758, + I_DIG, + [ + Int + ( + 759, + Z + .of_int + 3 + ) + ], + [] + ); + Prim + ( + 760, + I_PAIR, + [], + [] + ); + Prim + ( + 761, + I_DIG, + [ + Int + ( + 762, + Z + .of_int + 3 + ) + ], + [] + ); + Prim + ( + 763, + I_PAIR, + [], + [] + ); + Prim + ( + 764, + I_TRANSFER_TOKENS, + [], + [] + ); + Prim + ( + 765, + I_DIG, + [ + Int + ( + 766, + Z + .of_int + 4 + ) + ], + [] + ); + Prim + ( + 767, + I_DUP, + [], + [] + ); + Prim + ( + 768, + I_DUG, + [ + Int + ( + 769, + Z + .of_int + 5 + ) + ], + [] + ); + Prim + ( + 770, + I_DIG, + [ + Int + ( + 771, + Z + .of_int + 6 + ) + ], + [] + ); + Prim + ( + 772, + I_CONTRACT, + [ + Prim + ( + 773, + T_unit, + [], + [] + ) + ], + [] + ); + Prim + ( + 774, + I_IF_NONE, + [ + Seq + ( + 775, + [ + Prim + ( + 776, + I_PUSH, + [ + Prim + ( + 777, + T_nat, + [], + [] + ); + Int + ( + 778, + Z + .of_int + 9 + ) + ], + [] + ); + Prim + ( + 779, + I_FAILWITH, + [], + [] + ) + ] + ); + Seq + ( + 780, + [] + ) + ], + [] + ); + Prim + ( + 781, + I_SWAP, + [], + [] + ); + Prim + ( + 782, + I_PUSH, + [ + Prim + ( + 783, + T_unit, + [], + [] + ); + Prim + ( + 784, + D_Unit, + [], + [] + ) + ], + [] + ); + Prim + ( + 785, + I_TRANSFER_TOKENS, + [], + [] + ); + Prim + ( + 786, + I_DIG, + [ + Int + ( + 787, + Z + .of_int + 6 + ) + ], + [] + ); + Prim + ( + 788, + I_DUP, + [], + [] + ); + Prim + ( + 789, + I_DUG, + [ + Int + ( + 790, + Z + .of_int + 7 + ) + ], + [] + ); + Prim + ( + 791, + I_CDR, + [], + [] + ); + Prim + ( + 792, + I_CDR, + [], + [] + ); + Prim + ( + 793, + I_DIG, + [ + Int + ( + 794, + Z + .of_int + 6 + ) + ], + [] + ); + Prim + ( + 795, + I_DIG, + [ + Int + ( + 796, + Z + .of_int + 7 + ) + ], + [] + ); + Prim + ( + 797, + I_DUP, + [], + [] + ); + Prim + ( + 798, + I_DUG, + [ + Int + ( + 799, + Z + .of_int + 8 + ) + ], + [] + ); + Prim + ( + 800, + I_CDR, + [], + [] + ); + Prim + ( + 801, + I_CAR, + [], + [] + ); + Prim + ( + 802, + I_SUB, + [], + [] + ); + Prim + ( + 803, + I_PAIR, + [], + [] + ); + Prim + ( + 804, + I_DIG, + [ + Int + ( + 805, + Z + .of_int + 6 + ) + ], + [] + ); + Prim + ( + 806, + I_CAR, + [], + [] + ); + Prim + ( + 807, + I_PAIR, + [], + [] + ); + Prim + ( + 808, + I_DUP, + [], + [] + ); + Prim + ( + 809, + I_CDR, + [], + [] + ); + Prim + ( + 810, + I_CDR, + [], + [] + ); + Prim + ( + 811, + I_CDR, + [], + [] + ); + Prim + ( + 812, + I_DIG, + [ + Int + ( + 813, + Z + .of_int + 6 + ) + ], + [] + ); + Prim + ( + 814, + I_PAIR, + [], + [] + ); + Prim + ( + 815, + I_SWAP, + [], + [] + ); + Prim + ( + 816, + I_DUP, + [], + [] + ); + Prim + ( + 817, + I_DUG, + [ + Int + ( + 818, + Z + .of_int + 2 + ) + ], + [] + ); + Prim + ( + 819, + I_CDR, + [], + [] + ); + Prim + ( + 820, + I_CAR, + [], + [] + ); + Prim + ( + 821, + I_PAIR, + [], + [] + ); + Prim + ( + 822, + I_SWAP, + [], + [] + ); + Prim + ( + 823, + I_CAR, + [], + [] + ); + Prim + ( + 824, + I_PAIR, + [], + [] + ); + Prim + ( + 825, + I_CDR, + [], + [] + ); + Prim + ( + 826, + I_DIG, + [ + Int + ( + 827, + Z + .of_int + 4 + ) + ], + [] + ); + Prim + ( + 828, + I_PAIR, + [], + [] + ); + Prim + ( + 829, + I_NIL, + [ + Prim + ( + 830, + T_operation, + [], + [] + ) + ], + [] + ); + Prim + ( + 831, + I_DIG, + [ + Int + ( + 832, + Z + .of_int + 2 + ) + ], + [] + ); + Prim + ( + 833, + I_CONS, + [], + [] + ); + Prim + ( + 834, + I_DIG, + [ + Int + ( + 835, + Z + .of_int + 2 + ) + ], + [] + ); + Prim + ( + 836, + I_CONS, + [], + [] + ); + Prim + ( + 837, + I_DIG, + [ + Int + ( + 838, + Z + .of_int + 2 + ) + ], + [] + ); + Prim + ( + 839, + I_CONS, + [], + [] + ); + Prim + ( + 840, + I_PAIR, + [], + [] + ) + ] + ) + ], + [] + ) + ] + ) + ], + [] + ) + ] + ) + ], + [] + ) + ] + ) + ], + [] ) ] + ) ], + [] ) ] ); + Seq + ( 841, + [ Prim + (842, I_DUP, [], []); + Prim + (843, I_CDR, [], []); + Prim + (844, I_SWAP, [], []); + Prim + (845, I_CAR, [], []); + Prim + (846, I_SWAP, [], []); + Prim + (847, I_DUP, [], []); + Prim + (848, I_CDR, [], []); + Prim + (849, I_SWAP, [], []); + Prim + (850, I_CAR, [], []); + Prim + (851, I_SWAP, [], []); + Prim + (852, I_DUP, [], []); + Prim + (853, I_CDR, [], []); + Prim + (854, I_SWAP, [], []); + Prim + (855, I_CAR, [], []); + Prim + ( 856, + I_DIG, + [ Int + ( 857, + Z.of_int 4 ) + ], + [] ); + Prim + (858, I_DUP, [], []); + Prim + ( 859, + I_DUG, + [ Int + ( 860, + Z.of_int 5 ) + ], + [] ); + Prim + (861, I_CDR, [], []); + Prim + (862, I_CDR, [], []); + Prim + (863, I_CDR, [], []); + Prim + (864, I_CAR, [], []); + Prim + ( 865, + I_IF, + [ Seq + ( 866, + [ Prim + ( 867, + I_DROP, + [ Int + ( 868, + Z + .of_int + 5 + ) + ], + [] ); + Prim + ( 869, + I_PUSH, + [ Prim + ( 870, + T_nat, + [], + [] + ); + Int + ( 871, + Z + .of_int + 2 + ) + ], + [] ); + Prim + ( 872, + I_FAILWITH, + [], + [] ) ] + ); + Seq + ( 873, + [ Prim + ( 874, + I_SWAP, + [], + [] ); + Prim + ( 875, + I_NOW, + [], + [] ); + Prim + ( 876, + I_COMPARE, + [], + [] ); + Prim + ( 877, + I_GE, + [], + [] ); + Prim + ( 878, + I_IF, + [ Seq + ( 879, + [ + Prim + ( + 880, + I_DROP, + [ + Int + ( + 881, + Z + .of_int + 4 + ) + ], + [] + ); + Prim + ( + 882, + I_PUSH, + [ + Prim + ( + 883, + T_nat, + [], + [] + ); + Int + ( + 884, + Z + .of_int + 3 + ) + ], + [] + ); + Prim + ( + 885, + I_FAILWITH, + [], + [] + ) + ] + ); + Seq + ( 886, + [ + Prim + ( + 887, + I_PUSH, + [ + Prim + ( + 888, + T_mutez, + [], + [] + ); + Int + ( + 889, + Z + .zero + ) + ], + [] + ); + Prim + ( + 890, + I_AMOUNT, + [], + [] + ); + Prim + ( + 891, + I_COMPARE, + [], + [] + ); + Prim + ( + 892, + I_GT, + [], + [] + ); + Prim + ( + 893, + I_IF, + [ + Seq + ( + 894, + [ + Prim + ( + 895, + I_DROP, + [ + Int + ( + 896, + Z + .of_int + 4 + ) + ], + [] + ); + Prim + ( + 897, + I_PUSH, + [ + Prim + ( + 898, + T_nat, + [], + [] + ); + Int + ( + 899, + Z + .of_int + 10 + ) + ], + [] + ); + Prim + ( + 900, + I_FAILWITH, + [], + [] + ) + ] + ); + Seq + ( + 901, + [ + Prim + ( + 902, + I_PUSH, + [ + Prim + ( + 903, + T_nat, + [], + [] + ); + Int + ( + 904, + Z + .of_int + 999 + ) + ], + [] + ); + Prim + ( + 905, + I_DIG, + [ + Int + ( + 906, + Z + .of_int + 2 + ) + ], + [] + ); + Prim + ( + 907, + I_DUP, + [], + [] + ); + Prim + ( + 908, + I_DUG, + [ + Int + ( + 909, + Z + .of_int + 3 + ) + ], + [] + ); + Prim + ( + 910, + I_MUL, + [], + [] + ); + Prim + ( + 911, + I_PUSH, + [ + Prim + ( + 912, + T_nat, + [], + [] + ); + Int + ( + 913, + Z + .of_int + 1000 + ) + ], + [] + ); + Prim + ( + 914, + I_DIG, + [ + Int + ( + 915, + Z + .of_int + 5 + ) + ], + [] + ); + Prim + ( + 916, + I_DUP, + [], + [] + ); + Prim + ( + 917, + I_DUG, + [ + Int + ( + 918, + Z + .of_int + 6 + ) + ], + [] + ); + Prim + ( + 919, + I_CAR, + [], + [] + ); + Prim + ( + 920, + I_MUL, + [], + [] + ); + Prim + ( + 921, + I_ADD, + [], + [] + ); + Prim + ( + 922, + I_PUSH, + [ + Prim + ( + 923, + T_mutez, + [], + [] + ); + Int + ( + 924, + Z + .one + ) + ], + [] + ); + Prim + ( + 925, + I_DIG, + [ + Int + ( + 926, + Z + .of_int + 5 + ) + ], + [] + ); + Prim + ( + 927, + I_DUP, + [], + [] + ); + Prim + ( + 928, + I_DUG, + [ + Int + ( + 929, + Z + .of_int + 6 + ) + ], + [] + ); + Prim + ( + 930, + I_CDR, + [], + [] + ); + Prim + ( + 931, + I_CAR, + [], + [] + ); + Prim + ( + 932, + I_EDIV, + [], + [] + ); + Prim + ( + 933, + I_IF_NONE, + [ + Seq + ( + 934, + [ + Prim + ( + 935, + I_PUSH, + [ + Prim + ( + 936, + T_string, + [], + [] + ); + String + ( + 937, + "DIV \ + by \ + 0" + ) + ], + [] + ); + Prim + ( + 938, + I_FAILWITH, + [], + [] + ) + ] + ); + Seq + ( + 939, + [] + ) + ], + [] + ); + Prim + ( + 940, + I_CAR, + [], + [] + ); + Prim + ( + 941, + I_PUSH, + [ + Prim + ( + 942, + T_nat, + [], + [] + ); + Int + ( + 943, + Z + .of_int + 999 + ) + ], + [] + ); + Prim + ( + 944, + I_DIG, + [ + Int + ( + 945, + Z + .of_int + 4 + ) + ], + [] + ); + Prim + ( + 946, + I_DUP, + [], + [] + ); + Prim + ( + 947, + I_DUG, + [ + Int + ( + 948, + Z + .of_int + 5 + ) + ], + [] + ); + Prim + ( + 949, + I_MUL, + [], + [] + ); + Prim + ( + 950, + I_MUL, + [], + [] + ); + Prim + ( + 951, + I_EDIV, + [], + [] + ); + Prim + ( + 952, + I_IF_NONE, + [ + Seq + ( + 953, + [ + Prim + ( + 954, + I_PUSH, + [ + Prim + ( + 955, + T_string, + [], + [] + ); + String + ( + 956, + "DIV \ + by \ + 0" + ) + ], + [] + ); + Prim + ( + 957, + I_FAILWITH, + [], + [] + ) + ] + ); + Seq + ( + 958, + [] + ) + ], + [] + ); + Prim + ( + 959, + I_CAR, + [], + [] + ); + Prim + ( + 960, + I_PUSH, + [ + Prim + ( + 961, + T_mutez, + [], + [] + ); + Int + ( + 962, + Z + .one + ) + ], + [] + ); + Prim + ( + 963, + I_SWAP, + [], + [] + ); + Prim + ( + 964, + I_MUL, + [], + [] + ); + Prim + ( + 965, + I_DUP, + [], + [] + ); + Prim + ( + 966, + I_DUG, + [ + Int + ( + 967, + Z + .of_int + 2 + ) + ], + [] + ); + Prim + ( + 968, + I_COMPARE, + [], + [] + ); + Prim + ( + 969, + I_LT, + [], + [] + ); + Prim + ( + 970, + I_IF, + [ + Seq + ( + 971, + [ + Prim + ( + 972, + I_DROP, + [], + [] + ); + Prim + ( + 973, + I_PUSH, + [ + Prim + ( + 974, + T_nat, + [], + [] + ); + Int + ( + 975, + Z + .of_int + 8 + ) + ], + [] + ); + Prim + ( + 976, + I_FAILWITH, + [], + [] + ) + ] + ); + Seq + ( + 977, + [] + ) + ], + [] + ); + Prim + ( + 978, + I_PUSH, + [ + Prim + ( + 979, + T_nat, + [], + [] + ); + Int + ( + 980, + Z + .of_int + 1000 + ) + ], + [] + ); + Prim + ( + 981, + I_PUSH, + [ + Prim + ( + 982, + T_mutez, + [], + [] + ); + Int + ( + 983, + Z + .one + ) + ], + [] + ); + Prim + ( + 984, + I_DIG, + [ + Int + ( + 985, + Z + .of_int + 2 + ) + ], + [] + ); + Prim + ( + 986, + I_DUP, + [], + [] + ); + Prim + ( + 987, + I_DUG, + [ + Int + ( + 988, + Z + .of_int + 3 + ) + ], + [] + ); + Prim + ( + 989, + I_EDIV, + [], + [] + ); + Prim + ( + 990, + I_IF_NONE, + [ + Seq + ( + 991, + [ + Prim + ( + 992, + I_PUSH, + [ + Prim + ( + 993, + T_string, + [], + [] + ); + String + ( + 994, + "DIV \ + by \ + 0" + ) + ], + [] + ); + Prim + ( + 995, + I_FAILWITH, + [], + [] + ) + ] + ); + Seq + ( + 996, + [] + ) + ], + [] + ); + Prim + ( + 997, + I_CAR, + [], + [] + ); + Prim + ( + 998, + I_EDIV, + [], + [] + ); + Prim + ( + 999, + I_IF_NONE, + [ + Seq + ( + 1000, + [ + Prim + ( + 1001, + I_PUSH, + [ + Prim + ( + 1002, + T_string, + [], + [] + ); + String + ( + 1003, + "DIV \ + by \ + 0" + ) + ], + [] + ); + Prim + ( + 1004, + I_FAILWITH, + [], + [] + ) + ] + ); + Seq + ( + 1005, + [] + ) + ], + [] + ); + Prim + ( + 1006, + I_CAR, + [], + [] + ); + Prim + ( + 1007, + I_DUP, + [], + [] + ); + Prim + ( + 1008, + I_PUSH, + [ + Prim + ( + 1009, + T_mutez, + [], + [] + ); + Int + ( + 1010, + Z + .one + ) + ], + [] + ); + Prim + ( + 1011, + I_DIG, + [ + Int + ( + 1012, + Z + .of_int + 3 + ) + ], + [] + ); + Prim + ( + 1013, + I_EDIV, + [], + [] + ); + Prim + ( + 1014, + I_IF_NONE, + [ + Seq + ( + 1015, + [ + Prim + ( + 1016, + I_PUSH, + [ + Prim + ( + 1017, + T_string, + [], + [] + ); + String + ( + 1018, + "DIV \ + by \ + 0" + ) + ], + [] + ); + Prim + ( + 1019, + I_FAILWITH, + [], + [] + ) + ] + ); + Seq + ( + 1020, + [] + ) + ], + [] + ); + Prim + ( + 1021, + I_CAR, + [], + [] + ); + Prim + ( + 1022, + I_SUB, + [], + [] + ); + Prim + ( + 1023, + I_ABS, + [], + [] + ); + Prim + ( + 1024, + I_PUSH, + [ + Prim + ( + 1025, + T_mutez, + [], + [] + ); + Int + ( + 1026, + Z + .one + ) + ], + [] + ); + Prim + ( + 1027, + I_SWAP, + [], + [] + ); + Prim + ( + 1028, + I_MUL, + [], + [] + ); + Prim + ( + 1029, + I_DIG, + [ + Int + ( + 1030, + Z + .of_int + 2 + ) + ], + [] + ); + Prim + ( + 1031, + I_DUP, + [], + [] + ); + Prim + ( + 1032, + I_DUG, + [ + Int + ( + 1033, + Z + .of_int + 3 + ) + ], + [] + ); + Prim + ( + 1034, + I_SELF, + [], + [] + ); + Prim + ( + 1035, + I_ADDRESS, + [], + [] + ); + Prim + ( + 1036, + I_PAIR, + [], + [] + ); + Prim + ( + 1037, + I_SENDER, + [], + [] + ); + Prim + ( + 1038, + I_PAIR, + [], + [] + ); + Prim + ( + 1039, + I_DIG, + [ + Int + ( + 1040, + Z + .of_int + 5 + ) + ], + [] + ); + Prim + ( + 1041, + I_DUP, + [], + [] + ); + Prim + ( + 1042, + I_DUG, + [ + Int + ( + 1043, + Z + .of_int + 6 + ) + ], + [] + ); + Prim + ( + 1044, + I_SWAP, + [], + [] + ); + Prim + ( + 1045, + I_DUP, + [], + [] + ); + Prim + ( + 1046, + I_CDR, + [], + [] + ); + Prim + ( + 1047, + I_SWAP, + [], + [] + ); + Prim + ( + 1048, + I_CAR, + [], + [] + ); + Prim + ( + 1049, + I_SWAP, + [], + [] + ); + Prim + ( + 1050, + I_DUP, + [], + [] + ); + Prim + ( + 1051, + I_CDR, + [], + [] + ); + Prim + ( + 1052, + I_SWAP, + [], + [] + ); + Prim + ( + 1053, + I_CAR, + [], + [] + ); + Prim + ( + 1054, + I_DIG, + [ + Int + ( + 1055, + Z + .of_int + 3 + ) + ], + [] + ); + Prim + ( + 1056, + I_CDR, + [], + [] + ); + Prim + ( + 1057, + I_CDR, + [], + [] + ); + Prim + ( + 1058, + I_CDR, + [], + [] + ); + Prim + ( + 1059, + I_CDR, + [], + [] + ); + Prim + ( + 1060, + I_CAR, + [], + [] + ); + Prim + ( + 1061, + I_CONTRACT, + [ + Prim + ( + 1062, + T_pair, + [ + Prim + ( + 1063, + T_address, + [], + [] + ); + Prim + ( + 1064, + T_pair, + [ + Prim + ( + 1065, + T_address, + [], + [] + ); + Prim + ( + 1066, + T_nat, + [], + [] + ) + ], + [] + ) + ], + [] + ) + ], + [ + "%transfer" + ] + ); + Prim + ( + 1067, + I_IF_NONE, + [ + Seq + ( + 1068, + [ + Prim + ( + 1069, + I_PUSH, + [ + Prim + ( + 1070, + T_nat, + [], + [] + ); + Int + ( + 1071, + Z + .zero + ) + ], + [] + ); + Prim + ( + 1072, + I_FAILWITH, + [], + [] + ) + ] + ); + Seq + ( + 1073, + [] + ) + ], + [] + ); + Prim + ( + 1074, + I_PUSH, + [ + Prim + ( + 1075, + T_mutez, + [], + [] + ); + Int + ( + 1076, + Z + .zero + ) + ], + [] + ); + Prim + ( + 1077, + I_DIG, + [ + Int + ( + 1078, + Z + .of_int + 3 + ) + ], + [] + ); + Prim + ( + 1079, + I_DIG, + [ + Int + ( + 1080, + Z + .of_int + 3 + ) + ], + [] + ); + Prim + ( + 1081, + I_PAIR, + [], + [] + ); + Prim + ( + 1082, + I_DIG, + [ + Int + ( + 1083, + Z + .of_int + 3 + ) + ], + [] + ); + Prim + ( + 1084, + I_PAIR, + [], + [] + ); + Prim + ( + 1085, + I_TRANSFER_TOKENS, + [], + [] + ); + Prim + ( + 1086, + I_SWAP, + [], + [] + ); + Prim + ( + 1087, + I_DUP, + [], + [] + ); + Prim + ( + 1088, + I_DUG, + [ + Int + ( + 1089, + Z + .of_int + 2 + ) + ], + [] + ); + Prim + ( + 1090, + I_DIG, + [ + Int + ( + 1091, + Z + .of_int + 5 + ) + ], + [] + ); + Prim + ( + 1092, + I_CONTRACT, + [ + Prim + ( + 1093, + T_unit, + [], + [] + ) + ], + [] + ); + Prim + ( + 1094, + I_IF_NONE, + [ + Seq + ( + 1095, + [ + Prim + ( + 1096, + I_PUSH, + [ + Prim + ( + 1097, + T_nat, + [], + [] + ); + Int + ( + 1098, + Z + .of_int + 9 + ) + ], + [] + ); + Prim + ( + 1099, + I_FAILWITH, + [], + [] + ) + ] + ); + Seq + ( + 1100, + [] + ) + ], + [] + ); + Prim + ( + 1101, + I_SWAP, + [], + [] + ); + Prim + ( + 1102, + I_PUSH, + [ + Prim + ( + 1103, + T_unit, + [], + [] + ); + Prim + ( + 1104, + D_Unit, + [], + [] + ) + ], + [] + ); + Prim + ( + 1105, + I_TRANSFER_TOKENS, + [], + [] + ); + Prim + ( + 1106, + I_DIG, + [ + Int + ( + 1107, + Z + .of_int + 5 + ) + ], + [] + ); + Prim + ( + 1108, + I_DUP, + [], + [] + ); + Prim + ( + 1109, + I_DUG, + [ + Int + ( + 1110, + Z + .of_int + 6 + ) + ], + [] + ); + Prim + ( + 1111, + I_CDR, + [], + [] + ); + Prim + ( + 1112, + I_DIG, + [ + Int + ( + 1113, + Z + .of_int + 5 + ) + ], + [] + ); + Prim + ( + 1114, + I_DIG, + [ + Int + ( + 1115, + Z + .of_int + 6 + ) + ], + [] + ); + Prim + ( + 1116, + I_DUP, + [], + [] + ); + Prim + ( + 1117, + I_DUG, + [ + Int + ( + 1118, + Z + .of_int + 7 + ) + ], + [] + ); + Prim + ( + 1119, + I_CAR, + [], + [] + ); + Prim + ( + 1120, + I_ADD, + [], + [] + ); + Prim + ( + 1121, + I_PAIR, + [], + [] + ); + Prim + ( + 1122, + I_DUP, + [], + [] + ); + Prim + ( + 1123, + I_CDR, + [], + [] + ); + Prim + ( + 1124, + I_CDR, + [], + [] + ); + Prim + ( + 1125, + I_DIG, + [ + Int + ( + 1126, + Z + .of_int + 4 + ) + ], + [] + ); + Prim + ( + 1127, + I_DIG, + [ + Int + ( + 1128, + Z + .of_int + 6 + ) + ], + [] + ); + Prim + ( + 1129, + I_CDR, + [], + [] + ); + Prim + ( + 1130, + I_CAR, + [], + [] + ); + Prim + ( + 1131, + I_SUB, + [], + [] + ); + Prim + ( + 1132, + I_PAIR, + [], + [] + ); + Prim + ( + 1133, + I_SWAP, + [], + [] + ); + Prim + ( + 1134, + I_CAR, + [], + [] + ); + Prim + ( + 1135, + I_PAIR, + [], + [] + ); + Prim + ( + 1136, + I_PUSH, + [ + Prim + ( + 1137, + T_mutez, + [], + [] + ); + Int + ( + 1138, + Z + .one + ) + ], + [] + ); + Prim + ( + 1139, + I_DIG, + [ + Int + ( + 1140, + Z + .of_int + 4 + ) + ], + [] + ); + Prim + ( + 1141, + I_MUL, + [], + [] + ); + Prim + ( + 1142, + I_PUSH, + [ + Prim + ( + 1143, + T_address, + [], + [] + ); + String + ( + 1144, + "tz1Ke2h7sDdakHJQh8WX4Z372du1KChsksyU" + ) + ], + [] + ); + Prim + ( + 1145, + I_CONTRACT, + [ + Prim + ( + 1146, + T_unit, + [], + [] + ) + ], + [] + ); + Prim + ( + 1147, + I_IF_NONE, + [ + Seq + ( + 1148, + [ + Prim + ( + 1149, + I_PUSH, + [ + Prim + ( + 1150, + T_nat, + [], + [] + ); + Int + ( + 1151, + Z + .of_int + 9 + ) + ], + [] + ); + Prim + ( + 1152, + I_FAILWITH, + [], + [] + ) + ] + ); + Seq + ( + 1153, + [] + ) + ], + [] + ); + Prim + ( + 1154, + I_SWAP, + [], + [] + ); + Prim + ( + 1155, + I_PUSH, + [ + Prim + ( + 1156, + T_unit, + [], + [] + ); + Prim + ( + 1157, + D_Unit, + [], + [] + ) + ], + [] + ); + Prim + ( + 1158, + I_TRANSFER_TOKENS, + [], + [] + ); + Prim + ( + 1159, + I_SWAP, + [], + [] + ); + Prim + ( + 1160, + I_NIL, + [ + Prim + ( + 1161, + T_operation, + [], + [] + ) + ], + [] + ); + Prim + ( + 1162, + I_DIG, + [ + Int + ( + 1163, + Z + .of_int + 2 + ) + ], + [] + ); + Prim + ( + 1164, + I_CONS, + [], + [] + ); + Prim + ( + 1165, + I_DIG, + [ + Int + ( + 1166, + Z + .of_int + 2 + ) + ], + [] + ); + Prim + ( + 1167, + I_CONS, + [], + [] + ); + Prim + ( + 1168, + I_DIG, + [ + Int + ( + 1169, + Z + .of_int + 2 + ) + ], + [] + ); + Prim + ( + 1170, + I_CONS, + [], + [] + ); + Prim + ( + 1171, + I_PAIR, + [], + [] + ) + ] + ) + ], + [] + ) + ] + ) + ], + [] ) ] + ) ], + [] ) ] ) ], + [] ) ] ) ], + [] ) ] ); + Seq + ( 1172, + [ Prim + ( 1173, + I_IF_LEFT, + [ Seq + ( 1174, + [ Prim + ( 1175, + I_IF_LEFT, + [ Seq + ( 1176, + [ Prim + (1177, I_DROP, [], []); + Prim + ( 1178, + I_SOURCE, + [], + [] ); + Prim + ( 1179, + I_SENDER, + [], + [] ); + Prim + ( 1180, + I_COMPARE, + [], + [] ); + Prim + (1181, I_NEQ, [], []); + Prim + ( 1182, + I_IF, + [ Seq + ( 1183, + [ Prim + ( 1184, + I_DROP, + [], + [] ); + Prim + ( 1185, + I_PUSH, + [ Prim + ( 1186, + T_nat, + [], + [] + ); + Int + ( 1187, + Z + .of_int + 25 + ) + ], + [] ); + Prim + ( 1188, + I_FAILWITH, + [], + [] ) ] + ); + Seq + ( 1189, + [ Prim + ( 1190, + I_PUSH, + [ Prim + ( 1191, + T_mutez, + [], + [] + ); + Int + ( 1192, + Z + .zero + ) + ], + [] ); + Prim + ( 1193, + I_AMOUNT, + [], + [] ); + Prim + ( 1194, + I_COMPARE, + [], + [] ); + Prim + ( 1195, + I_GT, + [], + [] ); + Prim + ( 1196, + I_IF, + [ Seq + ( 1197, + [ + Prim + ( + 1198, + I_DROP, + [], + [] + ); + Prim + ( + 1199, + I_PUSH, + [ + Prim + ( + 1200, + T_nat, + [], + [] + ); + Int + ( + 1201, + Z + .of_int + 10 + ) + ], + [] + ); + Prim + ( + 1202, + I_FAILWITH, + [], + [] + ) + ] + ); + Seq + ( 1203, + [ + Prim + ( + 1204, + I_DUP, + [], + [] + ); + Prim + ( + 1205, + I_CDR, + [], + [] + ); + Prim + ( + 1206, + I_CDR, + [], + [] + ); + Prim + ( + 1207, + I_CDR, + [], + [] + ); + Prim + ( + 1208, + I_CAR, + [], + [] + ); + Prim + ( + 1209, + I_IF, + [ + Seq + ( + 1210, + [ + Prim + ( + 1211, + I_DROP, + [], + [] + ); + Prim + ( + 1212, + I_PUSH, + [ + Prim + ( + 1213, + T_nat, + [], + [] + ); + Int + ( + 1214, + Z + .of_int + 33 + ) + ], + [] + ); + Prim + ( + 1215, + I_FAILWITH, + [], + [] + ) + ] + ); + Seq + ( + 1216, + [ + Prim + ( + 1217, + I_SELF, + [], + [ + "%updateTokenPoolInternal" + ] + ); + Prim + ( + 1218, + I_SWAP, + [], + [] + ); + Prim + ( + 1219, + I_DUP, + [], + [] + ); + Prim + ( + 1220, + I_DUG, + [ + Int + ( + 1221, + Z + .of_int + 2 + ) + ], + [] + ); + Prim + ( + 1222, + I_CDR, + [], + [] + ); + Prim + ( + 1223, + I_CDR, + [], + [] + ); + Prim + ( + 1224, + I_CDR, + [], + [] + ); + Prim + ( + 1225, + I_CDR, + [], + [] + ); + Prim + ( + 1226, + I_CAR, + [], + [] + ); + Prim + ( + 1227, + I_CONTRACT, + [ + Prim + ( + 1228, + T_pair, + [ + Prim + ( + 1229, + T_address, + [], + [] + ); + Prim + ( + 1230, + T_contract, + [ + Prim + ( + 1231, + T_nat, + [], + [] + ) + ], + [] + ) + ], + [] + ) + ], + [ + "%getBalance" + ] + ); + Prim + ( + 1232, + I_IF_NONE, + [ + Seq + ( + 1233, + [ + Prim + ( + 1234, + I_PUSH, + [ + Prim + ( + 1235, + T_nat, + [], + [] + ); + Int + ( + 1236, + Z + .of_int + 28 + ) + ], + [] + ); + Prim + ( + 1237, + I_FAILWITH, + [], + [] + ) + ] + ); + Seq + ( + 1238, + [] + ) + ], + [] + ); + Prim + ( + 1239, + I_PUSH, + [ + Prim + ( + 1240, + T_mutez, + [], + [] + ); + Int + ( + 1241, + Z + .zero + ) + ], + [] + ); + Prim + ( + 1242, + I_DIG, + [ + Int + ( + 1243, + Z + .of_int + 2 + ) + ], + [] + ); + Prim + ( + 1244, + I_SELF, + [], + [] + ); + Prim + ( + 1245, + I_ADDRESS, + [], + [] + ); + Prim + ( + 1246, + I_PAIR, + [], + [] + ); + Prim + ( + 1247, + I_TRANSFER_TOKENS, + [], + [] + ); + Prim + ( + 1248, + I_SWAP, + [], + [] + ); + Prim + ( + 1249, + I_DUP, + [], + [] + ); + Prim + ( + 1250, + I_DUG, + [ + Int + ( + 1251, + Z + .of_int + 2 + ) + ], + [] + ); + Prim + ( + 1252, + I_CDR, + [], + [] + ); + Prim + ( + 1253, + I_CDR, + [], + [] + ); + Prim + ( + 1254, + I_CDR, + [], + [] + ); + Prim + ( + 1255, + I_CDR, + [], + [] + ); + Prim + ( + 1256, + I_PUSH, + [ + Prim + ( + 1257, + T_bool, + [], + [] + ); + Prim + ( + 1258, + D_True, + [], + [] + ) + ], + [] + ); + Prim + ( + 1259, + I_PAIR, + [], + [] + ); + Prim + ( + 1260, + I_DIG, + [ + Int + ( + 1261, + Z + .of_int + 2 + ) + ], + [] + ); + Prim + ( + 1262, + I_DUP, + [], + [] + ); + Prim + ( + 1263, + I_DUG, + [ + Int + ( + 1264, + Z + .of_int + 3 + ) + ], + [] + ); + Prim + ( + 1265, + I_CDR, + [], + [] + ); + Prim + ( + 1266, + I_CDR, + [], + [] + ); + Prim + ( + 1267, + I_CAR, + [], + [] + ); + Prim + ( + 1268, + I_PAIR, + [], + [] + ); + Prim + ( + 1269, + I_DIG, + [ + Int + ( + 1270, + Z + .of_int + 2 + ) + ], + [] + ); + Prim + ( + 1271, + I_DUP, + [], + [] + ); + Prim + ( + 1272, + I_DUG, + [ + Int + ( + 1273, + Z + .of_int + 3 + ) + ], + [] + ); + Prim + ( + 1274, + I_CDR, + [], + [] + ); + Prim + ( + 1275, + I_CAR, + [], + [] + ); + Prim + ( + 1276, + I_PAIR, + [], + [] + ); + Prim + ( + 1277, + I_DIG, + [ + Int + ( + 1278, + Z + .of_int + 2 + ) + ], + [] + ); + Prim + ( + 1279, + I_CAR, + [], + [] + ); + Prim + ( + 1280, + I_PAIR, + [], + [] + ); + Prim + ( + 1281, + I_NIL, + [ + Prim + ( + 1282, + T_operation, + [], + [] + ) + ], + [] + ); + Prim + ( + 1283, + I_DIG, + [ + Int + ( + 1284, + Z + .of_int + 2 + ) + ], + [] + ); + Prim + ( + 1285, + I_CONS, + [], + [] + ); + Prim + ( + 1286, + I_PAIR, + [], + [] + ) + ] + ) + ], + [] + ) + ] + ) + ], + [] ) ] + ) ], + [] ) ] ); + Seq + ( 1287, + [ Prim + (1288, I_SWAP, [], []); + Prim + (1289, I_DUP, [], []); + Prim + ( 1290, + I_DUG, + [ Int + ( 1291, + Z.of_int 2 ) + ], + [] ); + Prim + (1292, I_CDR, [], []); + Prim + (1293, I_CDR, [], []); + Prim + (1294, I_CDR, [], []); + Prim + (1295, I_CDR, [], []); + Prim + (1296, I_CAR, [], []); + Prim + ( 1297, + I_SENDER, + [], + [] ); + Prim + ( 1298, + I_COMPARE, + [], + [] ); + Prim + (1299, I_NEQ, [], []); + Prim + ( 1300, + I_DIG, + [ Int + ( 1301, + Z.of_int 2 ) + ], + [] ); + Prim + (1302, I_DUP, [], []); + Prim + ( 1303, + I_DUG, + [ Int + ( 1304, + Z.of_int 3 ) + ], + [] ); + Prim + (1305, I_CDR, [], []); + Prim + (1306, I_CDR, [], []); + Prim + (1307, I_CDR, [], []); + Prim + (1308, I_CAR, [], []); + Prim + (1309, I_NOT, [], []); + Prim + (1310, I_OR, [], []); + Prim + ( 1311, + I_IF, + [ Seq + ( 1312, + [ Prim + ( 1313, + I_DROP, + [ Int + ( 1314, + Z + .of_int + 2 + ) + ], + [] ); + Prim + ( 1315, + I_PUSH, + [ Prim + ( 1316, + T_nat, + [], + [] + ); + Int + ( 1317, + Z + .of_int + 29 + ) + ], + [] ); + Prim + ( 1318, + I_FAILWITH, + [], + [] ) ] + ); + Seq + ( 1319, + [ Prim + ( 1320, + I_PUSH, + [ Prim + ( 1321, + T_mutez, + [], + [] + ); + Int + ( 1322, + Z + .zero + ) + ], + [] ); + Prim + ( 1323, + I_AMOUNT, + [], + [] ); + Prim + ( 1324, + I_COMPARE, + [], + [] ); + Prim + ( 1325, + I_GT, + [], + [] ); + Prim + ( 1326, + I_IF, + [ Seq + ( 1327, + [ + Prim + ( + 1328, + I_DROP, + [ + Int + ( + 1329, + Z + .of_int + 2 + ) + ], + [] + ); + Prim + ( + 1330, + I_PUSH, + [ + Prim + ( + 1331, + T_nat, + [], + [] + ); + Int + ( + 1332, + Z + .of_int + 10 + ) + ], + [] + ); + Prim + ( + 1333, + I_FAILWITH, + [], + [] + ) + ] + ); + Seq + ( 1334, + [ + Prim + ( + 1335, + I_SWAP, + [], + [] + ); + Prim + ( + 1336, + I_CDR, + [], + [] + ); + Prim + ( + 1337, + I_SWAP, + [], + [] + ); + Prim + ( + 1338, + I_PAIR, + [], + [] + ); + Prim + ( + 1339, + I_DUP, + [], + [] + ); + Prim + ( + 1340, + I_CDR, + [], + [] + ); + Prim + ( + 1341, + I_CDR, + [], + [] + ); + Prim + ( + 1342, + I_CDR, + [], + [] + ); + Prim + ( + 1343, + I_CDR, + [], + [] + ); + Prim + ( + 1344, + I_PUSH, + [ + Prim + ( + 1345, + T_bool, + [], + [] + ); + Prim + ( + 1346, + D_False, + [], + [] + ) + ], + [] + ); + Prim + ( + 1347, + I_PAIR, + [], + [] + ); + Prim + ( + 1348, + I_SWAP, + [], + [] + ); + Prim + ( + 1349, + I_DUP, + [], + [] + ); + Prim + ( + 1350, + I_DUG, + [ + Int + ( + 1351, + Z + .of_int + 2 + ) + ], + [] + ); + Prim + ( + 1352, + I_CDR, + [], + [] + ); + Prim + ( + 1353, + I_CDR, + [], + [] + ); + Prim + ( + 1354, + I_CAR, + [], + [] + ); + Prim + ( + 1355, + I_PAIR, + [], + [] + ); + Prim + ( + 1356, + I_SWAP, + [], + [] + ); + Prim + ( + 1357, + I_DUP, + [], + [] + ); + Prim + ( + 1358, + I_DUG, + [ + Int + ( + 1359, + Z + .of_int + 2 + ) + ], + [] + ); + Prim + ( + 1360, + I_CDR, + [], + [] + ); + Prim + ( + 1361, + I_CAR, + [], + [] + ); + Prim + ( + 1362, + I_PAIR, + [], + [] + ); + Prim + ( + 1363, + I_SWAP, + [], + [] + ); + Prim + ( + 1364, + I_CAR, + [], + [] + ); + Prim + ( + 1365, + I_PAIR, + [], + [] + ); + Prim + ( + 1366, + I_NIL, + [ + Prim + ( + 1367, + T_operation, + [], + [] + ) + ], + [] + ); + Prim + ( + 1368, + I_PAIR, + [], + [] + ) + ] + ) + ], + [] ) ] + ) ], + [] ) ] ) ], + [] ) ] ); + Seq + ( 1369, + [ Prim (1370, I_DUP, [], []); + Prim (1371, I_CDR, [], []); + Prim (1372, I_SWAP, [], []); + Prim (1373, I_CAR, [], []); + Prim (1374, I_SWAP, [], []); + Prim (1375, I_DUP, [], []); + Prim (1376, I_CDR, [], []); + Prim (1377, I_SWAP, [], []); + Prim (1378, I_CAR, [], []); + Prim + ( 1379, + I_DIG, + [Int (1380, Z.of_int 3)], + [] ); + Prim (1381, I_DUP, [], []); + Prim + ( 1382, + I_DUG, + [Int (1383, Z.of_int 4)], + [] ); + Prim (1384, I_CDR, [], []); + Prim (1385, I_CDR, [], []); + Prim (1386, I_CDR, [], []); + Prim (1387, I_CAR, [], []); + Prim + ( 1388, + I_IF, + [ Seq + ( 1389, + [ Prim + ( 1390, + I_DROP, + [ Int + ( 1391, + Z.of_int 4 ) + ], + [] ); + Prim + ( 1392, + I_PUSH, + [ Prim + ( 1393, + T_nat, + [], + [] ); + Int + ( 1394, + Z.of_int 2 ) + ], + [] ); + Prim + ( 1395, + I_FAILWITH, + [], + [] ) ] ); + Seq + ( 1396, + [ Prim + (1397, I_SWAP, [], []); + Prim + (1398, I_NOW, [], []); + Prim + ( 1399, + I_COMPARE, + [], + [] ); + Prim + (1400, I_GE, [], []); + Prim + ( 1401, + I_IF, + [ Seq + ( 1402, + [ Prim + ( 1403, + I_DROP, + [ Int + ( 1404, + Z + .of_int + 3 + ) + ], + [] ); + Prim + ( 1405, + I_PUSH, + [ Prim + ( 1406, + T_nat, + [], + [] + ); + Int + ( 1407, + Z + .of_int + 3 + ) + ], + [] ); + Prim + ( 1408, + I_FAILWITH, + [], + [] ) ] + ); + Seq + ( 1409, + [ Prim + ( 1410, + I_PUSH, + [ Prim + ( 1411, + T_mutez, + [], + [] + ); + Int + ( 1412, + Z + .one + ) + ], + [] ); + Prim + ( 1413, + I_DIG, + [ Int + ( 1414, + Z + .of_int + 3 + ) + ], + [] ); + Prim + ( 1415, + I_DUP, + [], + [] ); + Prim + ( 1416, + I_DUG, + [ Int + ( 1417, + Z + .of_int + 4 + ) + ], + [] ); + Prim + ( 1418, + I_CDR, + [], + [] ); + Prim + ( 1419, + I_CAR, + [], + [] ); + Prim + ( 1420, + I_EDIV, + [], + [] ); + Prim + ( 1421, + I_IF_NONE, + [ Seq + ( 1422, + [ + Prim + ( + 1423, + I_PUSH, + [ + Prim + ( + 1424, + T_string, + [], + [] + ); + String + ( + 1425, + "DIV \ + by \ + 0" + ) + ], + [] + ); + Prim + ( + 1426, + I_FAILWITH, + [], + [] + ) + ] + ); + Seq + ( 1427, + [] + ) + ], + [] ); + Prim + ( 1428, + I_CAR, + [], + [] ); + Prim + ( 1429, + I_AMOUNT, + [], + [] ); + Prim + ( 1430, + I_PUSH, + [ Prim + ( 1431, + T_mutez, + [], + [] + ); + Int + ( 1432, + Z + .one + ) + ], + [] ); + Prim + ( 1433, + I_SWAP, + [], + [] ); + Prim + ( 1434, + I_EDIV, + [], + [] ); + Prim + ( 1435, + I_IF_NONE, + [ Seq + ( 1436, + [ + Prim + ( + 1437, + I_PUSH, + [ + Prim + ( + 1438, + T_string, + [], + [] + ); + String + ( + 1439, + "DIV \ + by \ + 0" + ) + ], + [] + ); + Prim + ( + 1440, + I_FAILWITH, + [], + [] + ) + ] + ); + Seq + ( 1441, + [] + ) + ], + [] ); + Prim + ( 1442, + I_CAR, + [], + [] ); + Prim + ( 1443, + I_PUSH, + [ Prim + ( 1444, + T_nat, + [], + [] + ); + Int + ( 1445, + Z + .of_int + 1000 + ) + ], + [] ); + Prim + ( 1446, + I_SWAP, + [], + [] ); + Prim + ( 1447, + I_DUP, + [], + [] ); + Prim + ( 1448, + I_DUG, + [ Int + ( 1449, + Z + .of_int + 2 + ) + ], + [] ); + Prim + ( 1450, + I_EDIV, + [], + [] ); + Prim + ( 1451, + I_IF_NONE, + [ Seq + ( 1452, + [ + Prim + ( + 1453, + I_PUSH, + [ + Prim + ( + 1454, + T_string, + [], + [] + ); + String + ( + 1455, + "DIV \ + by \ + 0" + ) + ], + [] + ); + Prim + ( + 1456, + I_FAILWITH, + [], + [] + ) + ] + ); + Seq + ( 1457, + [] + ) + ], + [] ); + Prim + ( 1458, + I_CAR, + [], + [] ); + Prim + ( 1459, + I_DUP, + [], + [] ); + Prim + ( 1460, + I_DIG, + [ Int + ( 1461, + Z + .of_int + 2 + ) + ], + [] ); + Prim + ( 1462, + I_SUB, + [], + [] ); + Prim + ( 1463, + I_ABS, + [], + [] ); + Prim + ( 1464, + I_PUSH, + [ Prim + ( 1465, + T_nat, + [], + [] + ); + Int + ( 1466, + Z + .of_int + 999 + ) + ], + [] ); + Prim + ( 1467, + I_SWAP, + [], + [] ); + Prim + ( 1468, + I_DUP, + [], + [] ); + Prim + ( 1469, + I_DUG, + [ Int + ( 1470, + Z + .of_int + 2 + ) + ], + [] ); + Prim + ( 1471, + I_MUL, + [], + [] ); + Prim + ( 1472, + I_PUSH, + [ Prim + ( 1473, + T_nat, + [], + [] + ); + Int + ( 1474, + Z + .of_int + 1000 + ) + ], + [] ); + Prim + ( 1475, + I_DIG, + [ Int + ( 1476, + Z + .of_int + 4 + ) + ], + [] ); + Prim + ( 1477, + I_MUL, + [], + [] ); + Prim + ( 1478, + I_ADD, + [], + [] ); + Prim + ( 1479, + I_DIG, + [ Int + ( 1480, + Z + .of_int + 5 + ) + ], + [] ); + Prim + ( 1481, + I_DUP, + [], + [] ); + Prim + ( 1482, + I_DUG, + [ Int + ( 1483, + Z + .of_int + 6 + ) + ], + [] ); + Prim + ( 1484, + I_CAR, + [], + [] ); + Prim + ( 1485, + I_PUSH, + [ Prim + ( 1486, + T_nat, + [], + [] + ); + Int + ( 1487, + Z + .of_int + 999 + ) + ], + [] ); + Prim + ( 1488, + I_DIG, + [ Int + ( 1489, + Z + .of_int + 3 + ) + ], + [] ); + Prim + ( 1490, + I_MUL, + [], + [] ); + Prim + ( 1491, + I_MUL, + [], + [] ); + Prim + ( 1492, + I_EDIV, + [], + [] ); + Prim + ( 1493, + I_IF_NONE, + [ Seq + ( 1494, + [ + Prim + ( + 1495, + I_PUSH, + [ + Prim + ( + 1496, + T_string, + [], + [] + ); + String + ( + 1497, + "DIV \ + by \ + 0" + ) + ], + [] + ); + Prim + ( + 1498, + I_FAILWITH, + [], + [] + ) + ] + ); + Seq + ( 1499, + [] + ) + ], + [] ); + Prim + ( 1500, + I_CAR, + [], + [] ); + Prim + ( 1501, + I_DIG, + [ Int + ( 1502, + Z + .of_int + 2 + ) + ], + [] ); + Prim + ( 1503, + I_SWAP, + [], + [] ); + Prim + ( 1504, + I_DUP, + [], + [] ); + Prim + ( 1505, + I_DUG, + [ Int + ( 1506, + Z + .of_int + 2 + ) + ], + [] ); + Prim + ( 1507, + I_COMPARE, + [], + [] ); + Prim + ( 1508, + I_LT, + [], + [] ); + Prim + ( 1509, + I_IF, + [ Seq + ( 1510, + [ + Prim + ( + 1511, + I_DROP, + [], + [] + ); + Prim + ( + 1512, + I_PUSH, + [ + Prim + ( + 1513, + T_nat, + [], + [] + ); + Int + ( + 1514, + Z + .of_int + 18 + ) + ], + [] + ); + Prim + ( + 1515, + I_FAILWITH, + [], + [] + ) + ] + ); + Seq + ( 1516, + [] + ) + ], + [] ); + Prim + ( 1517, + I_DUP, + [], + [] ); + Prim + ( 1518, + I_DIG, + [ Int + ( 1519, + Z + .of_int + 4 + ) + ], + [] ); + Prim + ( 1520, + I_DUP, + [], + [] ); + Prim + ( 1521, + I_DUG, + [ Int + ( 1522, + Z + .of_int + 5 + ) + ], + [] ); + Prim + ( 1523, + I_CAR, + [], + [] ); + Prim + ( 1524, + I_SUB, + [], + [] ); + Prim + ( 1525, + I_ISNAT, + [], + [] ); + Prim + ( 1526, + I_IF_NONE, + [ Seq + ( 1527, + [ + Prim + ( + 1528, + I_PUSH, + [ + Prim + ( + 1529, + T_nat, + [], + [] + ); + Int + ( + 1530, + Z + .of_int + 19 + ) + ], + [] + ); + Prim + ( + 1531, + I_FAILWITH, + [], + [] + ) + ] + ); + Seq + ( 1532, + [] + ) + ], + [] ); + Prim + ( 1533, + I_DIG, + [ Int + ( 1534, + Z + .of_int + 4 + ) + ], + [] ); + Prim + ( 1535, + I_DUP, + [], + [] ); + Prim + ( 1536, + I_DUG, + [ Int + ( 1537, + Z + .of_int + 5 + ) + ], + [] ); + Prim + ( 1538, + I_CDR, + [], + [] ); + Prim + ( 1539, + I_CDR, + [], + [] ); + Prim + ( 1540, + I_AMOUNT, + [], + [] ); + Prim + ( 1541, + I_DIG, + [ Int + ( 1542, + Z + .of_int + 6 + ) + ], + [] ); + Prim + ( 1543, + I_DUP, + [], + [] ); + Prim + ( 1544, + I_DUG, + [ Int + ( 1545, + Z + .of_int + 7 + ) + ], + [] ); + Prim + ( 1546, + I_CDR, + [], + [] ); + Prim + ( 1547, + I_CAR, + [], + [] ); + Prim + ( 1548, + I_ADD, + [], + [] ); + Prim + ( 1549, + I_PAIR, + [], + [] ); + Prim + ( 1550, + I_DIG, + [ Int + ( 1551, + Z + .of_int + 5 + ) + ], + [] ); + Prim + ( 1552, + I_CAR, + [], + [] ); + Prim + ( 1553, + I_PAIR, + [], + [] ); + Prim + ( 1554, + I_CDR, + [], + [] ); + Prim + ( 1555, + I_SWAP, + [], + [] ); + Prim + ( 1556, + I_PAIR, + [], + [] ); + Prim + ( 1557, + I_SWAP, + [], + [] ); + Prim + ( 1558, + I_DIG, + [ Int + ( 1559, + Z + .of_int + 3 + ) + ], + [] ); + Prim + ( 1560, + I_PAIR, + [], + [] ); + Prim + ( 1561, + I_SELF, + [], + [] ); + Prim + ( 1562, + I_ADDRESS, + [], + [] ); + Prim + ( 1563, + I_PAIR, + [], + [] ); + Prim + ( 1564, + I_SWAP, + [], + [] ); + Prim + ( 1565, + I_DUP, + [], + [] ); + Prim + ( 1566, + I_DUG, + [ Int + ( 1567, + Z + .of_int + 2 + ) + ], + [] ); + Prim + ( 1568, + I_SWAP, + [], + [] ); + Prim + ( 1569, + I_DUP, + [], + [] ); + Prim + ( 1570, + I_CDR, + [], + [] ); + Prim + ( 1571, + I_SWAP, + [], + [] ); + Prim + ( 1572, + I_CAR, + [], + [] ); + Prim + ( 1573, + I_SWAP, + [], + [] ); + Prim + ( 1574, + I_DUP, + [], + [] ); + Prim + ( 1575, + I_CDR, + [], + [] ); + Prim + ( 1576, + I_SWAP, + [], + [] ); + Prim + ( 1577, + I_CAR, + [], + [] ); + Prim + ( 1578, + I_DIG, + [ Int + ( 1579, + Z + .of_int + 3 + ) + ], + [] ); + Prim + ( 1580, + I_CDR, + [], + [] ); + Prim + ( 1581, + I_CDR, + [], + [] ); + Prim + ( 1582, + I_CDR, + [], + [] ); + Prim + ( 1583, + I_CDR, + [], + [] ); + Prim + ( 1584, + I_CAR, + [], + [] ); + Prim + ( 1585, + I_CONTRACT, + [ Prim + ( 1586, + T_pair, + [ + Prim + ( + 1587, + T_address, + [], + [] + ); + Prim + ( + 1588, + T_pair, + [ + Prim + ( + 1589, + T_address, + [], + [] + ); + Prim + ( + 1590, + T_nat, + [], + [] + ) + ], + [] + ) + ], + [] + ) + ], + [ "%transfer" + ] ); + Prim + ( 1591, + I_IF_NONE, + [ Seq + ( 1592, + [ + Prim + ( + 1593, + I_PUSH, + [ + Prim + ( + 1594, + T_nat, + [], + [] + ); + Int + ( + 1595, + Z + .zero + ) + ], + [] + ); + Prim + ( + 1596, + I_FAILWITH, + [], + [] + ) + ] + ); + Seq + ( 1597, + [] + ) + ], + [] ); + Prim + ( 1598, + I_PUSH, + [ Prim + ( 1599, + T_mutez, + [], + [] + ); + Int + ( 1600, + Z + .zero + ) + ], + [] ); + Prim + ( 1601, + I_DIG, + [ Int + ( 1602, + Z + .of_int + 3 + ) + ], + [] ); + Prim + ( 1603, + I_DIG, + [ Int + ( 1604, + Z + .of_int + 3 + ) + ], + [] ); + Prim + ( 1605, + I_PAIR, + [], + [] ); + Prim + ( 1606, + I_DIG, + [ Int + ( 1607, + Z + .of_int + 3 + ) + ], + [] ); + Prim + ( 1608, + I_PAIR, + [], + [] ); + Prim + ( 1609, + I_TRANSFER_TOKENS, + [], + [] ); + Prim + ( 1610, + I_PUSH, + [ Prim + ( 1611, + T_mutez, + [], + [] + ); + Int + ( 1612, + Z + .one + ) + ], + [] ); + Prim + ( 1613, + I_DIG, + [ Int + ( 1614, + Z + .of_int + 3 + ) + ], + [] ); + Prim + ( 1615, + I_MUL, + [], + [] ); + Prim + ( 1616, + I_PUSH, + [ Prim + ( 1617, + T_address, + [], + [] + ); + String + ( 1618, + "tz1Ke2h7sDdakHJQh8WX4Z372du1KChsksyU" + ) + ], + [] ); + Prim + ( 1619, + I_CONTRACT, + [ Prim + ( 1620, + T_unit, + [], + [] + ) + ], + [] ); + Prim + ( 1621, + I_IF_NONE, + [ Seq + ( 1622, + [ + Prim + ( + 1623, + I_PUSH, + [ + Prim + ( + 1624, + T_nat, + [], + [] + ); + Int + ( + 1625, + Z + .of_int + 9 + ) + ], + [] + ); + Prim + ( + 1626, + I_FAILWITH, + [], + [] + ) + ] + ); + Seq + ( 1627, + [] + ) + ], + [] ); + Prim + ( 1628, + I_SWAP, + [], + [] ); + Prim + ( 1629, + I_PUSH, + [ Prim + ( 1630, + T_unit, + [], + [] + ); + Prim + ( 1631, + D_Unit, + [], + [] + ) + ], + [] ); + Prim + ( 1632, + I_TRANSFER_TOKENS, + [], + [] ); + Prim + ( 1633, + I_DIG, + [ Int + ( 1634, + Z + .of_int + 2 + ) + ], + [] ); + Prim + ( 1635, + I_NIL, + [ Prim + ( 1636, + T_operation, + [], + [] + ) + ], + [] ); + Prim + ( 1637, + I_DIG, + [ Int + ( 1638, + Z + .of_int + 2 + ) + ], + [] ); + Prim + ( 1639, + I_CONS, + [], + [] ); + Prim + ( 1640, + I_DIG, + [ Int + ( 1641, + Z + .of_int + 2 + ) + ], + [] ); + Prim + ( 1642, + I_CONS, + [], + [] ); + Prim + ( 1643, + I_PAIR, + [], + [] ) ] + ) ], + [] ) ] ) ], + [] ) ] ) ], + [] ) ] ) ], + [] ) ] ) ], + [] ) ] ) diff --git a/src/proto_alpha/lib_protocol/liquidity_baking_lqt.ml b/src/proto_alpha/lib_protocol/liquidity_baking_lqt.ml new file mode 100644 index 0000000000000000000000000000000000000000..a335efa6fe3282c5c63f2353fb8a854e6f14ffb5 --- /dev/null +++ b/src/proto_alpha/lib_protocol/liquidity_baking_lqt.ml @@ -0,0 +1,1582 @@ +open Michelson_v1_primitives +open Micheline + +let script = + Seq + ( 0, + [ Prim + ( 1, + K_parameter, + [ Prim + ( 2, + T_or, + [ Prim + ( 3, + T_or, + [ Prim + ( 4, + T_or, + [ Prim + ( 5, + T_pair, + [ Prim (6, T_address, [], ["%spender"]); + Prim (7, T_nat, [], ["%value"]) ], + ["%approve"] ); + Prim + ( 8, + T_pair, + [ Prim + ( 9, + T_pair, + [ Prim (10, T_address, [], ["%owner"]); + Prim + (11, T_address, [], ["%spender"]) + ], + ["%request"] ); + Prim + ( 12, + T_contract, + [Prim (13, T_nat, [], [])], + ["%callback"] ) ], + ["%getAllowance"] ) ], + [] ); + Prim + ( 14, + T_or, + [ Prim + ( 15, + T_pair, + [ Prim (16, T_address, [], ["%owner"]); + Prim + ( 17, + T_contract, + [Prim (18, T_nat, [], [])], + ["%callback"] ) ], + ["%getBalance"] ); + Prim + ( 19, + T_pair, + [ Prim (20, T_unit, [], ["%request"]); + Prim + ( 21, + T_contract, + [Prim (22, T_nat, [], [])], + ["%callback"] ) ], + ["%getTotalSupply"] ) ], + [] ) ], + [] ); + Prim + ( 23, + T_or, + [ Prim + ( 24, + T_pair, + [ Prim (25, T_int, [], ["%quantity"]); + Prim (26, T_address, [], ["%target"]) ], + ["%mintOrBurn"] ); + Prim + ( 27, + T_pair, + [ Prim (28, T_address, [], ["%from"]); + Prim + ( 29, + T_pair, + [ Prim (30, T_address, [], ["%to"]); + Prim (31, T_nat, [], ["%value"]) ], + [] ) ], + ["%transfer"] ) ], + [] ) ], + [] ) ], + [] ); + Prim + ( 32, + K_storage, + [ Prim + ( 33, + T_pair, + [ Prim + ( 34, + T_big_map, + [Prim (35, T_address, [], []); Prim (36, T_nat, [], [])], + ["%tokens"] ); + Prim + ( 37, + T_pair, + [ Prim + ( 38, + T_big_map, + [ Prim + ( 39, + T_pair, + [ Prim (40, T_address, [], ["%owner"]); + Prim (41, T_address, [], ["%spender"]) ], + [] ); + Prim (42, T_nat, [], []) ], + ["%allowances"] ); + Prim + ( 43, + T_pair, + [ Prim (44, T_address, [], ["%admin"]); + Prim (45, T_nat, [], ["%total_supply"]) ], + [] ) ], + [] ) ], + [] ) ], + [] ); + Prim + ( 46, + K_code, + [ Seq + ( 47, + [ Prim (48, I_DUP, [], []); + Prim (49, I_CDR, [], []); + Prim + ( 50, + I_PUSH, + [Prim (51, T_mutez, [], []); Int (52, Z.zero)], + [] ); + Prim (53, I_AMOUNT, [], []); + Prim (54, I_COMPARE, [], []); + Prim (55, I_NEQ, [], []); + Prim + ( 56, + I_IF, + [ Seq + ( 57, + [ Prim + ( 58, + I_PUSH, + [ Prim (59, T_string, [], []); + String (60, "DontSendTez") ], + [] ); + Prim (61, I_FAILWITH, [], []) ] ); + Seq (62, []) ], + [] ); + Prim (63, I_SWAP, [], []); + Prim (64, I_CAR, [], []); + Prim + ( 65, + I_IF_LEFT, + [ Seq + ( 66, + [ Prim + ( 67, + I_IF_LEFT, + [ Seq + ( 68, + [ Prim + ( 69, + I_IF_LEFT, + [ Seq + ( 70, + [ Prim + (71, I_SWAP, [], []); + Prim (72, I_DUP, [], []); + Prim + ( 73, + I_DUG, + [ Int + (74, Z.of_int 2) + ], + [] ); + Prim (75, I_CDR, [], []); + Prim (76, I_CAR, [], []); + Prim + (77, I_SWAP, [], []); + Prim (78, I_DUP, [], []); + Prim + ( 79, + I_DUG, + [ Int + (80, Z.of_int 2) + ], + [] ); + Prim (81, I_CAR, [], []); + Prim + (82, I_SENDER, [], []); + Prim + (83, I_PAIR, [], []); + Prim + ( 84, + I_PUSH, + [ Prim + ( 85, + T_nat, + [], + [] ); + Int (86, Z.zero) + ], + [] ); + Prim + ( 87, + I_DIG, + [ Int + (88, Z.of_int 3) + ], + [] ); + Prim (89, I_DUP, [], []); + Prim + ( 90, + I_DUG, + [ Int + (91, Z.of_int 4) + ], + [] ); + Prim (92, I_CDR, [], []); + Prim + ( 93, + I_COMPARE, + [], + [] ); + Prim (94, I_GT, [], []); + Prim + ( 95, + I_PUSH, + [ Prim + ( 96, + T_nat, + [], + [] ); + Int (97, Z.zero) + ], + [] ); + Prim + ( 98, + I_DIG, + [ Int + (99, Z.of_int 3) + ], + [] ); + Prim + (100, I_DUP, [], []); + Prim + ( 101, + I_DUG, + [ Int + ( 102, + Z.of_int 4 ) + ], + [] ); + Prim + ( 103, + I_DIG, + [ Int + ( 104, + Z.of_int 3 ) + ], + [] ); + Prim + (105, I_DUP, [], []); + Prim + ( 106, + I_DUG, + [ Int + ( 107, + Z.of_int 4 ) + ], + [] ); + Prim + (108, I_GET, [], []); + Prim + ( 109, + I_IF_NONE, + [ Seq + ( 110, + [ Prim + ( 111, + I_PUSH, + [ Prim + ( 112, + T_nat, + [], + [] + ); + Int + ( 113, + Z + .zero + ) + ], + [] ) ] + ); + Seq (114, []) ], + [] ); + Prim + ( 115, + I_COMPARE, + [], + [] ); + Prim (116, I_GT, [], []); + Prim + (117, I_AND, [], []); + Prim + ( 118, + I_IF, + [ Seq + ( 119, + [ Prim + ( 120, + I_PUSH, + [ Prim + ( 121, + T_string, + [], + [] + ); + String + ( 122, + "UnsafeAllowanceChange" + ) + ], + [] ); + Prim + ( 123, + I_FAILWITH, + [], + [] ) ] + ); + Seq (124, []) ], + [] ); + Prim + ( 125, + I_DIG, + [ Int + ( 126, + Z.of_int 3 ) + ], + [] ); + Prim + (127, I_DUP, [], []); + Prim + ( 128, + I_DUG, + [ Int + ( 129, + Z.of_int 4 ) + ], + [] ); + Prim + (130, I_CDR, [], []); + Prim + (131, I_CDR, [], []); + Prim + ( 132, + I_DIG, + [ Int + ( 133, + Z.of_int 2 ) + ], + [] ); + Prim + ( 134, + I_DIG, + [ Int + ( 135, + Z.of_int 3 ) + ], + [] ); + Prim + (136, I_CDR, [], []); + Prim + ( 137, + I_PUSH, + [ Prim + ( 138, + T_nat, + [], + [] ); + Int (139, Z.zero) + ], + [] ); + Prim + (140, I_SWAP, [], []); + Prim + (141, I_DUP, [], []); + Prim + ( 142, + I_DUG, + [ Int + ( 143, + Z.of_int 2 ) + ], + [] ); + Prim + ( 144, + I_COMPARE, + [], + [] ); + Prim (145, I_EQ, [], []); + Prim + ( 146, + I_IF, + [ Seq + ( 147, + [ Prim + ( 148, + I_DROP, + [], + [] ); + Prim + ( 149, + I_NONE, + [ Prim + ( 150, + T_nat, + [], + [] + ) + ], + [] ) ] + ); + Seq + ( 151, + [ Prim + ( 152, + I_SOME, + [], + [] ) ] + ) ], + [] ); + Prim + ( 153, + I_DIG, + [ Int + ( 154, + Z.of_int 3 ) + ], + [] ); + Prim + ( 155, + I_UPDATE, + [], + [] ); + Prim + (156, I_PAIR, [], []); + Prim + (157, I_SWAP, [], []); + Prim + (158, I_CAR, [], []); + Prim + (159, I_PAIR, [], []); + Prim + ( 160, + I_NIL, + [ Prim + ( 161, + T_operation, + [], + [] ) ], + [] ); + Prim + (162, I_PAIR, [], []) + ] ); + Seq + ( 163, + [ Prim + (164, I_SWAP, [], []); + Prim + (165, I_DUP, [], []); + Prim + ( 166, + I_DIG, + [ Int + ( 167, + Z.of_int 2 ) + ], + [] ); + Prim + ( 168, + I_NIL, + [ Prim + ( 169, + T_operation, + [], + [] ) ], + [] ); + Prim + (170, I_SWAP, [], []); + Prim + (171, I_DUP, [], []); + Prim + ( 172, + I_DUG, + [ Int + ( 173, + Z.of_int 2 ) + ], + [] ); + Prim + (174, I_CDR, [], []); + Prim + ( 175, + I_PUSH, + [ Prim + ( 176, + T_mutez, + [], + [] ); + Int (177, Z.zero) + ], + [] ); + Prim + ( 178, + I_DIG, + [ Int + ( 179, + Z.of_int 4 ) + ], + [] ); + Prim + (180, I_CDR, [], []); + Prim + (181, I_CAR, [], []); + Prim + ( 182, + I_DIG, + [ Int + ( 183, + Z.of_int 4 ) + ], + [] ); + Prim + (184, I_CAR, [], []); + Prim + (185, I_GET, [], []); + Prim + ( 186, + I_IF_NONE, + [ Seq + ( 187, + [ Prim + ( 188, + I_PUSH, + [ Prim + ( 189, + T_nat, + [], + [] + ); + Int + ( 190, + Z + .zero + ) + ], + [] ) ] + ); + Seq (191, []) ], + [] ); + Prim + ( 192, + I_TRANSFER_TOKENS, + [], + [] ); + Prim + (193, I_CONS, [], []); + Prim + (194, I_PAIR, [], []) + ] ) ], + [] ) ] ); + Seq + ( 195, + [ Prim + ( 196, + I_IF_LEFT, + [ Seq + ( 197, + [ Prim + (198, I_SWAP, [], []); + Prim + (199, I_DUP, [], []); + Prim + ( 200, + I_DIG, + [ Int + ( 201, + Z.of_int 2 ) + ], + [] ); + Prim + ( 202, + I_NIL, + [ Prim + ( 203, + T_operation, + [], + [] ) ], + [] ); + Prim + (204, I_SWAP, [], []); + Prim + (205, I_DUP, [], []); + Prim + ( 206, + I_DUG, + [ Int + ( 207, + Z.of_int 2 ) + ], + [] ); + Prim + (208, I_CDR, [], []); + Prim + ( 209, + I_PUSH, + [ Prim + ( 210, + T_mutez, + [], + [] ); + Int (211, Z.zero) + ], + [] ); + Prim + ( 212, + I_DIG, + [ Int + ( 213, + Z.of_int 4 ) + ], + [] ); + Prim + (214, I_CAR, [], []); + Prim + ( 215, + I_DIG, + [ Int + ( 216, + Z.of_int 4 ) + ], + [] ); + Prim + (217, I_CAR, [], []); + Prim + (218, I_GET, [], []); + Prim + ( 219, + I_IF_NONE, + [ Seq + ( 220, + [ Prim + ( 221, + I_PUSH, + [ Prim + ( 222, + T_nat, + [], + [] + ); + Int + ( 223, + Z + .zero + ) + ], + [] ) ] + ); + Seq (224, []) ], + [] ); + Prim + ( 225, + I_TRANSFER_TOKENS, + [], + [] ); + Prim + (226, I_CONS, [], []); + Prim + (227, I_PAIR, [], []) + ] ); + Seq + ( 228, + [ Prim + (229, I_SWAP, [], []); + Prim + (230, I_DUP, [], []); + Prim + ( 231, + I_DIG, + [ Int + ( 232, + Z.of_int 2 ) + ], + [] ); + Prim + ( 233, + I_NIL, + [ Prim + ( 234, + T_operation, + [], + [] ) ], + [] ); + Prim + (235, I_SWAP, [], []); + Prim + (236, I_CDR, [], []); + Prim + ( 237, + I_PUSH, + [ Prim + ( 238, + T_mutez, + [], + [] ); + Int (239, Z.zero) + ], + [] ); + Prim + ( 240, + I_DIG, + [ Int + ( 241, + Z.of_int 3 ) + ], + [] ); + Prim + (242, I_CDR, [], []); + Prim + (243, I_CDR, [], []); + Prim + (244, I_CDR, [], []); + Prim + ( 245, + I_TRANSFER_TOKENS, + [], + [] ); + Prim + (246, I_CONS, [], []); + Prim + (247, I_PAIR, [], []) + ] ) ], + [] ) ] ) ], + [] ) ] ); + Seq + ( 248, + [ Prim + ( 249, + I_IF_LEFT, + [ Seq + ( 250, + [ Prim (251, I_SWAP, [], []); + Prim (252, I_DUP, [], []); + Prim + ( 253, + I_DUG, + [Int (254, Z.of_int 2)], + [] ); + Prim (255, I_CDR, [], []); + Prim (256, I_CDR, [], []); + Prim (257, I_CAR, [], []); + Prim (258, I_SENDER, [], []); + Prim (259, I_COMPARE, [], []); + Prim (260, I_NEQ, [], []); + Prim + ( 261, + I_IF, + [ Seq + ( 262, + [ Prim + ( 263, + I_PUSH, + [ Prim + ( 264, + T_string, + [], + [] ); + String + ( 265, + "OnlyAdmin" + ) ], + [] ); + Prim + ( 266, + I_FAILWITH, + [], + [] ) ] ); + Seq (267, []) ], + [] ); + Prim (268, I_DUP, [], []); + Prim (269, I_CAR, [], []); + Prim + ( 270, + I_DIG, + [Int (271, Z.of_int 2)], + [] ); + Prim (272, I_DUP, [], []); + Prim + ( 273, + I_DUG, + [Int (274, Z.of_int 3)], + [] ); + Prim (275, I_CAR, [], []); + Prim + ( 276, + I_DIG, + [Int (277, Z.of_int 2)], + [] ); + Prim (278, I_DUP, [], []); + Prim + ( 279, + I_DUG, + [Int (280, Z.of_int 3)], + [] ); + Prim (281, I_CDR, [], []); + Prim (282, I_GET, [], []); + Prim + ( 283, + I_IF_NONE, + [ Seq + ( 284, + [ Prim + ( 285, + I_PUSH, + [ Prim + ( 286, + T_nat, + [], + [] ); + Int (287, Z.zero) + ], + [] ) ] ); + Seq (288, []) ], + [] ); + Prim (289, I_ADD, [], []); + Prim (290, I_ISNAT, [], []); + Prim + ( 291, + I_IF_NONE, + [ Seq + ( 292, + [ Prim + ( 293, + I_PUSH, + [ Prim + ( 294, + T_string, + [], + [] ); + String + ( 295, + "Cannot \ + burn more \ + than the \ + target's \ + balance." ) + ], + [] ); + Prim + ( 296, + I_FAILWITH, + [], + [] ) ] ); + Seq (297, []) ], + [] ); + Prim (298, I_SWAP, [], []); + Prim (299, I_DUP, [], []); + Prim + ( 300, + I_DUG, + [Int (301, Z.of_int 2)], + [] ); + Prim (302, I_CAR, [], []); + Prim + ( 303, + I_DIG, + [Int (304, Z.of_int 3)], + [] ); + Prim (305, I_DUP, [], []); + Prim + ( 306, + I_DUG, + [Int (307, Z.of_int 4)], + [] ); + Prim (308, I_CDR, [], []); + Prim (309, I_CDR, [], []); + Prim (310, I_CDR, [], []); + Prim (311, I_ADD, [], []); + Prim (312, I_ABS, [], []); + Prim + ( 313, + I_DIG, + [Int (314, Z.of_int 3)], + [] ); + Prim (315, I_DUP, [], []); + Prim + ( 316, + I_DUG, + [Int (317, Z.of_int 4)], + [] ); + Prim (318, I_CDR, [], []); + Prim + ( 319, + I_DIG, + [Int (320, Z.of_int 4)], + [] ); + Prim (321, I_CAR, [], []); + Prim + ( 322, + I_PUSH, + [ Prim (323, T_nat, [], []); + Int (324, Z.zero) ], + [] ); + Prim + ( 325, + I_DIG, + [Int (326, Z.of_int 4)], + [] ); + Prim (327, I_DUP, [], []); + Prim + ( 328, + I_DUG, + [Int (329, Z.of_int 5)], + [] ); + Prim (330, I_COMPARE, [], []); + Prim (331, I_EQ, [], []); + Prim + ( 332, + I_IF, + [ Seq + ( 333, + [ Prim + ( 334, + I_DIG, + [ Int + ( 335, + Z.of_int 3 ) + ], + [] ); + Prim + (336, I_DROP, [], []); + Prim + ( 337, + I_NONE, + [ Prim + ( 338, + T_nat, + [], + [] ) ], + [] ) ] ); + Seq + ( 339, + [ Prim + ( 340, + I_DIG, + [ Int + ( 341, + Z.of_int 3 ) + ], + [] ); + Prim + (342, I_SOME, [], []) + ] ) ], + [] ); + Prim + ( 343, + I_DIG, + [Int (344, Z.of_int 4)], + [] ); + Prim (345, I_CDR, [], []); + Prim (346, I_UPDATE, [], []); + Prim (347, I_PAIR, [], []); + Prim (348, I_DUP, [], []); + Prim + ( 349, + I_DUG, + [Int (350, Z.of_int 2)], + [] ); + Prim (351, I_CDR, [], []); + Prim (352, I_CDR, [], []); + Prim (353, I_CAR, [], []); + Prim (354, I_PAIR, [], []); + Prim (355, I_SWAP, [], []); + Prim (356, I_DUP, [], []); + Prim + ( 357, + I_DUG, + [Int (358, Z.of_int 2)], + [] ); + Prim (359, I_CDR, [], []); + Prim (360, I_CAR, [], []); + Prim (361, I_PAIR, [], []); + Prim (362, I_SWAP, [], []); + Prim (363, I_CAR, [], []); + Prim (364, I_PAIR, [], []); + Prim + ( 365, + I_NIL, + [ Prim + (366, T_operation, [], []) + ], + [] ); + Prim (367, I_PAIR, [], []) ] ); + Seq + ( 368, + [ Prim (369, I_SWAP, [], []); + Prim (370, I_DUP, [], []); + Prim + ( 371, + I_DUG, + [Int (372, Z.of_int 2)], + [] ); + Prim (373, I_CDR, [], []); + Prim (374, I_CAR, [], []); + Prim + ( 375, + I_DIG, + [Int (376, Z.of_int 2)], + [] ); + Prim (377, I_DUP, [], []); + Prim + ( 378, + I_DUG, + [Int (379, Z.of_int 3)], + [] ); + Prim (380, I_CAR, [], []); + Prim + ( 381, + I_DIG, + [Int (382, Z.of_int 2)], + [] ); + Prim (383, I_DUP, [], []); + Prim + ( 384, + I_DUG, + [Int (385, Z.of_int 3)], + [] ); + Prim (386, I_CAR, [], []); + Prim (387, I_SENDER, [], []); + Prim (388, I_COMPARE, [], []); + Prim (389, I_EQ, [], []); + Prim + ( 390, + I_IF, + [ Seq + ( 391, + [ Prim + (392, I_SWAP, [], []) + ] ); + Seq + ( 393, + [ Prim + ( 394, + I_SENDER, + [], + [] ); + Prim + ( 395, + I_DIG, + [ Int + ( 396, + Z.of_int 3 ) + ], + [] ); + Prim + (397, I_DUP, [], []); + Prim + ( 398, + I_DUG, + [ Int + ( 399, + Z.of_int 4 ) + ], + [] ); + Prim + (400, I_CAR, [], []); + Prim + (401, I_PAIR, [], []); + Prim + ( 402, + I_DIG, + [ Int + ( 403, + Z.of_int 3 ) + ], + [] ); + Prim + (404, I_DUP, [], []); + Prim + ( 405, + I_DUG, + [ Int + ( 406, + Z.of_int 4 ) + ], + [] ); + Prim + (407, I_CDR, [], []); + Prim + (408, I_CDR, [], []); + Prim + ( 409, + I_DIG, + [ Int + ( 410, + Z.of_int 3 ) + ], + [] ); + Prim + (411, I_DUP, [], []); + Prim + ( 412, + I_DUG, + [ Int + ( 413, + Z.of_int 4 ) + ], + [] ); + Prim + ( 414, + I_DIG, + [ Int + ( 415, + Z.of_int 2 ) + ], + [] ); + Prim + (416, I_DUP, [], []); + Prim + ( 417, + I_DUG, + [ Int + ( 418, + Z.of_int 3 ) + ], + [] ); + Prim + (419, I_GET, [], []); + Prim + ( 420, + I_IF_NONE, + [ Seq + ( 421, + [ Prim + ( 422, + I_PUSH, + [ Prim + ( 423, + T_nat, + [], + [] + ); + Int + ( 424, + Z + .zero + ) + ], + [] ) ] + ); + Seq (425, []) ], + [] ); + Prim + (426, I_SUB, [], []); + Prim + (427, I_ISNAT, [], []); + Prim + ( 428, + I_IF_NONE, + [ Seq + ( 429, + [ Prim + ( 430, + I_PUSH, + [ Prim + ( 431, + T_string, + [], + [] + ); + String + ( 432, + "NotEnoughAllowance" + ) + ], + [] ); + Prim + ( 433, + I_FAILWITH, + [], + [] ) ] + ); + Seq (434, []) ], + [] ); + Prim + ( 435, + I_DIG, + [ Int + ( 436, + Z.of_int 3 ) + ], + [] ); + Prim + ( 437, + I_PUSH, + [ Prim + ( 438, + T_nat, + [], + [] ); + Int (439, Z.zero) + ], + [] ); + Prim + ( 440, + I_DIG, + [ Int + ( 441, + Z.of_int 2 ) + ], + [] ); + Prim + (442, I_DUP, [], []); + Prim + ( 443, + I_DUG, + [ Int + ( 444, + Z.of_int 3 ) + ], + [] ); + Prim + ( 445, + I_COMPARE, + [], + [] ); + Prim (446, I_EQ, [], []); + Prim + ( 447, + I_IF, + [ Seq + ( 448, + [ Prim + ( 449, + I_SWAP, + [], + [] ); + Prim + ( 450, + I_DROP, + [], + [] ); + Prim + ( 451, + I_NONE, + [ Prim + ( 452, + T_nat, + [], + [] + ) + ], + [] ) ] + ); + Seq + ( 453, + [ Prim + ( 454, + I_SWAP, + [], + [] ); + Prim + ( 455, + I_SOME, + [], + [] ) ] + ) ], + [] ); + Prim + ( 456, + I_DIG, + [ Int + ( 457, + Z.of_int 2 ) + ], + [] ); + Prim + ( 458, + I_UPDATE, + [], + [] ) ] ) ], + [] ); + Prim + ( 459, + I_DIG, + [Int (460, Z.of_int 2)], + [] ); + Prim (461, I_DUP, [], []); + Prim + ( 462, + I_DUG, + [Int (463, Z.of_int 3)], + [] ); + Prim (464, I_CDR, [], []); + Prim (465, I_CDR, [], []); + Prim + ( 466, + I_DIG, + [Int (467, Z.of_int 2)], + [] ); + Prim (468, I_DUP, [], []); + Prim + ( 469, + I_DUG, + [Int (470, Z.of_int 3)], + [] ); + Prim + ( 471, + I_DIG, + [Int (472, Z.of_int 4)], + [] ); + Prim (473, I_DUP, [], []); + Prim + ( 474, + I_DUG, + [Int (475, Z.of_int 5)], + [] ); + Prim (476, I_CAR, [], []); + Prim (477, I_GET, [], []); + Prim + ( 478, + I_IF_NONE, + [ Seq + ( 479, + [ Prim + ( 480, + I_PUSH, + [ Prim + ( 481, + T_nat, + [], + [] ); + Int (482, Z.zero) + ], + [] ) ] ); + Seq (483, []) ], + [] ); + Prim (484, I_SUB, [], []); + Prim (485, I_ISNAT, [], []); + Prim + ( 486, + I_IF_NONE, + [ Seq + ( 487, + [ Prim + ( 488, + I_PUSH, + [ Prim + ( 489, + T_string, + [], + [] ); + String + ( 490, + "NotEnoughBalance" + ) ], + [] ); + Prim + ( 491, + I_FAILWITH, + [], + [] ) ] ); + Seq (492, []) ], + [] ); + Prim + ( 493, + I_DIG, + [Int (494, Z.of_int 2)], + [] ); + Prim + ( 495, + I_PUSH, + [ Prim (496, T_nat, [], []); + Int (497, Z.zero) ], + [] ); + Prim + ( 498, + I_DIG, + [Int (499, Z.of_int 2)], + [] ); + Prim (500, I_DUP, [], []); + Prim + ( 501, + I_DUG, + [Int (502, Z.of_int 3)], + [] ); + Prim (503, I_COMPARE, [], []); + Prim (504, I_EQ, [], []); + Prim + ( 505, + I_IF, + [ Seq + ( 506, + [ Prim + (507, I_SWAP, [], []); + Prim + (508, I_DROP, [], []); + Prim + ( 509, + I_NONE, + [ Prim + ( 510, + T_nat, + [], + [] ) ], + [] ) ] ); + Seq + ( 511, + [ Prim + (512, I_SWAP, [], []); + Prim + (513, I_SOME, [], []) + ] ) ], + [] ); + Prim + ( 514, + I_DIG, + [Int (515, Z.of_int 3)], + [] ); + Prim (516, I_DUP, [], []); + Prim + ( 517, + I_DUG, + [Int (518, Z.of_int 4)], + [] ); + Prim (519, I_CAR, [], []); + Prim (520, I_UPDATE, [], []); + Prim + ( 521, + I_DIG, + [Int (522, Z.of_int 2)], + [] ); + Prim (523, I_DUP, [], []); + Prim + ( 524, + I_DUG, + [Int (525, Z.of_int 3)], + [] ); + Prim (526, I_CDR, [], []); + Prim (527, I_CDR, [], []); + Prim (528, I_SWAP, [], []); + Prim (529, I_DUP, [], []); + Prim + ( 530, + I_DUG, + [Int (531, Z.of_int 2)], + [] ); + Prim + ( 532, + I_DIG, + [Int (533, Z.of_int 4)], + [] ); + Prim (534, I_DUP, [], []); + Prim + ( 535, + I_DUG, + [Int (536, Z.of_int 5)], + [] ); + Prim (537, I_CDR, [], []); + Prim (538, I_CAR, [], []); + Prim (539, I_GET, [], []); + Prim + ( 540, + I_IF_NONE, + [ Seq + ( 541, + [ Prim + ( 542, + I_PUSH, + [ Prim + ( 543, + T_nat, + [], + [] ); + Int (544, Z.zero) + ], + [] ) ] ); + Seq (545, []) ], + [] ); + Prim (546, I_ADD, [], []); + Prim (547, I_SWAP, [], []); + Prim + ( 548, + I_PUSH, + [ Prim (549, T_nat, [], []); + Int (550, Z.zero) ], + [] ); + Prim + ( 551, + I_DIG, + [Int (552, Z.of_int 2)], + [] ); + Prim (553, I_DUP, [], []); + Prim + ( 554, + I_DUG, + [Int (555, Z.of_int 3)], + [] ); + Prim (556, I_COMPARE, [], []); + Prim (557, I_EQ, [], []); + Prim + ( 558, + I_IF, + [ Seq + ( 559, + [ Prim + (560, I_SWAP, [], []); + Prim + (561, I_DROP, [], []); + Prim + ( 562, + I_NONE, + [ Prim + ( 563, + T_nat, + [], + [] ) ], + [] ) ] ); + Seq + ( 564, + [ Prim + (565, I_SWAP, [], []); + Prim + (566, I_SOME, [], []) + ] ) ], + [] ); + Prim + ( 567, + I_DIG, + [Int (568, Z.of_int 3)], + [] ); + Prim (569, I_CDR, [], []); + Prim (570, I_CAR, [], []); + Prim (571, I_UPDATE, [], []); + Prim + ( 572, + I_DIG, + [Int (573, Z.of_int 2)], + [] ); + Prim (574, I_CDR, [], []); + Prim (575, I_SWAP, [], []); + Prim (576, I_PAIR, [], []); + Prim (577, I_DUP, [], []); + Prim (578, I_CDR, [], []); + Prim (579, I_CDR, [], []); + Prim + ( 580, + I_DIG, + [Int (581, Z.of_int 2)], + [] ); + Prim (582, I_PAIR, [], []); + Prim (583, I_SWAP, [], []); + Prim (584, I_CAR, [], []); + Prim (585, I_PAIR, [], []); + Prim + ( 586, + I_NIL, + [ Prim + (587, T_operation, [], []) + ], + [] ); + Prim (588, I_PAIR, [], []) ] ) ], + [] ) ] ) ], + [] ) ] ) ], + [] ) ] ) diff --git a/src/proto_alpha/lib_protocol/liquidity_baking_storage.ml b/src/proto_alpha/lib_protocol/liquidity_baking_storage.ml new file mode 100644 index 0000000000000000000000000000000000000000..3be8fd5c98ea3d171b93eb1500f05ac1568a540b --- /dev/null +++ b/src/proto_alpha/lib_protocol/liquidity_baking_storage.ml @@ -0,0 +1,164 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Tocqueville Group, Inc. *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** This module is used to originate contracts for liquidity baking during + protocol stitching. Two functions are exposed: one for stitching from 009 + to 010 on mainnet and one for stitching from Genesis to Alpha for testing. + + Both originate a CPMM (constant product market making) contract and a + liquidity token FA1.2 contract, with the storage of each containing the + other's address. The CPMM's storage contains a token address, which + corresponds to tzBTC in the mainnet version and a reference FA1.2 contract + in the test version. + + The Michelson and Ligo code, as well as Coq proofs, for the CPMM and + liquidity token contracts are available here: + https://gitlab.com/dexter2tz/dexter2tz/-/tree/liquidity_baking + + The test FA1.2 contract is generated from: + https://gitlab.com/ligolang/ligo/-/blob/dev/src/test/contracts/FA1.2.mligo + + All contracts were generated from Ligo at revision + 4d10d07ca05abe0f8a5fb97d15267bf5d339d9f4 and converted to OCaml using + `tezos-client convert`. +*) + +open Michelson_v1_primitives +open Micheline + +let cpmm_init_storage token_address lqt_address = + Script_repr.lazy_expr + (Micheline.strip_locations + (Prim + ( 0, + D_Pair, + [ Int (1, Z.zero); + Int (2, Z.zero); + Int (3, Z.zero); + Prim (4, D_False, [], []); + String (5, token_address); + String (6, lqt_address) ], + [] ))) + +let lqt_init_storage cpmm_address = + Script_repr.lazy_expr + (Micheline.strip_locations + (Prim + ( 0, + D_Pair, + [ Seq (1, []); + Seq (2, []); + String (3, cpmm_address); + Int (4, Z.zero) ], + [] ))) + +let test_fa12_init_storage = + Script_repr.lazy_expr + (Micheline.strip_locations + (Prim + ( 0, + D_Pair, + [Seq (1, []); Seq (2, []); Int (3, Z.of_int 2000000000000)], + [] ))) + +let tzBTC_address = "KT1PWx2mnDueood7fEmfbBDKx1D9BAnnXitn" + +let init_common ctxt token_address = + Storage.Liquidity_baking.Escape_ema.init ctxt 0l + >>=? fun ctxt -> + Storage.Liquidity_baking.Sunset_level.init + ctxt + Int32.( + add + (Raw_level_repr.to_int32 (Level_storage.current ctxt).level) + (Constants_storage.liquidity_baking_sunset_duration ctxt)) + >>=? fun ctxt -> + Contract_storage.fresh_contract_from_current_nonce ctxt + >>?= fun (ctxt, cpmm_address) -> + Contract_storage.fresh_contract_from_current_nonce ctxt + >>?= fun (ctxt, lqt_address) -> + Storage.Liquidity_baking.Cpmm_address.init ctxt cpmm_address + >>=? fun ctxt -> + Contract_storage.raw_originate + ctxt + cpmm_address + ~balance:Tez_repr.zero + ~script: + ( Script_repr. + { + code = + Script_repr.lazy_expr + (Micheline.strip_locations Liquidity_baking_cpmm.script); + storage = + cpmm_init_storage + token_address + (Contract_repr.to_b58check lqt_address); + }, + None ) + ~delegate:None + >>=? fun ctxt -> + Contract_storage.raw_originate + ctxt + lqt_address + ~balance:Tez_repr.zero + ~script: + ( Script_repr. + { + code = + Script_repr.lazy_expr + (Micheline.strip_locations Liquidity_baking_lqt.script); + storage = lqt_init_storage (Contract_repr.to_b58check cpmm_address); + }, + None ) + ~delegate:None + +let init ctxt = + (* origination nonce is unset when stitching from 009 *) + let nonce = + Operation_hash.hash_bytes [Bytes.of_string "Drip, drip, drip."] + in + let ctxt = Raw_context.init_origination_nonce ctxt nonce in + init_common ctxt tzBTC_address + >>=? fun ctxt -> return (Raw_context.unset_origination_nonce ctxt) + +let init_test ctxt = + (* when stitching from Genesis origination nonce is set by bootstrap storage *) + Contract_storage.fresh_contract_from_current_nonce ctxt + >>?= fun (ctxt, fa12_address) -> + Contract_storage.raw_originate + ctxt + fa12_address + ~balance:(Tez_repr.of_mutez_exn 2_000_000_000_000L) + ~script: + ( Script_repr. + { + code = + Script_repr.lazy_expr + (Micheline.strip_locations Liquidity_baking_test_fa12.script); + storage = test_fa12_init_storage; + }, + None ) + ~delegate:None + >>=? fun ctxt -> init_common ctxt (Contract_repr.to_b58check fa12_address) diff --git a/src/proto_alpha/lib_protocol/liquidity_baking_storage.mli b/src/proto_alpha/lib_protocol/liquidity_baking_storage.mli new file mode 100644 index 0000000000000000000000000000000000000000..e90bd35eb8322a94d2703dcdba9949a9056fe2e4 --- /dev/null +++ b/src/proto_alpha/lib_protocol/liquidity_baking_storage.mli @@ -0,0 +1,28 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Tocqueville Group, Inc. *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +val init : Raw_context.t -> Raw_context.t tzresult Lwt.t + +val init_test : Raw_context.t -> Raw_context.t tzresult Lwt.t diff --git a/src/proto_alpha/lib_protocol/liquidity_baking_test_fa12.ml b/src/proto_alpha/lib_protocol/liquidity_baking_test_fa12.ml new file mode 100644 index 0000000000000000000000000000000000000000..0bd18e02eee90c472739970bfee85ef05c11adb4 --- /dev/null +++ b/src/proto_alpha/lib_protocol/liquidity_baking_test_fa12.ml @@ -0,0 +1,1106 @@ +open Michelson_v1_primitives +open Micheline + +let script = + Seq + ( 0, + [ Prim + ( 1, + K_parameter, + [ Prim + ( 2, + T_or, + [ Prim + ( 3, + T_or, + [ Prim + ( 4, + T_or, + [ Prim + ( 5, + T_pair, + [ Prim (6, T_address, [], ["%spender"]); + Prim (7, T_nat, [], ["%value"]) ], + ["%approve"] ); + Prim + ( 8, + T_pair, + [ Prim + ( 9, + T_pair, + [ Prim (10, T_address, [], ["%owner"]); + Prim + (11, T_address, [], ["%spender"]) + ], + ["%request"] ); + Prim + ( 12, + T_contract, + [Prim (13, T_nat, [], [])], + ["%callback"] ) ], + ["%getAllowance"] ) ], + [] ); + Prim + ( 14, + T_or, + [ Prim + ( 15, + T_pair, + [ Prim (16, T_address, [], ["%owner"]); + Prim + ( 17, + T_contract, + [Prim (18, T_nat, [], [])], + ["%callback"] ) ], + ["%getBalance"] ); + Prim + ( 19, + T_pair, + [ Prim (20, T_unit, [], ["%request"]); + Prim + ( 21, + T_contract, + [Prim (22, T_nat, [], [])], + ["%callback"] ) ], + ["%getTotalSupply"] ) ], + [] ) ], + [] ); + Prim + ( 23, + T_pair, + [ Prim (24, T_address, [], ["%from"]); + Prim + ( 25, + T_pair, + [ Prim (26, T_address, [], ["%to"]); + Prim (27, T_nat, [], ["%value"]) ], + [] ) ], + ["%transfer"] ) ], + [] ) ], + [] ); + Prim + ( 28, + K_storage, + [ Prim + ( 29, + T_pair, + [ Prim + ( 30, + T_pair, + [ Prim + ( 31, + T_big_map, + [ Prim + ( 32, + T_pair, + [ Prim (33, T_address, [], ["%owner"]); + Prim (34, T_address, [], ["%spender"]) ], + [] ); + Prim (35, T_nat, [], []) ], + ["%allowances"] ); + Prim + ( 36, + T_big_map, + [ Prim (37, T_address, [], []); + Prim (38, T_nat, [], []) ], + ["%tokens"] ) ], + [] ); + Prim (39, T_nat, [], ["%total_supply"]) ], + [] ) ], + [] ); + Prim + ( 40, + K_code, + [ Seq + ( 41, + [ Prim (42, I_DUP, [], []); + Prim (43, I_CDR, [], []); + Prim + ( 44, + I_PUSH, + [Prim (45, T_mutez, [], []); Int (46, Z.zero)], + [] ); + Prim (47, I_AMOUNT, [], []); + Prim (48, I_COMPARE, [], []); + Prim (49, I_NEQ, [], []); + Prim + ( 50, + I_IF, + [ Seq + ( 51, + [ Prim + ( 52, + I_PUSH, + [ Prim (53, T_string, [], []); + String (54, "DontSendTez") ], + [] ); + Prim (55, I_FAILWITH, [], []) ] ); + Seq (56, []) ], + [] ); + Prim (57, I_SWAP, [], []); + Prim (58, I_CAR, [], []); + Prim + ( 59, + I_IF_LEFT, + [ Seq + ( 60, + [ Prim + ( 61, + I_IF_LEFT, + [ Seq + ( 62, + [ Prim + ( 63, + I_IF_LEFT, + [ Seq + ( 64, + [ Prim + (65, I_SWAP, [], []); + Prim (66, I_DUP, [], []); + Prim + ( 67, + I_DUG, + [ Int + (68, Z.of_int 2) + ], + [] ); + Prim (69, I_CAR, [], []); + Prim (70, I_CAR, [], []); + Prim + (71, I_SWAP, [], []); + Prim (72, I_DUP, [], []); + Prim + ( 73, + I_DUG, + [ Int + (74, Z.of_int 2) + ], + [] ); + Prim (75, I_CAR, [], []); + Prim + (76, I_SENDER, [], []); + Prim + (77, I_PAIR, [], []); + Prim + ( 78, + I_PUSH, + [ Prim + ( 79, + T_nat, + [], + [] ); + Int (80, Z.zero) + ], + [] ); + Prim + ( 81, + I_DIG, + [ Int + (82, Z.of_int 3) + ], + [] ); + Prim (83, I_DUP, [], []); + Prim + ( 84, + I_DUG, + [ Int + (85, Z.of_int 4) + ], + [] ); + Prim (86, I_CDR, [], []); + Prim + ( 87, + I_COMPARE, + [], + [] ); + Prim (88, I_GT, [], []); + Prim + ( 89, + I_PUSH, + [ Prim + ( 90, + T_nat, + [], + [] ); + Int (91, Z.zero) + ], + [] ); + Prim + ( 92, + I_DIG, + [ Int + (93, Z.of_int 3) + ], + [] ); + Prim (94, I_DUP, [], []); + Prim + ( 95, + I_DUG, + [ Int + (96, Z.of_int 4) + ], + [] ); + Prim + ( 97, + I_DIG, + [ Int + (98, Z.of_int 3) + ], + [] ); + Prim (99, I_DUP, [], []); + Prim + ( 100, + I_DUG, + [ Int + ( 101, + Z.of_int 4 ) + ], + [] ); + Prim + (102, I_GET, [], []); + Prim + ( 103, + I_IF_NONE, + [ Seq + ( 104, + [ Prim + ( 105, + I_PUSH, + [ Prim + ( 106, + T_nat, + [], + [] + ); + Int + ( 107, + Z + .zero + ) + ], + [] ) ] + ); + Seq (108, []) ], + [] ); + Prim + ( 109, + I_COMPARE, + [], + [] ); + Prim (110, I_GT, [], []); + Prim + (111, I_AND, [], []); + Prim + ( 112, + I_IF, + [ Seq + ( 113, + [ Prim + ( 114, + I_PUSH, + [ Prim + ( 115, + T_string, + [], + [] + ); + String + ( 116, + "UnsafeAllowanceChange" + ) + ], + [] ); + Prim + ( 117, + I_FAILWITH, + [], + [] ) ] + ); + Seq (118, []) ], + [] ); + Prim + ( 119, + I_DIG, + [ Int + ( 120, + Z.of_int 3 ) + ], + [] ); + Prim + (121, I_DUP, [], []); + Prim + ( 122, + I_DUG, + [ Int + ( 123, + Z.of_int 4 ) + ], + [] ); + Prim + (124, I_CDR, [], []); + Prim + ( 125, + I_DIG, + [ Int + ( 126, + Z.of_int 4 ) + ], + [] ); + Prim + (127, I_CAR, [], []); + Prim + (128, I_CDR, [], []); + Prim + ( 129, + I_DIG, + [ Int + ( 130, + Z.of_int 3 ) + ], + [] ); + Prim + ( 131, + I_DIG, + [ Int + ( 132, + Z.of_int 4 ) + ], + [] ); + Prim + (133, I_CDR, [], []); + Prim + ( 134, + I_PUSH, + [ Prim + ( 135, + T_nat, + [], + [] ); + Int (136, Z.zero) + ], + [] ); + Prim + (137, I_SWAP, [], []); + Prim + (138, I_DUP, [], []); + Prim + ( 139, + I_DUG, + [ Int + ( 140, + Z.of_int 2 ) + ], + [] ); + Prim + ( 141, + I_COMPARE, + [], + [] ); + Prim (142, I_EQ, [], []); + Prim + ( 143, + I_IF, + [ Seq + ( 144, + [ Prim + ( 145, + I_DROP, + [], + [] ); + Prim + ( 146, + I_NONE, + [ Prim + ( 147, + T_nat, + [], + [] + ) + ], + [] ) ] + ); + Seq + ( 148, + [ Prim + ( 149, + I_SOME, + [], + [] ) ] + ) ], + [] ); + Prim + ( 150, + I_DIG, + [ Int + ( 151, + Z.of_int 4 ) + ], + [] ); + Prim + ( 152, + I_UPDATE, + [], + [] ); + Prim + (153, I_PAIR, [], []); + Prim + (154, I_PAIR, [], []); + Prim + ( 155, + I_NIL, + [ Prim + ( 156, + T_operation, + [], + [] ) ], + [] ); + Prim + (157, I_PAIR, [], []) + ] ); + Seq + ( 158, + [ Prim + (159, I_SWAP, [], []); + Prim + (160, I_DUP, [], []); + Prim + ( 161, + I_DIG, + [ Int + ( 162, + Z.of_int 2 ) + ], + [] ); + Prim + (163, I_PAIR, [], []); + Prim + (164, I_DUP, [], []); + Prim + (165, I_CAR, [], []); + Prim + ( 166, + I_NIL, + [ Prim + ( 167, + T_operation, + [], + [] ) ], + [] ); + Prim + (168, I_SWAP, [], []); + Prim + (169, I_DUP, [], []); + Prim + ( 170, + I_DUG, + [ Int + ( 171, + Z.of_int 2 ) + ], + [] ); + Prim + (172, I_CDR, [], []); + Prim + ( 173, + I_PUSH, + [ Prim + ( 174, + T_mutez, + [], + [] ); + Int (175, Z.zero) + ], + [] ); + Prim + ( 176, + I_DIG, + [ Int + ( 177, + Z.of_int 4 ) + ], + [] ); + Prim + (178, I_CDR, [], []); + Prim + (179, I_CAR, [], []); + Prim + (180, I_CAR, [], []); + Prim + ( 181, + I_DIG, + [ Int + ( 182, + Z.of_int 4 ) + ], + [] ); + Prim + (183, I_CAR, [], []); + Prim + (184, I_GET, [], []); + Prim + ( 185, + I_IF_NONE, + [ Seq + ( 186, + [ Prim + ( 187, + I_PUSH, + [ Prim + ( 188, + T_nat, + [], + [] + ); + Int + ( 189, + Z + .zero + ) + ], + [] ) ] + ); + Seq (190, []) ], + [] ); + Prim + ( 191, + I_TRANSFER_TOKENS, + [], + [] ); + Prim + (192, I_CONS, [], []); + Prim + (193, I_PAIR, [], []) + ] ) ], + [] ) ] ); + Seq + ( 194, + [ Prim + ( 195, + I_IF_LEFT, + [ Seq + ( 196, + [ Prim + (197, I_SWAP, [], []); + Prim + (198, I_DUP, [], []); + Prim + ( 199, + I_DIG, + [ Int + ( 200, + Z.of_int 2 ) + ], + [] ); + Prim + (201, I_PAIR, [], []); + Prim + (202, I_DUP, [], []); + Prim + (203, I_CAR, [], []); + Prim + ( 204, + I_NIL, + [ Prim + ( 205, + T_operation, + [], + [] ) ], + [] ); + Prim + (206, I_SWAP, [], []); + Prim + (207, I_DUP, [], []); + Prim + ( 208, + I_DUG, + [ Int + ( 209, + Z.of_int 2 ) + ], + [] ); + Prim + (210, I_CDR, [], []); + Prim + ( 211, + I_PUSH, + [ Prim + ( 212, + T_mutez, + [], + [] ); + Int (213, Z.zero) + ], + [] ); + Prim + ( 214, + I_DIG, + [ Int + ( 215, + Z.of_int 4 ) + ], + [] ); + Prim + (216, I_CDR, [], []); + Prim + (217, I_CAR, [], []); + Prim + (218, I_CDR, [], []); + Prim + ( 219, + I_DIG, + [ Int + ( 220, + Z.of_int 4 ) + ], + [] ); + Prim + (221, I_CAR, [], []); + Prim + (222, I_GET, [], []); + Prim + ( 223, + I_IF_NONE, + [ Seq + ( 224, + [ Prim + ( 225, + I_PUSH, + [ Prim + ( 226, + T_nat, + [], + [] + ); + Int + ( 227, + Z + .zero + ) + ], + [] ) ] + ); + Seq (228, []) ], + [] ); + Prim + ( 229, + I_TRANSFER_TOKENS, + [], + [] ); + Prim + (230, I_CONS, [], []); + Prim + (231, I_PAIR, [], []) + ] ); + Seq + ( 232, + [ Prim + (233, I_SWAP, [], []); + Prim + (234, I_DUP, [], []); + Prim + ( 235, + I_DIG, + [ Int + ( 236, + Z.of_int 2 ) + ], + [] ); + Prim + (237, I_PAIR, [], []); + Prim + ( 238, + I_NIL, + [ Prim + ( 239, + T_operation, + [], + [] ) ], + [] ); + Prim + (240, I_SWAP, [], []); + Prim + (241, I_DUP, [], []); + Prim + ( 242, + I_DUG, + [ Int + ( 243, + Z.of_int 2 ) + ], + [] ); + Prim + (244, I_CAR, [], []); + Prim + (245, I_CDR, [], []); + Prim + ( 246, + I_PUSH, + [ Prim + ( 247, + T_mutez, + [], + [] ); + Int (248, Z.zero) + ], + [] ); + Prim + ( 249, + I_DIG, + [ Int + ( 250, + Z.of_int 3 ) + ], + [] ); + Prim + (251, I_CDR, [], []); + Prim + (252, I_CDR, [], []); + Prim + ( 253, + I_TRANSFER_TOKENS, + [], + [] ); + Prim + (254, I_CONS, [], []); + Prim + (255, I_PAIR, [], []) + ] ) ], + [] ) ] ) ], + [] ) ] ); + Seq + ( 256, + [ Prim (257, I_SWAP, [], []); + Prim (258, I_DUP, [], []); + Prim (259, I_DUG, [Int (260, Z.of_int 2)], []); + Prim (261, I_CAR, [], []); + Prim (262, I_CAR, [], []); + Prim (263, I_DIG, [Int (264, Z.of_int 2)], []); + Prim (265, I_DUP, [], []); + Prim (266, I_DUG, [Int (267, Z.of_int 3)], []); + Prim (268, I_CAR, [], []); + Prim (269, I_CDR, [], []); + Prim (270, I_DIG, [Int (271, Z.of_int 2)], []); + Prim (272, I_DUP, [], []); + Prim (273, I_DUG, [Int (274, Z.of_int 3)], []); + Prim (275, I_CAR, [], []); + Prim (276, I_SENDER, [], []); + Prim (277, I_COMPARE, [], []); + Prim (278, I_EQ, [], []); + Prim + ( 279, + I_IF, + [ Seq (280, [Prim (281, I_SWAP, [], [])]); + Seq + ( 282, + [ Prim (283, I_SENDER, [], []); + Prim + ( 284, + I_DIG, + [Int (285, Z.of_int 3)], + [] ); + Prim (286, I_DUP, [], []); + Prim + ( 287, + I_DUG, + [Int (288, Z.of_int 4)], + [] ); + Prim (289, I_CAR, [], []); + Prim (290, I_PAIR, [], []); + Prim + ( 291, + I_DIG, + [Int (292, Z.of_int 3)], + [] ); + Prim (293, I_DUP, [], []); + Prim + ( 294, + I_DUG, + [Int (295, Z.of_int 4)], + [] ); + Prim (296, I_CDR, [], []); + Prim (297, I_CDR, [], []); + Prim + ( 298, + I_DIG, + [Int (299, Z.of_int 3)], + [] ); + Prim (300, I_DUP, [], []); + Prim + ( 301, + I_DUG, + [Int (302, Z.of_int 4)], + [] ); + Prim + ( 303, + I_DIG, + [Int (304, Z.of_int 2)], + [] ); + Prim (305, I_DUP, [], []); + Prim + ( 306, + I_DUG, + [Int (307, Z.of_int 3)], + [] ); + Prim (308, I_GET, [], []); + Prim + ( 309, + I_IF_NONE, + [ Seq + ( 310, + [ Prim + ( 311, + I_PUSH, + [ Prim + ( 312, + T_nat, + [], + [] ); + Int (313, Z.zero) + ], + [] ) ] ); + Seq (314, []) ], + [] ); + Prim (315, I_SUB, [], []); + Prim (316, I_ISNAT, [], []); + Prim + ( 317, + I_IF_NONE, + [ Seq + ( 318, + [ Prim + ( 319, + I_PUSH, + [ Prim + ( 320, + T_string, + [], + [] ); + String + ( 321, + "NotEnoughAllowance" + ) ], + [] ); + Prim + ( 322, + I_FAILWITH, + [], + [] ) ] ); + Seq (323, []) ], + [] ); + Prim + ( 324, + I_DIG, + [Int (325, Z.of_int 3)], + [] ); + Prim + ( 326, + I_PUSH, + [ Prim (327, T_nat, [], []); + Int (328, Z.zero) ], + [] ); + Prim + ( 329, + I_DIG, + [Int (330, Z.of_int 2)], + [] ); + Prim (331, I_DUP, [], []); + Prim + ( 332, + I_DUG, + [Int (333, Z.of_int 3)], + [] ); + Prim (334, I_COMPARE, [], []); + Prim (335, I_EQ, [], []); + Prim + ( 336, + I_IF, + [ Seq + ( 337, + [ Prim + (338, I_SWAP, [], []); + Prim + (339, I_DROP, [], []); + Prim + ( 340, + I_NONE, + [ Prim + ( 341, + T_nat, + [], + [] ) ], + [] ) ] ); + Seq + ( 342, + [ Prim + (343, I_SWAP, [], []); + Prim + (344, I_SOME, [], []) + ] ) ], + [] ); + Prim + ( 345, + I_DIG, + [Int (346, Z.of_int 2)], + [] ); + Prim (347, I_UPDATE, [], []) ] ) ], + [] ); + Prim (348, I_DIG, [Int (349, Z.of_int 2)], []); + Prim (350, I_DUP, [], []); + Prim (351, I_DUG, [Int (352, Z.of_int 3)], []); + Prim (353, I_CDR, [], []); + Prim (354, I_CDR, [], []); + Prim (355, I_DIG, [Int (356, Z.of_int 2)], []); + Prim (357, I_DUP, [], []); + Prim (358, I_DUG, [Int (359, Z.of_int 3)], []); + Prim (360, I_DIG, [Int (361, Z.of_int 4)], []); + Prim (362, I_DUP, [], []); + Prim (363, I_DUG, [Int (364, Z.of_int 5)], []); + Prim (365, I_CAR, [], []); + Prim (366, I_GET, [], []); + Prim + ( 367, + I_IF_NONE, + [ Seq + ( 368, + [ Prim + ( 369, + I_PUSH, + [ Prim (370, T_nat, [], []); + Int (371, Z.zero) ], + [] ) ] ); + Seq (372, []) ], + [] ); + Prim (373, I_SUB, [], []); + Prim (374, I_ISNAT, [], []); + Prim + ( 375, + I_IF_NONE, + [ Seq + ( 376, + [ Prim + ( 377, + I_PUSH, + [ Prim (378, T_string, [], []); + String + (379, "NotEnoughBalance") + ], + [] ); + Prim (380, I_FAILWITH, [], []) ] ); + Seq (381, []) ], + [] ); + Prim (382, I_DIG, [Int (383, Z.of_int 2)], []); + Prim + ( 384, + I_PUSH, + [ Prim (385, T_nat, [], []); + Int (386, Z.zero) ], + [] ); + Prim (387, I_DIG, [Int (388, Z.of_int 2)], []); + Prim (389, I_DUP, [], []); + Prim (390, I_DUG, [Int (391, Z.of_int 3)], []); + Prim (392, I_COMPARE, [], []); + Prim (393, I_EQ, [], []); + Prim + ( 394, + I_IF, + [ Seq + ( 395, + [ Prim (396, I_SWAP, [], []); + Prim (397, I_DROP, [], []); + Prim + ( 398, + I_NONE, + [Prim (399, T_nat, [], [])], + [] ) ] ); + Seq + ( 400, + [ Prim (401, I_SWAP, [], []); + Prim (402, I_SOME, [], []) ] ) ], + [] ); + Prim (403, I_DIG, [Int (404, Z.of_int 3)], []); + Prim (405, I_DUP, [], []); + Prim (406, I_DUG, [Int (407, Z.of_int 4)], []); + Prim (408, I_CAR, [], []); + Prim (409, I_UPDATE, [], []); + Prim (410, I_DIG, [Int (411, Z.of_int 2)], []); + Prim (412, I_DUP, [], []); + Prim (413, I_DUG, [Int (414, Z.of_int 3)], []); + Prim (415, I_CDR, [], []); + Prim (416, I_CDR, [], []); + Prim (417, I_SWAP, [], []); + Prim (418, I_DUP, [], []); + Prim (419, I_DUG, [Int (420, Z.of_int 2)], []); + Prim (421, I_DIG, [Int (422, Z.of_int 4)], []); + Prim (423, I_DUP, [], []); + Prim (424, I_DUG, [Int (425, Z.of_int 5)], []); + Prim (426, I_CDR, [], []); + Prim (427, I_CAR, [], []); + Prim (428, I_GET, [], []); + Prim + ( 429, + I_IF_NONE, + [ Seq + ( 430, + [ Prim + ( 431, + I_PUSH, + [ Prim (432, T_nat, [], []); + Int (433, Z.zero) ], + [] ) ] ); + Seq (434, []) ], + [] ); + Prim (435, I_ADD, [], []); + Prim (436, I_SWAP, [], []); + Prim + ( 437, + I_PUSH, + [ Prim (438, T_nat, [], []); + Int (439, Z.zero) ], + [] ); + Prim (440, I_DIG, [Int (441, Z.of_int 2)], []); + Prim (442, I_DUP, [], []); + Prim (443, I_DUG, [Int (444, Z.of_int 3)], []); + Prim (445, I_COMPARE, [], []); + Prim (446, I_EQ, [], []); + Prim + ( 447, + I_IF, + [ Seq + ( 448, + [ Prim (449, I_SWAP, [], []); + Prim (450, I_DROP, [], []); + Prim + ( 451, + I_NONE, + [Prim (452, T_nat, [], [])], + [] ) ] ); + Seq + ( 453, + [ Prim (454, I_SWAP, [], []); + Prim (455, I_SOME, [], []) ] ) ], + [] ); + Prim (456, I_DIG, [Int (457, Z.of_int 3)], []); + Prim (458, I_CDR, [], []); + Prim (459, I_CAR, [], []); + Prim (460, I_UPDATE, [], []); + Prim (461, I_DIG, [Int (462, Z.of_int 2)], []); + Prim (463, I_DUP, [], []); + Prim (464, I_DUG, [Int (465, Z.of_int 3)], []); + Prim (466, I_CDR, [], []); + Prim (467, I_SWAP, [], []); + Prim (468, I_DIG, [Int (469, Z.of_int 3)], []); + Prim (470, I_CAR, [], []); + Prim (471, I_CAR, [], []); + Prim (472, I_PAIR, [], []); + Prim (473, I_CDR, [], []); + Prim (474, I_DIG, [Int (475, Z.of_int 2)], []); + Prim (476, I_PAIR, [], []); + Prim (477, I_PAIR, [], []); + Prim + ( 478, + I_NIL, + [Prim (479, T_operation, [], [])], + [] ); + Prim (480, I_PAIR, [], []) ] ) ], + [] ) ] ) ], + [] ) ] ) diff --git a/src/proto_alpha/lib_protocol/main.ml b/src/proto_alpha/lib_protocol/main.ml index 1439a430f337daeb8433ee7f0363fe32e2a58bbe..9928972e0c9cf9b7b96b57addccd7604d18fb4cc 100644 --- a/src/proto_alpha/lib_protocol/main.ml +++ b/src/proto_alpha/lib_protocol/main.ml @@ -113,6 +113,9 @@ type validation_state = { ctxt : Alpha_context.t; op_count : int; migration_balance_updates : Alpha_context.Receipt.balance_updates; + liquidity_baking_escape_ema : Int32.t; + implicit_operations_results : + Apply_results.packed_successful_manager_operation_result list; } let current_context {ctxt; _} = return (Alpha_context.finalize ctxt).context @@ -126,12 +129,27 @@ let begin_partial_application ~chain_id ~ancestor_context:ctxt Alpha_context.prepare ~level ~predecessor_timestamp ~timestamp ~fitness ctxt >>=? fun (ctxt, migration_balance_updates) -> Apply.begin_application ctxt chain_id block_header predecessor_timestamp - >|=? fun (ctxt, baker, block_delay) -> + >>=? fun (ctxt, baker, block_delay) -> + let escape_vote = + block_header.protocol_data.contents.liquidity_baking_escape_vote + in + Apply.apply_liquidity_baking_subsidy ctxt ~escape_vote + >|=? fun ( ctxt, + liquidity_baking_operations_results, + liquidity_baking_escape_ema ) -> let mode = Partial_application {block_header; baker = Signature.Public_key.hash baker; block_delay} in - {mode; chain_id; ctxt; op_count = 0; migration_balance_updates} + { + mode; + chain_id; + ctxt; + op_count = 0; + migration_balance_updates; + liquidity_baking_escape_ema; + implicit_operations_results = liquidity_baking_operations_results; + } let begin_application ~chain_id ~predecessor_context:ctxt ~predecessor_timestamp ~predecessor_fitness @@ -142,12 +160,27 @@ let begin_application ~chain_id ~predecessor_context:ctxt Alpha_context.prepare ~level ~predecessor_timestamp ~timestamp ~fitness ctxt >>=? fun (ctxt, migration_balance_updates) -> Apply.begin_application ctxt chain_id block_header predecessor_timestamp - >|=? fun (ctxt, baker, block_delay) -> + >>=? fun (ctxt, baker, block_delay) -> + let escape_vote = + block_header.protocol_data.contents.liquidity_baking_escape_vote + in + Apply.apply_liquidity_baking_subsidy ctxt ~escape_vote + >|=? fun ( ctxt, + liquidity_baking_operations_results, + liquidity_baking_escape_ema ) -> let mode = Application {block_header; baker = Signature.Public_key.hash baker; block_delay} in - {mode; chain_id; ctxt; op_count = 0; migration_balance_updates} + { + mode; + chain_id; + ctxt; + op_count = 0; + migration_balance_updates; + liquidity_baking_escape_ema; + implicit_operations_results = liquidity_baking_operations_results; + } let begin_construction ~chain_id ~predecessor_context:ctxt ~predecessor_timestamp ~predecessor_level:pred_level @@ -162,7 +195,8 @@ let begin_construction ~chain_id ~predecessor_context:ctxt Apply.begin_partial_construction ctxt >|=? fun ctxt -> let mode = Partial_construction {predecessor} in - (mode, ctxt) + let escape_vote = false in + (mode, ctxt, escape_vote) | Some proto_header -> Apply.begin_full_construction ctxt @@ -173,9 +207,22 @@ let begin_construction ~chain_id ~predecessor_context:ctxt let baker = Signature.Public_key.hash baker in Full_construction {predecessor; baker; protocol_data; block_delay} in - (mode, ctxt) ) - >|=? fun (mode, ctxt) -> - {mode; chain_id; ctxt; op_count = 0; migration_balance_updates} + let escape_vote = protocol_data.liquidity_baking_escape_vote in + (mode, ctxt, escape_vote) ) + >>=? fun (mode, ctxt, escape_vote) -> + Apply.apply_liquidity_baking_subsidy ctxt ~escape_vote + >|=? fun ( ctxt, + liquidity_baking_operations_results, + liquidity_baking_escape_ema ) -> + { + mode; + chain_id; + ctxt; + op_count = 0; + migration_balance_updates; + liquidity_baking_escape_ema; + implicit_operations_results = liquidity_baking_operations_results; + } let apply_operation ({mode; chain_id; ctxt; op_count; _} as data) (operation : Alpha_context.packed_operation) = @@ -213,7 +260,13 @@ let apply_operation ({mode; chain_id; ctxt; op_count; _} as data) let op_count = op_count + 1 in ({data with ctxt; op_count}, Operation_metadata result) -let finalize_block {mode; ctxt; op_count; migration_balance_updates} = +let finalize_block + { mode; + ctxt; + op_count; + migration_balance_updates; + liquidity_baking_escape_ema; + implicit_operations_results } = match mode with | Partial_construction _ -> Alpha_context.Voting_period.get_current_info ctxt @@ -247,6 +300,8 @@ let finalize_block {mode; ctxt; op_count; migration_balance_updates} = consumed_gas = Alpha_context.Gas.Arith.zero; deactivated = []; balance_updates = migration_balance_updates; + liquidity_baking_escape_ema; + implicit_operations_results; } ) | Partial_application {block_header; baker; block_delay} -> let included_endorsements = Alpha_context.included_endorsements ctxt in @@ -278,6 +333,8 @@ let finalize_block {mode; ctxt; op_count; migration_balance_updates} = consumed_gas = Alpha_context.Gas.Arith.zero; deactivated = []; balance_updates = migration_balance_updates; + liquidity_baking_escape_ema; + implicit_operations_results; } ) | Application { baker; @@ -290,6 +347,8 @@ let finalize_block {mode; ctxt; op_count; migration_balance_updates} = baker ~block_delay migration_balance_updates + ~liquidity_baking_escape_ema + implicit_operations_results >|=? fun (ctxt, receipt) -> let level = Alpha_context.Level.current ctxt in let priority = protocol_data.priority in diff --git a/src/proto_alpha/lib_protocol/main.mli b/src/proto_alpha/lib_protocol/main.mli index 2128db498b606ca30cc935460250224df5823a25..519c5f063023c407a8b36bd78ef75a0acd753459 100644 --- a/src/proto_alpha/lib_protocol/main.mli +++ b/src/proto_alpha/lib_protocol/main.mli @@ -50,6 +50,9 @@ type validation_state = { ctxt : Alpha_context.t; op_count : int; migration_balance_updates : Alpha_context.Receipt.balance_updates; + liquidity_baking_escape_ema : Int32.t; + implicit_operations_results : + Apply_results.packed_successful_manager_operation_result list; } type operation_data = Alpha_context.packed_protocol_data diff --git a/src/proto_alpha/lib_protocol/parameters_repr.ml b/src/proto_alpha/lib_protocol/parameters_repr.ml index d5869c641c12dbf0776ad999c556f89649045dd7..61ac59ab5aab84ef6601f9fb9b9a458e5179ce88 100644 --- a/src/proto_alpha/lib_protocol/parameters_repr.ml +++ b/src/proto_alpha/lib_protocol/parameters_repr.ml @@ -30,7 +30,7 @@ type bootstrap_account = { } type bootstrap_contract = { - delegate : Signature.Public_key_hash.t; + delegate : Signature.Public_key_hash.t option; amount : Tez_repr.t; script : Script_repr.t; } @@ -84,7 +84,9 @@ let bootstrap_contract_encoding = (fun {delegate; amount; script} -> (delegate, amount, script)) (fun (delegate, amount, script) -> {delegate; amount; script}) (obj3 - (req "delegate" Signature.Public_key_hash.encoding) + (req + "delegate" + (Data_encoding.option Signature.Public_key_hash.encoding)) (req "amount" Tez_repr.encoding) (req "script" Script_repr.encoding)) diff --git a/src/proto_alpha/lib_protocol/parameters_repr.mli b/src/proto_alpha/lib_protocol/parameters_repr.mli index 6f8436e719b916ed3050d6f86b4c939adc2ec7bd..14cdb0d675154a2e5d6c2257f2b75956175a2a47 100644 --- a/src/proto_alpha/lib_protocol/parameters_repr.mli +++ b/src/proto_alpha/lib_protocol/parameters_repr.mli @@ -30,7 +30,7 @@ type bootstrap_account = { } type bootstrap_contract = { - delegate : Signature.Public_key_hash.t; + delegate : Signature.Public_key_hash.t option; amount : Tez_repr.t; script : Script_repr.t; } diff --git a/src/proto_alpha/lib_protocol/raw_context.ml b/src/proto_alpha/lib_protocol/raw_context.ml index e28fb8bb8f817f21074686b1e513acd6689be030..5cdb294e4be0e8c53341db8b49ffe14e1d0f8d16 100644 --- a/src/proto_alpha/lib_protocol/raw_context.ml +++ b/src/proto_alpha/lib_protocol/raw_context.ml @@ -786,6 +786,26 @@ let check_and_update_protocol_version ctxt = encoding directly in a way which is compatible with the previous protocol. However, by doing so, you do not change the value of these constants inside the context. *) + +(* only for the migration *) +let get_previous_protocol_constants ctxt = + Context.find ctxt constants_key + >>= function + | None -> + failwith + "Internal error: cannot read previous protocol constants in context." + | Some bytes -> ( + match + Data_encoding.Binary.of_bytes + Constants_repr.Proto_previous.parametric_encoding + bytes + with + | None -> + failwith + "Internal error: cannot parse previous protocol constants in context." + | Some constants -> + Lwt.return constants ) + let prepare_first_block ~level ~timestamp ~fitness ctxt = check_and_update_protocol_version ctxt >>=? fun (previous_proto, ctxt) -> @@ -796,7 +816,43 @@ let prepare_first_block ~level ~timestamp ~fitness ctxt = set_first_level ctxt first_level >>=? fun ctxt -> add_constants ctxt param.constants >|= ok | Edo_008 -> - return ctxt ) + get_previous_protocol_constants ctxt + >>= fun c -> + let constants = + Constants_repr. + { + preserved_cycles = c.preserved_cycles; + blocks_per_cycle = c.blocks_per_cycle; + blocks_per_commitment = c.blocks_per_commitment; + blocks_per_roll_snapshot = c.blocks_per_roll_snapshot; + blocks_per_voting_period = c.blocks_per_voting_period; + time_between_blocks = c.time_between_blocks; + endorsers_per_block = c.endorsers_per_block; + hard_gas_limit_per_operation = c.hard_gas_limit_per_operation; + hard_gas_limit_per_block = c.hard_gas_limit_per_block; + proof_of_work_threshold = c.proof_of_work_threshold; + tokens_per_roll = c.tokens_per_roll; + michelson_maximum_type_size = c.michelson_maximum_type_size; + seed_nonce_revelation_tip = c.seed_nonce_revelation_tip; + origination_size = c.origination_size; + block_security_deposit = c.block_security_deposit; + endorsement_security_deposit = c.endorsement_security_deposit; + baking_reward_per_endorsement = c.baking_reward_per_endorsement; + endorsement_reward = c.endorsement_reward; + hard_storage_limit_per_operation = + c.hard_storage_limit_per_operation; + cost_per_byte = c.cost_per_byte; + quorum_min = c.quorum_min; + quorum_max = c.quorum_max; + min_proposal_quorum = c.min_proposal_quorum; + initial_endorsers = c.initial_endorsers; + delay_per_missing_endorsement = c.delay_per_missing_endorsement; + liquidity_baking_subsidy = Tez_repr.of_mutez_exn 5_000_000L; + liquidity_baking_sunset_duration = 262800l; + liquidity_baking_escape_ema_threshold = 500_000l; + } + in + add_constants ctxt constants >|= ok ) >>=? fun ctxt -> prepare ctxt ~level ~predecessor_timestamp:timestamp ~timestamp ~fitness >|=? fun ctxt -> (previous_proto, ctxt) diff --git a/src/proto_alpha/lib_protocol/raw_context.mli b/src/proto_alpha/lib_protocol/raw_context.mli index 50e40c91793da4d0e1c97b3d6c0a8318a9b53fd8..255af2811ac0226d45454d9760c01240d703d2f2 100644 --- a/src/proto_alpha/lib_protocol/raw_context.mli +++ b/src/proto_alpha/lib_protocol/raw_context.mli @@ -128,6 +128,8 @@ val gas_consumed : since:t -> until:t -> Gas_limit_repr.Arith.fp val block_gas_level : t -> Gas_limit_repr.Arith.fp +val storage_space_to_pay : t -> Z.t option + val init_storage_space_to_pay : t -> t val update_storage_space_to_pay : t -> Z.t -> t diff --git a/src/proto_alpha/lib_protocol/receipt_repr.ml b/src/proto_alpha/lib_protocol/receipt_repr.ml index 13a7fd5072917f6dd03af7cc3634c992cb895634..3a9a4f6ab1b67926902d6a63b6fa7c5b0a3e6eb6 100644 --- a/src/proto_alpha/lib_protocol/receipt_repr.ml +++ b/src/proto_alpha/lib_protocol/receipt_repr.ml @@ -103,7 +103,7 @@ let balance_update_encoding = failwith "Qty.of_mutez" ) int64)) -type update_origin = Block_application | Protocol_migration +type update_origin = Block_application | Protocol_migration | Subsidy let update_origin_encoding = let open Data_encoding in @@ -121,7 +121,13 @@ let update_origin_encoding = ~title:"Protocol_migration" (constant "migration") (function Protocol_migration -> Some () | _ -> None) - (fun () -> Protocol_migration) ] + (fun () -> Protocol_migration); + case + (Tag 2) + ~title:"Subsidy" + (constant "subsidy") + (function Subsidy -> Some () | _ -> None) + (fun () -> Subsidy) ] type balance_updates = (balance * balance_update * update_origin) list diff --git a/src/proto_alpha/lib_protocol/receipt_repr.mli b/src/proto_alpha/lib_protocol/receipt_repr.mli index 616e82225d2d6393936110769b3b6c415c3660be..89930f84addbc4c24d0bc19da54eda4af1a22c2b 100644 --- a/src/proto_alpha/lib_protocol/receipt_repr.mli +++ b/src/proto_alpha/lib_protocol/receipt_repr.mli @@ -38,6 +38,7 @@ type balance_update = Debited of Tez_repr.t | Credited of Tez_repr.t type update_origin = | Block_application (** Update from a block application *) | Protocol_migration (** Update from a protocol migration *) + | Subsidy (** Update from an inflationary subsidy *) (** A list of balance updates. Duplicates may happen. *) type balance_updates = (balance * balance_update * update_origin) list diff --git a/src/proto_alpha/lib_protocol/storage.ml b/src/proto_alpha/lib_protocol/storage.ml index 6135c28e535aa709630c18cecc51eab7b58e9f52..a27e7932db95d108defc4d707b840ef4f0102498 100644 --- a/src/proto_alpha/lib_protocol/storage.ml +++ b/src/proto_alpha/lib_protocol/storage.ml @@ -1227,3 +1227,26 @@ module Pending_migration_balance_updates = let encoding = Receipt_repr.balance_updates_encoding end) + +module Liquidity_baking = struct + module Escape_ema = + Make_single_data_storage (Registered) (Raw_context) + (struct + let name = ["liquidity_baking_escape_ema"] + end) + (Int32) + + module Sunset_level = + Make_single_data_storage (Registered) (Raw_context) + (struct + let name = ["liquidity_baking_sunset_level"] + end) + (Int32) + + module Cpmm_address = + Make_single_data_storage (Registered) (Raw_context) + (struct + let name = ["liquidity_baking_cpmm_address"] + end) + (Contract_repr) +end diff --git a/src/proto_alpha/lib_protocol/storage.mli b/src/proto_alpha/lib_protocol/storage.mli index 694161e20bdec3cff94f78b82cca871901428767..a61699aaf3efcdfa9ef6b36affe244097171c9c4 100644 --- a/src/proto_alpha/lib_protocol/storage.mli +++ b/src/proto_alpha/lib_protocol/storage.mli @@ -487,3 +487,22 @@ module Pending_migration_balance_updates : Single_data_storage with type value = Receipt_repr.balance_updates and type t := Raw_context.t + +module Liquidity_baking : sig + (** Exponential moving average (ema) of flags set in protocol_data.contents. + If at any block it's above half the threshold set in constants, + liquidity baking permanently shuts off. **) + module Escape_ema : + Single_data_storage with type t := Raw_context.t and type value = Int32.t + + (** Level at which liquidity baking automatically shuts off. + Set in stitching to six months from activation of proto 010. **) + module Sunset_level : + Single_data_storage with type t := Raw_context.t and type value = Int32.t + + (** Constant product market maker contract that receives liquidity baking subsidy. **) + module Cpmm_address : + Single_data_storage + with type t := Raw_context.t + and type value = Contract_repr.t +end diff --git a/src/proto_alpha/lib_protocol/test/dune b/src/proto_alpha/lib_protocol/test/dune index 87b7e95ceff7fb0a23cccd5ff949fdb5a0020ed8..498ad10ce330e8000a83d6bc619d8209f11b349d 100644 --- a/src/proto_alpha/lib_protocol/test/dune +++ b/src/proto_alpha/lib_protocol/test/dune @@ -26,10 +26,6 @@ (deps main.exe) (action (progn))) -(rule - (copy %{lib:tezos-protocol-alpha-parameters:test-parameters.json} - protocol_parameters.json)) - ; runs only the `Quick tests (rule (alias runtest_proto_alpha) @@ -40,7 +36,7 @@ ; runs both `Quick and `Slow tests (rule (alias runtest_slow) - (deps (glob_files contracts/*)) + (deps (glob_files contracts/*) test-parameters) (package tezos-protocol-alpha-tests) (action (run %{exe:main.exe} -v))) diff --git a/src/proto_alpha/lib_protocol/test/helpers/block.ml b/src/proto_alpha/lib_protocol/test/helpers/block.ml index 6ee67bad2100a8e7d7b7b700d9f5919b097fe1de..62f32a4d84c9c8e9f3c01fed878f051b3ac83275 100644 --- a/src/proto_alpha/lib_protocol/test/helpers/block.ml +++ b/src/proto_alpha/lib_protocol/test/helpers/block.ml @@ -145,8 +145,14 @@ module Forge = struct Bytes.create Constants.proof_of_work_nonce_size let make_contents ?(proof_of_work_nonce = default_proof_of_work_nonce) - ~priority ~seed_nonce_hash () = - Block_header.{priority; proof_of_work_nonce; seed_nonce_hash} + ?(liquidity_baking_escape_vote = false) ~priority ~seed_nonce_hash () = + Block_header. + { + priority; + proof_of_work_nonce; + seed_nonce_hash; + liquidity_baking_escape_vote; + } let make_shell ~level ~predecessor ~timestamp ~fitness ~operations_hash = Tezos_base.Block_header. @@ -183,8 +189,8 @@ module Forge = struct in Block_header.{shell; protocol_data = {contents; signature}} - let forge_header ?(policy = By_priority 0) ?timestamp ?(operations = []) pred - = + let forge_header ?(policy = By_priority 0) ?timestamp ?(operations = []) + ?liquidity_baking_escape_vote pred = dispatch_policy policy pred >>=? fun (pkh, priority, _timestamp) -> Alpha_services.Delegate.Minimal_valid_time.get rpc_ctxt pred priority 0 @@ -216,13 +222,21 @@ module Forge = struct ~fitness ~operations_hash in - let contents = make_contents ~priority ~seed_nonce_hash () in + let contents = + make_contents ~priority ~seed_nonce_hash ?liquidity_baking_escape_vote () + in {baker = pkh; shell; contents} (* compatibility only, needed by incremental *) let contents ?(proof_of_work_nonce = default_proof_of_work_nonce) - ?(priority = 0) ?seed_nonce_hash () = - {Block_header.priority; proof_of_work_nonce; seed_nonce_hash} + ?(priority = 0) ?seed_nonce_hash ?(liquidity_baking_escape_vote = false) + () = + { + Block_header.priority; + proof_of_work_nonce; + seed_nonce_hash; + liquidity_baking_escape_vote; + } end (********* Genesis creation *************) @@ -245,8 +259,8 @@ let check_constants_consistency constants = "Inconsistent constants : blocks per cycle must be superior than \ blocks per roll snapshot") -let initial_context ?(with_commitments = false) constants header - initial_accounts = +let initial_context ?(with_commitments = false) ?bootstrap_contracts constants + header initial_accounts = let open Tezos_protocol_alpha_parameters in let bootstrap_accounts = List.map @@ -257,6 +271,7 @@ let initial_context ?(with_commitments = false) constants header let parameters = Default_parameters.parameters_of_constants ~bootstrap_accounts + ?bootstrap_contracts ~with_commitments constants in @@ -308,7 +323,8 @@ let genesis_with_parameters parameters = (* if no parameter file is passed we check in the current directory where the test is run *) let genesis ?with_commitments ?endorsers_per_block ?initial_endorsers - ?min_proposal_quorum (initial_accounts : (Account.t * Tez.t) list) = + ?min_proposal_quorum ?bootstrap_contracts + (initial_accounts : (Account.t * Tez.t) list) = if initial_accounts = [] then Stdlib.failwith "Must have one account with a roll to bake" ; let open Tezos_protocol_alpha_parameters in @@ -359,7 +375,12 @@ let genesis ?with_commitments ?endorsers_per_block ?initial_endorsers ~operations_hash:Operation_list_list_hash.zero in let contents = Forge.make_contents ~priority:0 ~seed_nonce_hash:None () in - initial_context ?with_commitments constants shell initial_accounts + initial_context + ?with_commitments + ?bootstrap_contracts + constants + shell + initial_accounts >|=? fun context -> { hash; @@ -370,7 +391,7 @@ let genesis ?with_commitments ?endorsers_per_block ?initial_endorsers (********* Baking *************) -let apply header ?(operations = []) pred = +let apply_with_metadata header ?(operations = []) pred = (let open Environment.Error_monad in Main.begin_application ~chain_id:Chain_id.zero @@ -386,13 +407,18 @@ let apply header ?(operations = []) pred = operations >>=? fun vstate -> Main.finalize_block vstate - >|=? fun (validation, _result) -> validation.context) + >|=? fun (validation, result) -> (validation.context, result)) >|= Environment.wrap_tzresult - >|=? fun context -> + >|=? fun (context, result) -> let hash = Block_header.hash header in - {hash; header; operations; context} + ({hash; header; operations; context}, result) + +let apply header ?(operations = []) pred = + apply_with_metadata header ~operations pred + >>=? fun (t, _metadata) -> return t -let bake ?policy ?timestamp ?operation ?operations pred = +let bake_with_metadata ?policy ?timestamp ?operation ?operations + ?liquidity_baking_escape_vote pred = let operations = match (operation, operations) with | (Some op, Some ops) -> @@ -404,17 +430,66 @@ let bake ?policy ?timestamp ?operation ?operations pred = | (None, None) -> None in - Forge.forge_header ?timestamp ?policy ?operations pred + Forge.forge_header + ?timestamp + ?policy + ?operations + ?liquidity_baking_escape_vote + pred >>=? fun header -> - Forge.sign_header header >>=? fun header -> apply header ?operations pred + Forge.sign_header header + >>=? fun header -> apply_with_metadata header ?operations pred + +let bake ?policy ?timestamp ?operation ?operations + ?liquidity_baking_escape_vote pred = + bake_with_metadata + ?policy + ?timestamp + ?operation + ?operations + ?liquidity_baking_escape_vote + pred + >>=? fun (t, _metadata) -> return t (********** Cycles ****************) (* This function is duplicated from Context to avoid a cyclic dependency *) let get_constants b = Alpha_services.Constants.all rpc_ctxt b -let bake_n ?policy n b = - List.fold_left_es (fun b _ -> bake ?policy b) b (1 -- n) +let bake_n ?policy ?liquidity_baking_escape_vote n b = + List.fold_left_es + (fun b _ -> bake ?policy ?liquidity_baking_escape_vote b) + b + (1 -- n) + +let bake_n_with_all_balance_updates ?policy ?liquidity_baking_escape_vote n b = + List.fold_left_es + (fun (b, balance_updates_rev) _ -> + bake_with_metadata ?policy ?liquidity_baking_escape_vote b + >>=? fun (b, metadata) -> + let balance_updates_rev = + List.rev_append metadata.balance_updates balance_updates_rev + in + let balance_updates_rev = + List.fold_left + (fun balance_updates_rev -> + let open Apply_results in + function + | Successful_manager_result (Reveal_result _) + | Successful_manager_result (Delegation_result _) -> + balance_updates_rev + | Successful_manager_result + (Transaction_result {balance_updates; _}) + | Successful_manager_result + (Origination_result {balance_updates; _}) -> + List.rev_append balance_updates balance_updates_rev) + balance_updates_rev + metadata.implicit_operations_results + in + return (b, balance_updates_rev)) + (b, []) + (1 -- n) + >|=? fun (b, balance_updates_rev) -> (b, List.rev balance_updates_rev) let bake_until_cycle_end ?policy b = get_constants b diff --git a/src/proto_alpha/lib_protocol/test/helpers/block.mli b/src/proto_alpha/lib_protocol/test/helpers/block.mli index 7d327b3fdf99544d227001c18d150ac74a6e9a4b..1e428da59f58042d814e7abd0de950c620302247 100644 --- a/src/proto_alpha/lib_protocol/test/helpers/block.mli +++ b/src/proto_alpha/lib_protocol/test/helpers/block.mli @@ -62,6 +62,7 @@ module Forge : sig ?proof_of_work_nonce:Bytes.t -> ?priority:int -> ?seed_nonce_hash:Nonce_hash.t -> + ?liquidity_baking_escape_vote:bool -> unit -> Block_header.contents @@ -73,6 +74,7 @@ module Forge : sig ?policy:baker_policy -> ?timestamp:Timestamp.time -> ?operations:Operation.packed list -> + ?liquidity_baking_escape_vote:bool -> t -> header tzresult Lwt.t @@ -96,6 +98,7 @@ val genesis : ?endorsers_per_block:int -> ?initial_endorsers:int -> ?min_proposal_quorum:int32 -> + ?bootstrap_contracts:Parameters.bootstrap_contract list -> (Account.t * Tez.tez) list -> block tzresult Lwt.t @@ -122,11 +125,26 @@ val bake : ?timestamp:Timestamp.time -> ?operation:Operation.packed -> ?operations:Operation.packed list -> + ?liquidity_baking_escape_vote:bool -> t -> t tzresult Lwt.t (** Bakes [n] blocks. *) -val bake_n : ?policy:baker_policy -> int -> t -> block tzresult Lwt.t +val bake_n : + ?policy:baker_policy -> + ?liquidity_baking_escape_vote:bool -> + int -> + t -> + block tzresult Lwt.t + +(** Version of bake_n that returns a list of all balance updates included + in the metadata of baked blocks. **) +val bake_n_with_all_balance_updates : + ?policy:baker_policy -> + ?liquidity_baking_escape_vote:bool -> + int -> + t -> + (block * Alpha_context.Receipt.balance_updates) tzresult Lwt.t val current_cycle : t -> Cycle.t tzresult Lwt.t diff --git a/src/proto_alpha/lib_protocol/test/helpers/context.ml b/src/proto_alpha/lib_protocol/test/helpers/context.ml index 7b18159b68a34d679be02299be7914a46c4ffb20..3234150f9880da70ac7c6a18b073c508a53b0109 100644 --- a/src/proto_alpha/lib_protocol/test/helpers/context.ml +++ b/src/proto_alpha/lib_protocol/test/helpers/context.ml @@ -173,6 +173,14 @@ let get_endorsing_reward ctxt ~priority ~endorsing_power = (Environment.wrap_tzresult Tez.(reward_per_endorsement *? Int64.of_int endorsing_power)) +let get_liquidity_baking_subsidy ctxt = + get_constants ctxt + >>=? fun {Constants.parametric = {liquidity_baking_subsidy; _}; _} -> + return liquidity_baking_subsidy + +let get_liquidity_baking_cpmm_address ctxt = + Alpha_services.Liquidity_baking.get_cpmm_address rpc_ctxt ctxt + (* Voting *) module Vote = struct @@ -274,6 +282,9 @@ module Contract = struct let delegate_opt ctxt contract = Alpha_services.Contract.delegate_opt rpc_ctxt ctxt contract + + let storage ctxt contract = + Alpha_services.Contract.storage rpc_ctxt ctxt contract end module Delegate = struct @@ -293,7 +304,7 @@ module Delegate = struct end let init ?endorsers_per_block ?with_commitments ?(initial_balances = []) - ?initial_endorsers ?min_proposal_quorum n = + ?initial_endorsers ?min_proposal_quorum ?bootstrap_contracts n = let accounts = Account.generate_accounts ~initial_balances n in let contracts = List.map @@ -305,5 +316,6 @@ let init ?endorsers_per_block ?with_commitments ?(initial_balances = []) ?with_commitments ?initial_endorsers ?min_proposal_quorum + ?bootstrap_contracts accounts >|=? fun blk -> (blk, contracts) diff --git a/src/proto_alpha/lib_protocol/test/helpers/context.mli b/src/proto_alpha/lib_protocol/test/helpers/context.mli index 1a21dcd7cc92cd9a1b7b9cf050474f476d85c300..624646a332c2a586e724c614bccab71af07e6072 100644 --- a/src/proto_alpha/lib_protocol/test/helpers/context.mli +++ b/src/proto_alpha/lib_protocol/test/helpers/context.mli @@ -63,6 +63,10 @@ val get_baking_reward : val get_endorsing_reward : t -> priority:int -> endorsing_power:int -> Tez.t tzresult Lwt.t +val get_liquidity_baking_subsidy : t -> Tez.t tzresult Lwt.t + +val get_liquidity_baking_cpmm_address : t -> Contract.t tzresult Lwt.t + module Vote : sig val get_ballots : t -> Vote.ballots tzresult Lwt.t @@ -108,6 +112,8 @@ module Contract : sig val delegate : t -> Contract.t -> public_key_hash tzresult Lwt.t val delegate_opt : t -> Contract.t -> public_key_hash option tzresult Lwt.t + + val storage : t -> Contract.t -> Script.expr tzresult Lwt.t end module Delegate : sig @@ -134,5 +140,6 @@ val init : ?initial_balances:int64 list -> ?initial_endorsers:int -> ?min_proposal_quorum:int32 -> + ?bootstrap_contracts:Parameters.bootstrap_contract list -> int -> (Block.t * Alpha_context.Contract.t list) tzresult Lwt.t diff --git a/src/proto_alpha/lib_protocol/test/main.ml b/src/proto_alpha/lib_protocol/test/main.ml index 3dfbf30e1f0fc2c1679b868d0e157f02a54853c0..ccdba4091cde6fdb6d0fed2934eadaddd7ef9926 100644 --- a/src/proto_alpha/lib_protocol/test/main.ml +++ b/src/proto_alpha/lib_protocol/test/main.ml @@ -60,5 +60,6 @@ let () = ("script deserialize gas", Test_script_gas.tests); ("failing_noop operation", Test_failing_noop.tests); ("storage description", Test_storage.tests); - ("time", Test_time_repr.tests) ] + ("time", Test_time_repr.tests); + ("liquidity baking", Test_liquidity_baking.tests) ] |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/test_liquidity_baking.ml b/src/proto_alpha/lib_protocol/test/test_liquidity_baking.ml new file mode 100644 index 0000000000000000000000000000000000000000..cc0a1f7e0518144cec03fa85a1ed299d9d27cac9 --- /dev/null +++ b/src/proto_alpha/lib_protocol/test/test_liquidity_baking.ml @@ -0,0 +1,409 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2021 Tocqueville Group, Inc. *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: liquidity baking + Invocation: dune exec src/proto_alpha/lib_protocol/test/main.exe -- test "^liquidity baking$" + Subject: Test liquidity baking subsidies, CPMM storage updates, + sunset shut off, and escape hatch shut off. +*) + +open Protocol +open Test_tez +open Micheline_printer + +let liquidity_baking_subsidy_param () = + Context.init 1 + >>=? fun (blk, _contracts) -> + Context.get_constants (B blk) + >>=? fun csts -> + let baking_reward_per_endorsement = + match List.hd csts.parametric.baking_reward_per_endorsement with + | None -> + assert false + | Some c -> + c + in + let endorsement_reward = + match List.hd csts.parametric.endorsement_reward with + | None -> + assert false + | Some c -> + c + in + let endorsers_per_block = csts.parametric.endorsers_per_block in + let actual_subsidy = csts.parametric.liquidity_baking_subsidy in + let expected_subsidy = + match Tez.(baking_reward_per_endorsement +? endorsement_reward) with + | Error _ -> + assert false + | Ok c -> ( + match Tez.(mul_exn c endorsers_per_block /? 16L) with + | Error _ -> + assert false + | Ok c -> + c ) + in + Assert.equal_tez ~loc:__LOC__ actual_subsidy expected_subsidy + +let liquidity_baking_subsidies n () = + Context.init 1 + >>=? fun (blk, _contracts) -> + Context.get_liquidity_baking_cpmm_address (B blk) + >>=? fun liquidity_baking -> + Context.Contract.balance (B blk) liquidity_baking + >>=? fun old_balance -> + Block.bake_n n blk + >>=? fun blk -> + Context.get_liquidity_baking_subsidy (B blk) + >>=? fun liquidity_baking_subsidy -> + Tez.(liquidity_baking_subsidy *? Int64.(of_int n)) + >>?= fun expected_balance -> + Assert.balance_was_credited + ~loc:__LOC__ + (B blk) + liquidity_baking + old_balance + expected_balance + >>=? fun () -> return_unit + +let liquidity_baking_sunset_level n () = + Context.init 1 + >>=? fun (blk, _contracts) -> + Context.get_liquidity_baking_cpmm_address (B blk) + >>=? fun liquidity_baking -> + Context.get_constants (B blk) + >>=? fun csts -> + let sunset = csts.parametric.liquidity_baking_sunset_duration in + Context.Contract.balance (B blk) liquidity_baking + >>=? fun old_balance -> + Block.bake_n (Int32.to_int sunset + n) blk + >>=? fun blk -> + Context.get_liquidity_baking_subsidy (B blk) + >>=? fun liquidity_baking_subsidy -> + Tez.(liquidity_baking_subsidy *? Int64.(sub (of_int32 sunset) 1L)) + >>?= fun expected_balance -> + Assert.balance_was_credited + ~loc:__LOC__ + (B blk) + liquidity_baking + old_balance + expected_balance + >>=? fun () -> return_unit + +let liquidity_baking_escape_hatch_100 n () = + Context.init 1 + >>=? fun (blk, _contracts) -> + Context.get_liquidity_baking_cpmm_address (B blk) + >>=? fun liquidity_baking -> + (* log(1-1/2) / log(0.999) *) + let escape_level = 694 in + Context.Contract.balance (B blk) liquidity_baking + >>=? fun old_balance -> + Block.bake_n ~liquidity_baking_escape_vote:true escape_level blk + >>=? fun blk -> + Block.bake_n n blk + >>=? fun blk -> + Context.get_liquidity_baking_subsidy (B blk) + >>=? fun liquidity_baking_subsidy -> + Tez.(liquidity_baking_subsidy *? Int64.(sub (of_int escape_level) 1L)) + >>?= fun expected_balance -> + Assert.balance_was_credited + ~loc:__LOC__ + (B blk) + liquidity_baking + old_balance + expected_balance + >>=? fun () -> return_unit + +let liquidity_baking_escape_hatch_80 n () = + Context.init 1 + >>=? fun (blk, _contracts) -> + Context.get_liquidity_baking_cpmm_address (B blk) + >>=? fun liquidity_baking -> + (* log(1-1/(2*.8)) / log(0.999) *) + let escape_level = 983 in + Context.Contract.balance (B blk) liquidity_baking + >>=? fun old_balance -> + let rec bake_80_percent_escaping blk i = + if i < escape_level then + Block.bake blk + >>=? fun blk -> + Block.bake_n ~liquidity_baking_escape_vote:true 4 blk + >>=? fun blk -> bake_80_percent_escaping blk (i + 5) + else return blk + in + bake_80_percent_escaping blk 0 + >>=? fun blk -> + Block.bake_n n blk + >>=? fun blk -> + Context.get_liquidity_baking_subsidy (B blk) + >>=? fun liquidity_baking_subsidy -> + Tez.(liquidity_baking_subsidy *? Int64.(sub (of_int escape_level) 1L)) + >>?= fun expected_balance -> + Assert.balance_was_credited + ~loc:__LOC__ + (B blk) + liquidity_baking + old_balance + expected_balance + >>=? fun () -> return_unit + +let liquidity_baking_escape_hatch_60 n () = + Context.init 1 + >>=? fun (blk, _contracts) -> + Context.get_liquidity_baking_cpmm_address (B blk) + >>=? fun liquidity_baking -> + (* log(1-1/(2*.6)) / log(0.999) *) + let escape_level = 1790 in + Context.Contract.balance (B blk) liquidity_baking + >>=? fun old_balance -> + let rec bake_60_percent_escaping blk i = + if i < escape_level then + Block.bake_n 2 blk + >>=? fun blk -> + Block.bake_n ~liquidity_baking_escape_vote:true 3 blk + >>=? fun blk -> bake_60_percent_escaping blk (i + 5) + else return blk + in + bake_60_percent_escaping blk 0 + >>=? fun blk -> + Block.bake_n n blk + >>=? fun blk -> + Context.get_liquidity_baking_subsidy (B blk) + >>=? fun liquidity_baking_subsidy -> + Tez.(liquidity_baking_subsidy *? Int64.(sub (of_int escape_level) 1L)) + >>?= fun expected_balance -> + Assert.balance_was_credited + ~loc:__LOC__ + (B blk) + liquidity_baking + old_balance + expected_balance + >>=? fun () -> return_unit + +let liquidity_baking_escape_hatch_50 n () = + Context.init 1 + >>=? fun (blk, _contracts) -> + Context.get_liquidity_baking_cpmm_address (B blk) + >>=? fun liquidity_baking -> + Context.get_constants (B blk) + >>=? fun csts -> + let sunset = csts.parametric.liquidity_baking_sunset_duration in + Context.Contract.balance (B blk) liquidity_baking + >>=? fun old_balance -> + let rec bake_50_percent_escaping blk i = + if i < Int32.to_int sunset + n then + Block.bake blk + >>=? fun blk -> + Block.bake ~liquidity_baking_escape_vote:true blk + >>=? fun blk -> bake_50_percent_escaping blk (i + 2) + else return blk + in + bake_50_percent_escaping blk 0 + >>=? fun blk -> + Context.get_liquidity_baking_subsidy (B blk) + >>=? fun liquidity_baking_subsidy -> + Tez.(liquidity_baking_subsidy *? Int64.(sub (of_int32 sunset) 1L)) + >>?= fun expected_balance -> + Assert.balance_was_credited + ~loc:__LOC__ + (B blk) + liquidity_baking + old_balance + expected_balance + >>=? fun () -> return_unit + +let liquidity_baking_storage n () = + Context.init 1 + >>=? fun (blk, _contracts) -> + Context.get_liquidity_baking_cpmm_address (B blk) + >>=? fun liquidity_baking -> + let expected_storage = + Expr.from_string + (Printf.sprintf + "Pair 0\n\ + \ %d\n\ + \ 0\n\ + \ False\n\ + \ \"KT1QuofAgnsWffHzLA7D78rxytJruGHDe7XG\"\n\ + \ \"KT1SLWhfqPtQq7f4zLomh8BNgDeprF9B6d2M\"" + (n * 5000000)) + in + Block.bake_n n blk + >>=? fun blk -> + Context.Contract.storage (B blk) liquidity_baking + >>=? fun storage -> + let to_string expr = + expr |> Michelson_v1_primitives.strings_of_prims + |> Micheline.inject_locations (fun _ -> {comment = None}) + |> Format.asprintf "%a" Micheline_printer.print_expr + in + Assert.equal + ~loc:__LOC__ + String.equal + "Storage isn't equal" + Format.pp_print_string + (to_string storage) + (to_string expected_storage) + >>=? fun () -> return_unit + +let liquidity_baking_balance_update () = + Context.init 1 + >>=? fun (blk, _contracts) -> + Context.get_liquidity_baking_cpmm_address (B blk) + >>=? fun liquidity_baking -> + Context.get_constants (B blk) + >>=? fun csts -> + let sunset = csts.parametric.liquidity_baking_sunset_duration in + Block.bake_n_with_all_balance_updates Int32.(to_int (add sunset 100l)) blk + >>=? fun (_blk, balance_updates) -> + let liquidity_baking_updates = + List.filter + (fun el -> + match el with + | ( Alpha_context.Receipt.Contract contract, + Alpha_context.Receipt.Credited _, + Alpha_context.Receipt.Subsidy ) -> + if Alpha_context.Contract.(contract = liquidity_baking) then true + else false + | _ -> + false) + balance_updates + in + let credits = + List.fold_left + (fun accum (_, update, _) -> + match update with + | Alpha_context.Receipt.Credited x -> + Tez.(accum + x) + | Alpha_context.Receipt.Debited x -> ( + match Tez.(accum -? x) with + | Ok r -> + r + | Error _ -> + Stdlib.failwith "subtracting tez" )) + Tez.(of_int 0) + liquidity_baking_updates + in + Assert.equal_tez + ~loc:__LOC__ + credits + (Tez.of_int ((Int32.to_int sunset - 1) * 5)) + >>=? fun () -> return_unit + +let tests = + [ Test_services.tztest + "test liquidity_baking_subsidy parameter is 1/6th of total baking rewards" + `Quick + liquidity_baking_subsidy_param; + Test_services.tztest + "test liquidity baking subsidy is correct" + `Quick + (liquidity_baking_subsidies 64); + Test_services.tztest + "test liquidity baking shuts off at sunset level when baking one block \ + longer" + `Quick + (liquidity_baking_sunset_level 1); + Test_services.tztest + "test liquidity baking shuts off at sunset level when baking two blocks \ + longer" + `Quick + (liquidity_baking_sunset_level 2); + Test_services.tztest + "test liquidity baking shuts off at sunset level when baking 100 blocks \ + longer" + `Quick + (liquidity_baking_sunset_level 100); + Test_services.tztest + "test liquidity baking escape hatch with 100% of bakers flagging when \ + baking one block longer" + `Quick + (liquidity_baking_escape_hatch_100 1); + Test_services.tztest + "test liquidity baking escape hatch with 100% of bakers flagging\n\ + \ when baking two blocks longer" + `Quick + (liquidity_baking_escape_hatch_100 2); + Test_services.tztest + "test liquidity baking escape hatch with 100% of bakers flagging when \ + baking 100 blocks longer" + `Quick + (liquidity_baking_escape_hatch_100 100); + Test_services.tztest + "test liquidity baking escape hatch with 80% of bakers flagging when \ + baking one block longer" + `Quick + (liquidity_baking_escape_hatch_80 1); + Test_services.tztest + "test liquidity baking escape hatch with 80% of bakers flagging\n\ + \ when baking two blocks longer" + `Quick + (liquidity_baking_escape_hatch_80 2); + Test_services.tztest + "test liquidity baking escape hatch with 80% of bakers flagging when \ + baking 100 blocks longer" + `Quick + (liquidity_baking_escape_hatch_80 100); + Test_services.tztest + "test liquidity baking escape hatch with 60% of bakers flagging when \ + baking one block longer" + `Quick + (liquidity_baking_escape_hatch_60 1); + Test_services.tztest + "test liquidity baking escape hatch with 60% of bakers flagging\n\ + \ when baking two blocks longer" + `Quick + (liquidity_baking_escape_hatch_60 2); + Test_services.tztest + "test liquidity baking escape hatch with 60% of bakers flagging when \ + baking 100 blocks longer" + `Quick + (liquidity_baking_escape_hatch_60 100); + Test_services.tztest + "test liquidity baking shuts off at sunset level with escape hatch at \ + 50% and baking one block longer" + `Quick + (liquidity_baking_escape_hatch_50 1); + Test_services.tztest + "test liquidity baking shuts off at sunset level with escape hatch at \ + 50% and baking two blocks longer" + `Quick + (liquidity_baking_escape_hatch_50 2); + Test_services.tztest + "test liquidity baking shuts off at sunset level with escape hatch at \ + 50% and baking 100 blocks longer" + `Quick + (liquidity_baking_escape_hatch_50 100); + Test_services.tztest + "test liquidity baking storage is updated" + `Quick + (liquidity_baking_storage 64); + Test_services.tztest + "test liquidity baking balance updates" + `Quick + liquidity_baking_balance_update ] diff --git "a/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[get_and_update_big_map.tz-(Pair (Some 4) {})-\"hello\"-(Pa.2a2f4be41d.out" "b/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[get_and_update_big_map.tz-(Pair (Some 4) {})-\"hello\"-(Pa.2a2f4be41d.out" new file mode 100644 index 0000000000000000000000000000000000000000..7df889c6d2aef4adc350492e207a323f4ff5c2b8 --- /dev/null +++ "b/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[get_and_update_big_map.tz-(Pair (Some 4) {})-\"hello\"-(Pa.2a2f4be41d.out" @@ -0,0 +1,42 @@ +tests_alpha/test_contract_opcodes.py::TestContractOpcodes::test__big_map_contract_io[get_and_update_big_map.tz-(Pair (Some 4) {})-"hello"-(Pair None 2)-big_map_diff10] + +storage + (Pair None 2) +emitted operations + +big_map diff + New map(2) of type (big_map string nat) + Set map(2)["hello"] to 4 +trace + - location: 11 (remaining gas: 1039988.651 units remaining) + [ (Pair "hello" (Some 4) {}) ] + - location: 13 (remaining gas: 1039988.541 units remaining) + [ "hello" @parameter + (Pair (Some 4) {}) @storage ] + - location: 16 (remaining gas: 1039988.386 units remaining) + [ (Some 4) + {} ] + - location: 15 (remaining gas: 1039988.341 units remaining) + [ (Some 4) + {} ] + - location: 14 (remaining gas: 1039988.341 units remaining) + [ "hello" @parameter + (Some 4) + {} ] + - location: -1 (remaining gas: 1039988.296 units remaining) + [ "hello" @parameter + (Some 4) + {} ] + - location: 17 (remaining gas: 1039975.349 units remaining) + [ None + { Elt "hello" 4 } ] + - location: 18 (remaining gas: 1039975.274 units remaining) + [ (Pair None { Elt "hello" 4 }) ] + - location: 19 (remaining gas: 1039975.199 units remaining) + [ {} + (Pair None { Elt "hello" 4 }) ] + - location: 21 (remaining gas: 1039975.124 units remaining) + [ (Pair {} None { Elt "hello" 4 }) ] + - location: -1 (remaining gas: 1039975.079 units remaining) + [ (Pair {} None { Elt "hello" 4 }) ] + diff --git "a/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[get_and_update_big_map.tz-(Pair (Some 5) { Elt \"hello\" 4.129664940f.out" "b/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[get_and_update_big_map.tz-(Pair (Some 5) { Elt \"hello\" 4.129664940f.out" new file mode 100644 index 0000000000000000000000000000000000000000..38d4324580508532563ad89361539d4b16061057 --- /dev/null +++ "b/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[get_and_update_big_map.tz-(Pair (Some 5) { Elt \"hello\" 4.129664940f.out" @@ -0,0 +1,42 @@ +tests_alpha/test_contract_opcodes.py::TestContractOpcodes::test__big_map_contract_io[get_and_update_big_map.tz-(Pair (Some 5) { Elt "hello" 4 })-"hello"-(Pair (Some 4) 2)-big_map_diff12] + +storage + (Pair (Some 4) 2) +emitted operations + +big_map diff + New map(2) of type (big_map string nat) + Set map(2)["hello"] to 5 +trace + - location: 11 (remaining gas: 1039975.271 units remaining) + [ (Pair "hello" (Some 5) { Elt "hello" 4 }) ] + - location: 13 (remaining gas: 1039975.161 units remaining) + [ "hello" @parameter + (Pair (Some 5) { Elt "hello" 4 }) @storage ] + - location: 16 (remaining gas: 1039975.006 units remaining) + [ (Some 5) + { Elt "hello" 4 } ] + - location: 15 (remaining gas: 1039974.961 units remaining) + [ (Some 5) + { Elt "hello" 4 } ] + - location: 14 (remaining gas: 1039974.961 units remaining) + [ "hello" @parameter + (Some 5) + { Elt "hello" 4 } ] + - location: -1 (remaining gas: 1039974.916 units remaining) + [ "hello" @parameter + (Some 5) + { Elt "hello" 4 } ] + - location: 17 (remaining gas: 1039961.963 units remaining) + [ (Some 4) + { Elt "hello" 5 } ] + - location: 18 (remaining gas: 1039961.888 units remaining) + [ (Pair (Some 4) { Elt "hello" 5 }) ] + - location: 19 (remaining gas: 1039961.813 units remaining) + [ {} + (Pair (Some 4) { Elt "hello" 5 }) ] + - location: 21 (remaining gas: 1039961.738 units remaining) + [ (Pair {} (Some 4) { Elt "hello" 5 }) ] + - location: -1 (remaining gas: 1039961.693 units remaining) + [ (Pair {} (Some 4) { Elt "hello" 5 }) ] + diff --git "a/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[get_and_update_big_map.tz-(Pair (Some 5) { Elt \"hello\" 4.7f9778b826.out" "b/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[get_and_update_big_map.tz-(Pair (Some 5) { Elt \"hello\" 4.7f9778b826.out" new file mode 100644 index 0000000000000000000000000000000000000000..e1f193a0d89e136c5eb48016e953fd03ef61bf79 --- /dev/null +++ "b/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[get_and_update_big_map.tz-(Pair (Some 5) { Elt \"hello\" 4.7f9778b826.out" @@ -0,0 +1,43 @@ +tests_alpha/test_contract_opcodes.py::TestContractOpcodes::test__big_map_contract_io[get_and_update_big_map.tz-(Pair (Some 5) { Elt "hello" 4 })-"hi"-(Pair None 2)-big_map_diff13] + +storage + (Pair None 2) +emitted operations + +big_map diff + New map(2) of type (big_map string nat) + Set map(2)["hello"] to 4 + Set map(2)["hi"] to 5 +trace + - location: 11 (remaining gas: 1039975.301 units remaining) + [ (Pair "hi" (Some 5) { Elt "hello" 4 }) ] + - location: 13 (remaining gas: 1039975.191 units remaining) + [ "hi" @parameter + (Pair (Some 5) { Elt "hello" 4 }) @storage ] + - location: 16 (remaining gas: 1039975.036 units remaining) + [ (Some 5) + { Elt "hello" 4 } ] + - location: 15 (remaining gas: 1039974.991 units remaining) + [ (Some 5) + { Elt "hello" 4 } ] + - location: 14 (remaining gas: 1039974.991 units remaining) + [ "hi" @parameter + (Some 5) + { Elt "hello" 4 } ] + - location: -1 (remaining gas: 1039974.946 units remaining) + [ "hi" @parameter + (Some 5) + { Elt "hello" 4 } ] + - location: 17 (remaining gas: 1039965.996 units remaining) + [ None + { Elt "hello" 4 ; Elt "hi" 5 } ] + - location: 18 (remaining gas: 1039965.921 units remaining) + [ (Pair None { Elt "hello" 4 ; Elt "hi" 5 }) ] + - location: 19 (remaining gas: 1039965.846 units remaining) + [ {} + (Pair None { Elt "hello" 4 ; Elt "hi" 5 }) ] + - location: 21 (remaining gas: 1039965.771 units remaining) + [ (Pair {} None { Elt "hello" 4 ; Elt "hi" 5 }) ] + - location: -1 (remaining gas: 1039965.726 units remaining) + [ (Pair {} None { Elt "hello" 4 ; Elt "hi" 5 }) ] + diff --git "a/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[get_and_update_big_map.tz-(Pair None { Elt \"1\" 1 ; .a8fbd9ff17.out" "b/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[get_and_update_big_map.tz-(Pair None { Elt \"1\" 1 ; .a8fbd9ff17.out" new file mode 100644 index 0000000000000000000000000000000000000000..0899ad1ca1869cd7800bd20eb476ba232db51cc8 --- /dev/null +++ "b/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[get_and_update_big_map.tz-(Pair None { Elt \"1\" 1 ; .a8fbd9ff17.out" @@ -0,0 +1,43 @@ +tests_alpha/test_contract_opcodes.py::TestContractOpcodes::test__big_map_contract_io[get_and_update_big_map.tz-(Pair None { Elt "1" 1 ; Elt "2" 2 })-"1"-(Pair (Some 1) 2)-big_map_diff14] + +storage + (Pair (Some 1) 2) +emitted operations + +big_map diff + New map(2) of type (big_map string nat) + Set map(2)["2"] to 2 + Unset map(2)["1"] +trace + - location: 11 (remaining gas: 1039970.137 units remaining) + [ (Pair "1" None { Elt "1" 1 ; Elt "2" 2 }) ] + - location: 13 (remaining gas: 1039970.027 units remaining) + [ "1" @parameter + (Pair None { Elt "1" 1 ; Elt "2" 2 }) @storage ] + - location: 16 (remaining gas: 1039969.872 units remaining) + [ None + { Elt "1" 1 ; Elt "2" 2 } ] + - location: 15 (remaining gas: 1039969.827 units remaining) + [ None + { Elt "1" 1 ; Elt "2" 2 } ] + - location: 14 (remaining gas: 1039969.827 units remaining) + [ "1" @parameter + None + { Elt "1" 1 ; Elt "2" 2 } ] + - location: -1 (remaining gas: 1039969.782 units remaining) + [ "1" @parameter + None + { Elt "1" 1 ; Elt "2" 2 } ] + - location: 17 (remaining gas: 1039960.830 units remaining) + [ (Some 1) + { Elt "2" 2 } ] + - location: 18 (remaining gas: 1039960.755 units remaining) + [ (Pair (Some 1) { Elt "2" 2 }) ] + - location: 19 (remaining gas: 1039960.680 units remaining) + [ {} + (Pair (Some 1) { Elt "2" 2 }) ] + - location: 21 (remaining gas: 1039960.605 units remaining) + [ (Pair {} (Some 1) { Elt "2" 2 }) ] + - location: -1 (remaining gas: 1039960.560 units remaining) + [ (Pair {} (Some 1) { Elt "2" 2 }) ] + diff --git "a/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[get_and_update_big_map.tz-(Pair None { Elt \"1\" 1 ; .cfc446b130.out" "b/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[get_and_update_big_map.tz-(Pair None { Elt \"1\" 1 ; .cfc446b130.out" new file mode 100644 index 0000000000000000000000000000000000000000..ebfd3711cb576e2807d603c7db3c72c33b8ebe10 --- /dev/null +++ "b/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[get_and_update_big_map.tz-(Pair None { Elt \"1\" 1 ; .cfc446b130.out" @@ -0,0 +1,43 @@ +tests_alpha/test_contract_opcodes.py::TestContractOpcodes::test__big_map_contract_io[get_and_update_big_map.tz-(Pair None { Elt "1" 1 ; Elt "2" 2 })-"1"-(Pair (Some 1) 2)-big_map_diff15] + +storage + (Pair (Some 1) 2) +emitted operations + +big_map diff + New map(2) of type (big_map string nat) + Set map(2)["2"] to 2 + Unset map(2)["1"] +trace + - location: 11 (remaining gas: 1039970.137 units remaining) + [ (Pair "1" None { Elt "1" 1 ; Elt "2" 2 }) ] + - location: 13 (remaining gas: 1039970.027 units remaining) + [ "1" @parameter + (Pair None { Elt "1" 1 ; Elt "2" 2 }) @storage ] + - location: 16 (remaining gas: 1039969.872 units remaining) + [ None + { Elt "1" 1 ; Elt "2" 2 } ] + - location: 15 (remaining gas: 1039969.827 units remaining) + [ None + { Elt "1" 1 ; Elt "2" 2 } ] + - location: 14 (remaining gas: 1039969.827 units remaining) + [ "1" @parameter + None + { Elt "1" 1 ; Elt "2" 2 } ] + - location: -1 (remaining gas: 1039969.782 units remaining) + [ "1" @parameter + None + { Elt "1" 1 ; Elt "2" 2 } ] + - location: 17 (remaining gas: 1039960.830 units remaining) + [ (Some 1) + { Elt "2" 2 } ] + - location: 18 (remaining gas: 1039960.755 units remaining) + [ (Pair (Some 1) { Elt "2" 2 }) ] + - location: 19 (remaining gas: 1039960.680 units remaining) + [ {} + (Pair (Some 1) { Elt "2" 2 }) ] + - location: 21 (remaining gas: 1039960.605 units remaining) + [ (Pair {} (Some 1) { Elt "2" 2 }) ] + - location: -1 (remaining gas: 1039960.560 units remaining) + [ (Pair {} (Some 1) { Elt "2" 2 }) ] + diff --git "a/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[get_and_update_big_map.tz-(Pair None { Elt \"hello\" 4 })-.54dc01b7ba.out" "b/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[get_and_update_big_map.tz-(Pair None { Elt \"hello\" 4 })-.54dc01b7ba.out" new file mode 100644 index 0000000000000000000000000000000000000000..6a32b6abdacf91ef5fd130a7c9f840c80e14a16e --- /dev/null +++ "b/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[get_and_update_big_map.tz-(Pair None { Elt \"hello\" 4 })-.54dc01b7ba.out" @@ -0,0 +1,42 @@ +tests_alpha/test_contract_opcodes.py::TestContractOpcodes::test__big_map_contract_io[get_and_update_big_map.tz-(Pair None { Elt "hello" 4 })-"hello"-(Pair (Some 4) 2)-big_map_diff11] + +storage + (Pair (Some 4) 2) +emitted operations + +big_map diff + New map(2) of type (big_map string nat) + Unset map(2)["hello"] +trace + - location: 11 (remaining gas: 1039975.511 units remaining) + [ (Pair "hello" None { Elt "hello" 4 }) ] + - location: 13 (remaining gas: 1039975.401 units remaining) + [ "hello" @parameter + (Pair None { Elt "hello" 4 }) @storage ] + - location: 16 (remaining gas: 1039975.246 units remaining) + [ None + { Elt "hello" 4 } ] + - location: 15 (remaining gas: 1039975.201 units remaining) + [ None + { Elt "hello" 4 } ] + - location: 14 (remaining gas: 1039975.201 units remaining) + [ "hello" @parameter + None + { Elt "hello" 4 } ] + - location: -1 (remaining gas: 1039975.156 units remaining) + [ "hello" @parameter + None + { Elt "hello" 4 } ] + - location: 17 (remaining gas: 1039962.203 units remaining) + [ (Some 4) + {} ] + - location: 18 (remaining gas: 1039962.128 units remaining) + [ (Pair (Some 4) {}) ] + - location: 19 (remaining gas: 1039962.053 units remaining) + [ {} + (Pair (Some 4) {}) ] + - location: 21 (remaining gas: 1039961.978 units remaining) + [ (Pair {} (Some 4) {}) ] + - location: -1 (remaining gas: 1039961.933 units remaining) + [ (Pair {} (Some 4) {}) ] + diff --git "a/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[get_and_update_big_map.tz-(Pair None {})-\"hello\"-(Pair N.c793d810c2.out" "b/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[get_and_update_big_map.tz-(Pair None {})-\"hello\"-(Pair N.c793d810c2.out" new file mode 100644 index 0000000000000000000000000000000000000000..0464e82f91f5066c18b6a48e535c02ea54c12d80 --- /dev/null +++ "b/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[get_and_update_big_map.tz-(Pair None {})-\"hello\"-(Pair N.c793d810c2.out" @@ -0,0 +1,42 @@ +tests_alpha/test_contract_opcodes.py::TestContractOpcodes::test__big_map_contract_io[get_and_update_big_map.tz-(Pair None {})-"hello"-(Pair None 2)-big_map_diff9] + +storage + (Pair None 2) +emitted operations + +big_map diff + New map(2) of type (big_map string nat) + Unset map(2)["hello"] +trace + - location: 11 (remaining gas: 1039988.891 units remaining) + [ (Pair "hello" None {}) ] + - location: 13 (remaining gas: 1039988.781 units remaining) + [ "hello" @parameter + (Pair None {}) @storage ] + - location: 16 (remaining gas: 1039988.626 units remaining) + [ None + {} ] + - location: 15 (remaining gas: 1039988.581 units remaining) + [ None + {} ] + - location: 14 (remaining gas: 1039988.581 units remaining) + [ "hello" @parameter + None + {} ] + - location: -1 (remaining gas: 1039988.536 units remaining) + [ "hello" @parameter + None + {} ] + - location: 17 (remaining gas: 1039975.589 units remaining) + [ None + {} ] + - location: 18 (remaining gas: 1039975.514 units remaining) + [ (Pair None {}) ] + - location: 19 (remaining gas: 1039975.439 units remaining) + [ {} + (Pair None {}) ] + - location: 21 (remaining gas: 1039975.364 units remaining) + [ (Pair {} None {}) ] + - location: -1 (remaining gas: 1039975.319 units remaining) + [ (Pair {} None {}) ] + diff --git "a/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[get_big_map_value.tz-(Pair { Elt \"1\" \"one\" ; Elt \"2\" \"tw.5f65a574b4.out" "b/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[get_big_map_value.tz-(Pair { Elt \"1\" \"one\" ; Elt \"2\" \"tw.5f65a574b4.out" new file mode 100644 index 0000000000000000000000000000000000000000..c323c3392688f4a84fba2039c691369ccd2a1c58 --- /dev/null +++ "b/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[get_big_map_value.tz-(Pair { Elt \"1\" \"one\" ; Elt \"2\" \"tw.5f65a574b4.out" @@ -0,0 +1,51 @@ +tests_alpha/test_contract_opcodes.py::TestContractOpcodes::test__big_map_contract_io[get_big_map_value.tz-(Pair { Elt "1" "one" ; Elt "2" "two" } None)-"1"-(Pair 2 (Some "one"))-big_map_diff2] + +storage + (Pair 2 (Some "one")) +emitted operations + +big_map diff + New map(2) of type (big_map string string) + Set map(2)["2"] to "two" + Set map(2)["1"] to "one" +trace + - location: 11 (remaining gas: 1039965.019 units remaining) + [ (Pair "1" { Elt "1" "one" ; Elt "2" "two" } None) ] + - location: 12 (remaining gas: 1039964.939 units remaining) + [ (Pair "1" { Elt "1" "one" ; Elt "2" "two" } None) + (Pair "1" { Elt "1" "one" ; Elt "2" "two" } None) ] + - location: 13 (remaining gas: 1039964.859 units remaining) + [ "1" @parameter + (Pair "1" { Elt "1" "one" ; Elt "2" "two" } None) ] + - location: 17 (remaining gas: 1039964.674 units remaining) + [ (Pair { Elt "1" "one" ; Elt "2" "two" } None) @storage ] + - location: 18 (remaining gas: 1039964.594 units remaining) + [ { Elt "1" "one" ; Elt "2" "two" } ] + - location: -1 (remaining gas: 1039964.549 units remaining) + [ { Elt "1" "one" ; Elt "2" "two" } ] + - location: 19 (remaining gas: 1039964.469 units remaining) + [ { Elt "1" "one" ; Elt "2" "two" } + { Elt "1" "one" ; Elt "2" "two" } ] + - location: -1 (remaining gas: 1039964.424 units remaining) + [ { Elt "1" "one" ; Elt "2" "two" } + { Elt "1" "one" ; Elt "2" "two" } ] + - location: 14 (remaining gas: 1039964.424 units remaining) + [ "1" @parameter + { Elt "1" "one" ; Elt "2" "two" } + { Elt "1" "one" ; Elt "2" "two" } ] + - location: 20 (remaining gas: 1039955.562 units remaining) + [ (Some "one") + { Elt "1" "one" ; Elt "2" "two" } ] + - location: 21 (remaining gas: 1039955.492 units remaining) + [ { Elt "1" "one" ; Elt "2" "two" } + (Some "one") ] + - location: 22 (remaining gas: 1039955.417 units remaining) + [ (Pair { Elt "1" "one" ; Elt "2" "two" } (Some "one")) ] + - location: 23 (remaining gas: 1039955.342 units remaining) + [ {} + (Pair { Elt "1" "one" ; Elt "2" "two" } (Some "one")) ] + - location: 25 (remaining gas: 1039955.267 units remaining) + [ (Pair {} { Elt "1" "one" ; Elt "2" "two" } (Some "one")) ] + - location: -1 (remaining gas: 1039955.222 units remaining) + [ (Pair {} { Elt "1" "one" ; Elt "2" "two" } (Some "one")) ] + diff --git "a/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[get_big_map_value.tz-(Pair { Elt \"hello\" \"hi\" } None)-\"\".2fe16a2420.out" "b/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[get_big_map_value.tz-(Pair { Elt \"hello\" \"hi\" } None)-\"\".2fe16a2420.out" new file mode 100644 index 0000000000000000000000000000000000000000..e5790d757d2e354eafee7c3a3cc65d883334dee4 --- /dev/null +++ "b/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[get_big_map_value.tz-(Pair { Elt \"hello\" \"hi\" } None)-\"\".2fe16a2420.out" @@ -0,0 +1,50 @@ +tests_alpha/test_contract_opcodes.py::TestContractOpcodes::test__big_map_contract_io[get_big_map_value.tz-(Pair { Elt "hello" "hi" } None)-""-(Pair 2 None)-big_map_diff1] + +storage + (Pair 2 None) +emitted operations + +big_map diff + New map(2) of type (big_map string string) + Set map(2)["hello"] to "hi" +trace + - location: 11 (remaining gas: 1039970.497 units remaining) + [ (Pair "" { Elt "hello" "hi" } None) ] + - location: 12 (remaining gas: 1039970.417 units remaining) + [ (Pair "" { Elt "hello" "hi" } None) + (Pair "" { Elt "hello" "hi" } None) ] + - location: 13 (remaining gas: 1039970.337 units remaining) + [ "" @parameter + (Pair "" { Elt "hello" "hi" } None) ] + - location: 17 (remaining gas: 1039970.152 units remaining) + [ (Pair { Elt "hello" "hi" } None) @storage ] + - location: 18 (remaining gas: 1039970.072 units remaining) + [ { Elt "hello" "hi" } ] + - location: -1 (remaining gas: 1039970.027 units remaining) + [ { Elt "hello" "hi" } ] + - location: 19 (remaining gas: 1039969.947 units remaining) + [ { Elt "hello" "hi" } + { Elt "hello" "hi" } ] + - location: -1 (remaining gas: 1039969.902 units remaining) + [ { Elt "hello" "hi" } + { Elt "hello" "hi" } ] + - location: 14 (remaining gas: 1039969.902 units remaining) + [ "" @parameter + { Elt "hello" "hi" } + { Elt "hello" "hi" } ] + - location: 20 (remaining gas: 1039961.042 units remaining) + [ None + { Elt "hello" "hi" } ] + - location: 21 (remaining gas: 1039960.972 units remaining) + [ { Elt "hello" "hi" } + None ] + - location: 22 (remaining gas: 1039960.897 units remaining) + [ (Pair { Elt "hello" "hi" } None) ] + - location: 23 (remaining gas: 1039960.822 units remaining) + [ {} + (Pair { Elt "hello" "hi" } None) ] + - location: 25 (remaining gas: 1039960.747 units remaining) + [ (Pair {} { Elt "hello" "hi" } None) ] + - location: -1 (remaining gas: 1039960.702 units remaining) + [ (Pair {} { Elt "hello" "hi" } None) ] + diff --git "a/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[get_big_map_value.tz-(Pair { Elt \"hello\" \"hi\" } None)-\"h.9de65c712d.out" "b/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[get_big_map_value.tz-(Pair { Elt \"hello\" \"hi\" } None)-\"h.9de65c712d.out" new file mode 100644 index 0000000000000000000000000000000000000000..350698218027cf92620d3ae15e6981b92b7a4a96 --- /dev/null +++ "b/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[get_big_map_value.tz-(Pair { Elt \"hello\" \"hi\" } None)-\"h.9de65c712d.out" @@ -0,0 +1,50 @@ +tests_alpha/test_contract_opcodes.py::TestContractOpcodes::test__big_map_contract_io[get_big_map_value.tz-(Pair { Elt "hello" "hi" } None)-"hello"-(Pair 2 (Some "hi"))-big_map_diff0] + +storage + (Pair 2 (Some "hi")) +emitted operations + +big_map diff + New map(2) of type (big_map string string) + Set map(2)["hello"] to "hi" +trace + - location: 11 (remaining gas: 1039970.447 units remaining) + [ (Pair "hello" { Elt "hello" "hi" } None) ] + - location: 12 (remaining gas: 1039970.367 units remaining) + [ (Pair "hello" { Elt "hello" "hi" } None) + (Pair "hello" { Elt "hello" "hi" } None) ] + - location: 13 (remaining gas: 1039970.287 units remaining) + [ "hello" @parameter + (Pair "hello" { Elt "hello" "hi" } None) ] + - location: 17 (remaining gas: 1039970.102 units remaining) + [ (Pair { Elt "hello" "hi" } None) @storage ] + - location: 18 (remaining gas: 1039970.022 units remaining) + [ { Elt "hello" "hi" } ] + - location: -1 (remaining gas: 1039969.977 units remaining) + [ { Elt "hello" "hi" } ] + - location: 19 (remaining gas: 1039969.897 units remaining) + [ { Elt "hello" "hi" } + { Elt "hello" "hi" } ] + - location: -1 (remaining gas: 1039969.852 units remaining) + [ { Elt "hello" "hi" } + { Elt "hello" "hi" } ] + - location: 14 (remaining gas: 1039969.852 units remaining) + [ "hello" @parameter + { Elt "hello" "hi" } + { Elt "hello" "hi" } ] + - location: 20 (remaining gas: 1039956.986 units remaining) + [ (Some "hi") + { Elt "hello" "hi" } ] + - location: 21 (remaining gas: 1039956.916 units remaining) + [ { Elt "hello" "hi" } + (Some "hi") ] + - location: 22 (remaining gas: 1039956.841 units remaining) + [ (Pair { Elt "hello" "hi" } (Some "hi")) ] + - location: 23 (remaining gas: 1039956.766 units remaining) + [ {} + (Pair { Elt "hello" "hi" } (Some "hi")) ] + - location: 25 (remaining gas: 1039956.691 units remaining) + [ (Pair {} { Elt "hello" "hi" } (Some "hi")) ] + - location: -1 (remaining gas: 1039956.646 units remaining) + [ (Pair {} { Elt "hello" "hi" } (Some "hi")) ] + diff --git "a/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[update_big_map.tz-(Pair { Elt \"1\" \"one\" ; Elt \"2\" \"two\" .1dee6b3dbf.out" "b/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[update_big_map.tz-(Pair { Elt \"1\" \"one\" ; Elt \"2\" \"two\" .1dee6b3dbf.out" new file mode 100644 index 0000000000000000000000000000000000000000..68c555cd1f650156d5f8c8dcf7883b499fe2fcef --- /dev/null +++ "b/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[update_big_map.tz-(Pair { Elt \"1\" \"one\" ; Elt \"2\" \"two\" .1dee6b3dbf.out" @@ -0,0 +1,54 @@ +tests_alpha/test_contract_opcodes.py::TestContractOpcodes::test__big_map_contract_io[update_big_map.tz-(Pair { Elt "1" "one" ; Elt "2" "two" } Unit)-{ Elt "1" (Some "two") }-(Pair 2 Unit)-big_map_diff4] + +storage + (Pair 2 Unit) +emitted operations + +big_map diff + New map(2) of type (big_map string string) + Set map(2)["2"] to "two" + Set map(2)["1"] to "two" +trace + - location: 13 (remaining gas: 1039966.975 units remaining) + [ (Pair { Elt "1" (Some "two") } { Elt "1" "one" ; Elt "2" "two" } Unit) ] + - location: 15 (remaining gas: 1039966.865 units remaining) + [ { Elt "1" (Some "two") } @parameter + (Pair { Elt "1" "one" ; Elt "2" "two" } Unit) @storage ] + - location: 18 (remaining gas: 1039966.710 units remaining) + [ { Elt "1" "one" ; Elt "2" "two" } + Unit ] + - location: 17 (remaining gas: 1039966.665 units remaining) + [ { Elt "1" "one" ; Elt "2" "two" } + Unit ] + - location: 16 (remaining gas: 1039966.665 units remaining) + [ { Elt "1" (Some "two") } @parameter + { Elt "1" "one" ; Elt "2" "two" } + Unit ] + - location: -1 (remaining gas: 1039966.620 units remaining) + [ { Elt "1" (Some "two") } @parameter + { Elt "1" "one" ; Elt "2" "two" } + Unit ] + - location: 21 (remaining gas: 1039966.390 units remaining) + [ "1" @key + (Some "two") @elt + { Elt "1" "one" ; Elt "2" "two" } + Unit ] + - location: 22 (remaining gas: 1039957.522 units remaining) + [ { Elt "1" "two" ; Elt "2" "two" } + Unit ] + - location: -1 (remaining gas: 1039957.477 units remaining) + [ { Elt "1" "two" ; Elt "2" "two" } + Unit ] + - location: 19 (remaining gas: 1039957.477 units remaining) + [ { Elt "1" "two" ; Elt "2" "two" } + Unit ] + - location: 23 (remaining gas: 1039957.402 units remaining) + [ (Pair { Elt "1" "two" ; Elt "2" "two" } Unit) ] + - location: 24 (remaining gas: 1039957.327 units remaining) + [ {} + (Pair { Elt "1" "two" ; Elt "2" "two" } Unit) ] + - location: 26 (remaining gas: 1039957.252 units remaining) + [ (Pair {} { Elt "1" "two" ; Elt "2" "two" } Unit) ] + - location: -1 (remaining gas: 1039957.207 units remaining) + [ (Pair {} { Elt "1" "two" ; Elt "2" "two" } Unit) ] + diff --git "a/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[update_big_map.tz-(Pair { Elt \"1\" \"one\" ; Elt \"2\" \"two\" .590c060653.out" "b/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[update_big_map.tz-(Pair { Elt \"1\" \"one\" ; Elt \"2\" \"two\" .590c060653.out" new file mode 100644 index 0000000000000000000000000000000000000000..656550a8eed85f03c70b449692df522e87b56908 --- /dev/null +++ "b/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[update_big_map.tz-(Pair { Elt \"1\" \"one\" ; Elt \"2\" \"two\" .590c060653.out" @@ -0,0 +1,54 @@ +tests_alpha/test_contract_opcodes.py::TestContractOpcodes::test__big_map_contract_io[update_big_map.tz-(Pair { Elt "1" "one" ; Elt "2" "two" } Unit)-{ Elt "1" (Some "two") }-(Pair 2 Unit)-big_map_diff8] + +storage + (Pair 2 Unit) +emitted operations + +big_map diff + New map(2) of type (big_map string string) + Set map(2)["2"] to "two" + Set map(2)["1"] to "two" +trace + - location: 13 (remaining gas: 1039966.975 units remaining) + [ (Pair { Elt "1" (Some "two") } { Elt "1" "one" ; Elt "2" "two" } Unit) ] + - location: 15 (remaining gas: 1039966.865 units remaining) + [ { Elt "1" (Some "two") } @parameter + (Pair { Elt "1" "one" ; Elt "2" "two" } Unit) @storage ] + - location: 18 (remaining gas: 1039966.710 units remaining) + [ { Elt "1" "one" ; Elt "2" "two" } + Unit ] + - location: 17 (remaining gas: 1039966.665 units remaining) + [ { Elt "1" "one" ; Elt "2" "two" } + Unit ] + - location: 16 (remaining gas: 1039966.665 units remaining) + [ { Elt "1" (Some "two") } @parameter + { Elt "1" "one" ; Elt "2" "two" } + Unit ] + - location: -1 (remaining gas: 1039966.620 units remaining) + [ { Elt "1" (Some "two") } @parameter + { Elt "1" "one" ; Elt "2" "two" } + Unit ] + - location: 21 (remaining gas: 1039966.390 units remaining) + [ "1" @key + (Some "two") @elt + { Elt "1" "one" ; Elt "2" "two" } + Unit ] + - location: 22 (remaining gas: 1039957.522 units remaining) + [ { Elt "1" "two" ; Elt "2" "two" } + Unit ] + - location: -1 (remaining gas: 1039957.477 units remaining) + [ { Elt "1" "two" ; Elt "2" "two" } + Unit ] + - location: 19 (remaining gas: 1039957.477 units remaining) + [ { Elt "1" "two" ; Elt "2" "two" } + Unit ] + - location: 23 (remaining gas: 1039957.402 units remaining) + [ (Pair { Elt "1" "two" ; Elt "2" "two" } Unit) ] + - location: 24 (remaining gas: 1039957.327 units remaining) + [ {} + (Pair { Elt "1" "two" ; Elt "2" "two" } Unit) ] + - location: 26 (remaining gas: 1039957.252 units remaining) + [ (Pair {} { Elt "1" "two" ; Elt "2" "two" } Unit) ] + - location: -1 (remaining gas: 1039957.207 units remaining) + [ (Pair {} { Elt "1" "two" ; Elt "2" "two" } Unit) ] + diff --git "a/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[update_big_map.tz-(Pair { Elt \"1\" \"one\" ; Elt \"2\" \"two\" .85f2ff1a40.out" "b/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[update_big_map.tz-(Pair { Elt \"1\" \"one\" ; Elt \"2\" \"two\" .85f2ff1a40.out" new file mode 100644 index 0000000000000000000000000000000000000000..70366c8517e4dc569bf2f36c471851a502a362fc --- /dev/null +++ "b/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[update_big_map.tz-(Pair { Elt \"1\" \"one\" ; Elt \"2\" \"two\" .85f2ff1a40.out" @@ -0,0 +1,55 @@ +tests_alpha/test_contract_opcodes.py::TestContractOpcodes::test__big_map_contract_io[update_big_map.tz-(Pair { Elt "1" "one" ; Elt "2" "two" } Unit)-{ Elt "3" None }-(Pair 2 Unit)-big_map_diff6] + +storage + (Pair 2 Unit) +emitted operations + +big_map diff + New map(2) of type (big_map string string) + Set map(2)["2"] to "two" + Unset map(2)["3"] + Set map(2)["1"] to "one" +trace + - location: 13 (remaining gas: 1039967.259 units remaining) + [ (Pair { Elt "3" None } { Elt "1" "one" ; Elt "2" "two" } Unit) ] + - location: 15 (remaining gas: 1039967.149 units remaining) + [ { Elt "3" None } @parameter + (Pair { Elt "1" "one" ; Elt "2" "two" } Unit) @storage ] + - location: 18 (remaining gas: 1039966.994 units remaining) + [ { Elt "1" "one" ; Elt "2" "two" } + Unit ] + - location: 17 (remaining gas: 1039966.949 units remaining) + [ { Elt "1" "one" ; Elt "2" "two" } + Unit ] + - location: 16 (remaining gas: 1039966.949 units remaining) + [ { Elt "3" None } @parameter + { Elt "1" "one" ; Elt "2" "two" } + Unit ] + - location: -1 (remaining gas: 1039966.904 units remaining) + [ { Elt "3" None } @parameter + { Elt "1" "one" ; Elt "2" "two" } + Unit ] + - location: 21 (remaining gas: 1039966.674 units remaining) + [ "3" @key + None @elt + { Elt "1" "one" ; Elt "2" "two" } + Unit ] + - location: 22 (remaining gas: 1039957.806 units remaining) + [ { Elt "1" "one" ; Elt "2" "two" } + Unit ] + - location: -1 (remaining gas: 1039957.761 units remaining) + [ { Elt "1" "one" ; Elt "2" "two" } + Unit ] + - location: 19 (remaining gas: 1039957.761 units remaining) + [ { Elt "1" "one" ; Elt "2" "two" } + Unit ] + - location: 23 (remaining gas: 1039957.686 units remaining) + [ (Pair { Elt "1" "one" ; Elt "2" "two" } Unit) ] + - location: 24 (remaining gas: 1039957.611 units remaining) + [ {} + (Pair { Elt "1" "one" ; Elt "2" "two" } Unit) ] + - location: 26 (remaining gas: 1039957.536 units remaining) + [ (Pair {} { Elt "1" "one" ; Elt "2" "two" } Unit) ] + - location: -1 (remaining gas: 1039957.491 units remaining) + [ (Pair {} { Elt "1" "one" ; Elt "2" "two" } Unit) ] + diff --git "a/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[update_big_map.tz-(Pair { Elt \"1\" \"one\" ; Elt \"2\" \"two\" .bc065fddfe.out" "b/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[update_big_map.tz-(Pair { Elt \"1\" \"one\" ; Elt \"2\" \"two\" .bc065fddfe.out" new file mode 100644 index 0000000000000000000000000000000000000000..00810e4f533a6c7869356feb3a0cdfcd211479b5 --- /dev/null +++ "b/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[update_big_map.tz-(Pair { Elt \"1\" \"one\" ; Elt \"2\" \"two\" .bc065fddfe.out" @@ -0,0 +1,54 @@ +tests_alpha/test_contract_opcodes.py::TestContractOpcodes::test__big_map_contract_io[update_big_map.tz-(Pair { Elt "1" "one" ; Elt "2" "two" } Unit)-{ Elt "2" None }-(Pair 2 Unit)-big_map_diff7] + +storage + (Pair 2 Unit) +emitted operations + +big_map diff + New map(2) of type (big_map string string) + Unset map(2)["2"] + Set map(2)["1"] to "one" +trace + - location: 13 (remaining gas: 1039967.259 units remaining) + [ (Pair { Elt "2" None } { Elt "1" "one" ; Elt "2" "two" } Unit) ] + - location: 15 (remaining gas: 1039967.149 units remaining) + [ { Elt "2" None } @parameter + (Pair { Elt "1" "one" ; Elt "2" "two" } Unit) @storage ] + - location: 18 (remaining gas: 1039966.994 units remaining) + [ { Elt "1" "one" ; Elt "2" "two" } + Unit ] + - location: 17 (remaining gas: 1039966.949 units remaining) + [ { Elt "1" "one" ; Elt "2" "two" } + Unit ] + - location: 16 (remaining gas: 1039966.949 units remaining) + [ { Elt "2" None } @parameter + { Elt "1" "one" ; Elt "2" "two" } + Unit ] + - location: -1 (remaining gas: 1039966.904 units remaining) + [ { Elt "2" None } @parameter + { Elt "1" "one" ; Elt "2" "two" } + Unit ] + - location: 21 (remaining gas: 1039966.674 units remaining) + [ "2" @key + None @elt + { Elt "1" "one" ; Elt "2" "two" } + Unit ] + - location: 22 (remaining gas: 1039957.806 units remaining) + [ { Elt "1" "one" } + Unit ] + - location: -1 (remaining gas: 1039957.761 units remaining) + [ { Elt "1" "one" } + Unit ] + - location: 19 (remaining gas: 1039957.761 units remaining) + [ { Elt "1" "one" } + Unit ] + - location: 23 (remaining gas: 1039957.686 units remaining) + [ (Pair { Elt "1" "one" } Unit) ] + - location: 24 (remaining gas: 1039957.611 units remaining) + [ {} + (Pair { Elt "1" "one" } Unit) ] + - location: 26 (remaining gas: 1039957.536 units remaining) + [ (Pair {} { Elt "1" "one" } Unit) ] + - location: -1 (remaining gas: 1039957.491 units remaining) + [ (Pair {} { Elt "1" "one" } Unit) ] + diff --git "a/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[update_big_map.tz-(Pair { Elt \"1\" \"one\" ; Elt \"2\" \"two\" .c83cecb062.out" "b/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[update_big_map.tz-(Pair { Elt \"1\" \"one\" ; Elt \"2\" \"two\" .c83cecb062.out" new file mode 100644 index 0000000000000000000000000000000000000000..d02a1b139c49b245db82983608427a7e67412ce0 --- /dev/null +++ "b/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[update_big_map.tz-(Pair { Elt \"1\" \"one\" ; Elt \"2\" \"two\" .c83cecb062.out" @@ -0,0 +1,43 @@ +tests_alpha/test_contract_opcodes.py::TestContractOpcodes::test__big_map_contract_io[update_big_map.tz-(Pair { Elt "1" "one" ; Elt "2" "two" } Unit)-{}-(Pair 2 Unit)-big_map_diff3] + +storage + (Pair 2 Unit) +emitted operations + +big_map diff + New map(2) of type (big_map string string) + Set map(2)["2"] to "two" + Set map(2)["1"] to "one" +trace + - location: 13 (remaining gas: 1039967.843 units remaining) + [ (Pair {} { Elt "1" "one" ; Elt "2" "two" } Unit) ] + - location: 15 (remaining gas: 1039967.733 units remaining) + [ {} @parameter + (Pair { Elt "1" "one" ; Elt "2" "two" } Unit) @storage ] + - location: 18 (remaining gas: 1039967.578 units remaining) + [ { Elt "1" "one" ; Elt "2" "two" } + Unit ] + - location: 17 (remaining gas: 1039967.533 units remaining) + [ { Elt "1" "one" ; Elt "2" "two" } + Unit ] + - location: 16 (remaining gas: 1039967.533 units remaining) + [ {} @parameter + { Elt "1" "one" ; Elt "2" "two" } + Unit ] + - location: -1 (remaining gas: 1039967.488 units remaining) + [ {} @parameter + { Elt "1" "one" ; Elt "2" "two" } + Unit ] + - location: 19 (remaining gas: 1039967.378 units remaining) + [ { Elt "1" "one" ; Elt "2" "two" } + Unit ] + - location: 23 (remaining gas: 1039967.303 units remaining) + [ (Pair { Elt "1" "one" ; Elt "2" "two" } Unit) ] + - location: 24 (remaining gas: 1039967.228 units remaining) + [ {} + (Pair { Elt "1" "one" ; Elt "2" "two" } Unit) ] + - location: 26 (remaining gas: 1039967.153 units remaining) + [ (Pair {} { Elt "1" "one" ; Elt "2" "two" } Unit) ] + - location: -1 (remaining gas: 1039967.108 units remaining) + [ (Pair {} { Elt "1" "one" ; Elt "2" "two" } Unit) ] + diff --git "a/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[update_big_map.tz-(Pair { Elt \"1\" \"one\" ; Elt \"2\" \"two\" .d78cba5123.out" "b/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[update_big_map.tz-(Pair { Elt \"1\" \"one\" ; Elt \"2\" \"two\" .d78cba5123.out" new file mode 100644 index 0000000000000000000000000000000000000000..129892bb12028999414373654343bdab097aaa60 --- /dev/null +++ "b/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test__big_map_contract_io[update_big_map.tz-(Pair { Elt \"1\" \"one\" ; Elt \"2\" \"two\" .d78cba5123.out" @@ -0,0 +1,55 @@ +tests_alpha/test_contract_opcodes.py::TestContractOpcodes::test__big_map_contract_io[update_big_map.tz-(Pair { Elt "1" "one" ; Elt "2" "two" } Unit)-{ Elt "3" (Some "three") }-(Pair 2 Unit)-big_map_diff5] + +storage + (Pair 2 Unit) +emitted operations + +big_map diff + New map(2) of type (big_map string string) + Set map(2)["2"] to "two" + Set map(2)["3"] to "three" + Set map(2)["1"] to "one" +trace + - location: 13 (remaining gas: 1039966.955 units remaining) + [ (Pair { Elt "3" (Some "three") } { Elt "1" "one" ; Elt "2" "two" } Unit) ] + - location: 15 (remaining gas: 1039966.845 units remaining) + [ { Elt "3" (Some "three") } @parameter + (Pair { Elt "1" "one" ; Elt "2" "two" } Unit) @storage ] + - location: 18 (remaining gas: 1039966.690 units remaining) + [ { Elt "1" "one" ; Elt "2" "two" } + Unit ] + - location: 17 (remaining gas: 1039966.645 units remaining) + [ { Elt "1" "one" ; Elt "2" "two" } + Unit ] + - location: 16 (remaining gas: 1039966.645 units remaining) + [ { Elt "3" (Some "three") } @parameter + { Elt "1" "one" ; Elt "2" "two" } + Unit ] + - location: -1 (remaining gas: 1039966.600 units remaining) + [ { Elt "3" (Some "three") } @parameter + { Elt "1" "one" ; Elt "2" "two" } + Unit ] + - location: 21 (remaining gas: 1039966.370 units remaining) + [ "3" @key + (Some "three") @elt + { Elt "1" "one" ; Elt "2" "two" } + Unit ] + - location: 22 (remaining gas: 1039957.502 units remaining) + [ { Elt "1" "one" ; Elt "2" "two" ; Elt "3" "three" } + Unit ] + - location: -1 (remaining gas: 1039957.457 units remaining) + [ { Elt "1" "one" ; Elt "2" "two" ; Elt "3" "three" } + Unit ] + - location: 19 (remaining gas: 1039957.457 units remaining) + [ { Elt "1" "one" ; Elt "2" "two" ; Elt "3" "three" } + Unit ] + - location: 23 (remaining gas: 1039957.382 units remaining) + [ (Pair { Elt "1" "one" ; Elt "2" "two" ; Elt "3" "three" } Unit) ] + - location: 24 (remaining gas: 1039957.307 units remaining) + [ {} + (Pair { Elt "1" "one" ; Elt "2" "two" ; Elt "3" "three" } Unit) ] + - location: 26 (remaining gas: 1039957.232 units remaining) + [ (Pair {} { Elt "1" "one" ; Elt "2" "two" ; Elt "3" "three" } Unit) ] + - location: -1 (remaining gas: 1039957.187 units remaining) + [ (Pair {} { Elt "1" "one" ; Elt "2" "two" ; Elt "3" "three" } Unit) ] + diff --git "a/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_big_map_magic[(Left (Pair { Elt \"1\" \"one\" } { Elt \"2\" \"two\" }) )-(Right (Righ.3789a260e7.out" "b/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_big_map_magic[(Left (Pair { Elt \"1\" \"one\" } { Elt \"2\" \"two\" }) )-(Right (Righ.3789a260e7.out" new file mode 100644 index 0000000000000000000000000000000000000000..222592f4c61929a2324ad86441f3f26c1fa47794 --- /dev/null +++ "b/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_big_map_magic[(Left (Pair { Elt \"1\" \"one\" } { Elt \"2\" \"two\" }) )-(Right (Righ.3789a260e7.out" @@ -0,0 +1,80 @@ +tests_alpha/test_contract_opcodes.py::TestContractOpcodes::test_big_map_magic[(Left (Pair { Elt "1" "one" } { Elt "2" "two" }) )-(Right (Right (Right (Left { Pair "3" "three" }))))-(Left (Pair 2 3))-big_map_diff4] + +storage + (Left (Pair 2 3)) +emitted operations + +big_map diff + New map(3) of type (big_map string string) + Set map(3)["2"] to "two" + New map(2) of type (big_map string string) + Set map(2)["3"] to "three" + Set map(2)["1"] to "one" +trace + - location: 42 (remaining gas: 1039903.779 units remaining) + [ (Pair (Right (Right (Right (Left { Pair "3" "three" })))) + (Left (Pair { Elt "1" "one" } { Elt "2" "two" }))) ] + - location: 43 (remaining gas: 1039903.699 units remaining) + [ (Right (Right (Right (Left { Pair "3" "three" })))) @parameter + (Left (Pair { Elt "1" "one" } { Elt "2" "two" })) @storage ] + - location: 114 (remaining gas: 1039903.249 units remaining) + [ (Pair { Elt "1" "one" } { Elt "2" "two" }) @storage.left ] + - location: 112 (remaining gas: 1039903.204 units remaining) + [ (Pair { Elt "1" "one" } { Elt "2" "two" }) @storage.left ] + - location: 119 (remaining gas: 1039903.124 units remaining) + [ { Elt "1" "one" } + { Elt "2" "two" } ] + - location: -1 (remaining gas: 1039903.079 units remaining) + [ { Elt "1" "one" } + { Elt "2" "two" } ] + - location: 110 (remaining gas: 1039903.079 units remaining) + [ { Pair "3" "three" } @parameter.right.right.right.add + { Elt "1" "one" } + { Elt "2" "two" } ] + - location: 122 (remaining gas: 1039902.462 units remaining) + [ "3" + "three" + { Elt "1" "one" } + { Elt "2" "two" } ] + - location: 125 (remaining gas: 1039902.312 units remaining) + [ (Some "three") + { Elt "1" "one" } + { Elt "2" "two" } ] + - location: 124 (remaining gas: 1039902.267 units remaining) + [ (Some "three") + { Elt "1" "one" } + { Elt "2" "two" } ] + - location: 123 (remaining gas: 1039902.267 units remaining) + [ "3" + (Some "three") + { Elt "1" "one" } + { Elt "2" "two" } ] + - location: 126 (remaining gas: 1039893.402 units remaining) + [ { Elt "1" "one" ; Elt "3" "three" } + { Elt "2" "two" } ] + - location: -1 (remaining gas: 1039893.357 units remaining) + [ { Elt "1" "one" ; Elt "3" "three" } + { Elt "2" "two" } ] + - location: 120 (remaining gas: 1039893.357 units remaining) + [ { Elt "1" "one" ; Elt "3" "three" } + { Elt "2" "two" } ] + - location: 127 (remaining gas: 1039893.282 units remaining) + [ (Pair { Elt "1" "one" ; Elt "3" "three" } { Elt "2" "two" }) ] + - location: 128 (remaining gas: 1039893.207 units remaining) + [ (Left (Pair { Elt "1" "one" ; Elt "3" "three" } { Elt "2" "two" })) ] + - location: -1 (remaining gas: 1039893.162 units remaining) + [ (Left (Pair { Elt "1" "one" ; Elt "3" "three" } { Elt "2" "two" })) ] + - location: 107 (remaining gas: 1039893.117 units remaining) + [ (Left (Pair { Elt "1" "one" ; Elt "3" "three" } { Elt "2" "two" })) ] + - location: 64 (remaining gas: 1039893.072 units remaining) + [ (Left (Pair { Elt "1" "one" ; Elt "3" "three" } { Elt "2" "two" })) ] + - location: 59 (remaining gas: 1039893.027 units remaining) + [ (Left (Pair { Elt "1" "one" ; Elt "3" "three" } { Elt "2" "two" })) ] + - location: 151 (remaining gas: 1039892.952 units remaining) + [ {} + (Left (Pair { Elt "1" "one" ; Elt "3" "three" } { Elt "2" "two" })) ] + - location: 153 (remaining gas: 1039892.877 units remaining) + [ (Pair {} (Left (Pair { Elt "1" "one" ; Elt "3" "three" } { Elt "2" "two" }))) ] + - location: -1 (remaining gas: 1039892.832 units remaining) + [ (Pair {} (Left (Pair { Elt "1" "one" ; Elt "3" "three" } { Elt "2" "two" }))) ] + diff --git "a/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_big_map_magic[(Left (Pair { Elt \"1\" \"one\" } { Elt \"2\" \"two\" }))-(Left Unit)-(.1fc7748f5b.out" "b/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_big_map_magic[(Left (Pair { Elt \"1\" \"one\" } { Elt \"2\" \"two\" }))-(Left Unit)-(.1fc7748f5b.out" new file mode 100644 index 0000000000000000000000000000000000000000..52e8833a6f41915a9e9a6046af8f166f780623c8 --- /dev/null +++ "b/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_big_map_magic[(Left (Pair { Elt \"1\" \"one\" } { Elt \"2\" \"two\" }))-(Left Unit)-(.1fc7748f5b.out" @@ -0,0 +1,43 @@ +tests_alpha/test_contract_opcodes.py::TestContractOpcodes::test_big_map_magic[(Left (Pair { Elt "1" "one" } { Elt "2" "two" }))-(Left Unit)-(Left (Pair 2 3))-big_map_diff0] + +storage + (Left (Pair 2 3)) +emitted operations + +big_map diff + New map(3) of type (big_map string string) + Set map(3)["1"] to "one" + New map(2) of type (big_map string string) + Set map(2)["2"] to "two" +trace + - location: 42 (remaining gas: 1039905.682 units remaining) + [ (Pair (Left Unit) (Left (Pair { Elt "1" "one" } { Elt "2" "two" }))) ] + - location: 43 (remaining gas: 1039905.602 units remaining) + [ (Left Unit) @parameter + (Left (Pair { Elt "1" "one" } { Elt "2" "two" })) @storage ] + - location: 46 (remaining gas: 1039905.467 units remaining) + [ (Left (Pair { Elt "1" "one" } { Elt "2" "two" })) @storage ] + - location: 49 (remaining gas: 1039905.332 units remaining) + [ (Pair { Elt "1" "one" } { Elt "2" "two" }) @storage.left ] + - location: 47 (remaining gas: 1039905.287 units remaining) + [ (Pair { Elt "1" "one" } { Elt "2" "two" }) @storage.left ] + - location: 54 (remaining gas: 1039905.207 units remaining) + [ { Elt "1" "one" } + { Elt "2" "two" } ] + - location: 55 (remaining gas: 1039905.137 units remaining) + [ { Elt "2" "two" } + { Elt "1" "one" } ] + - location: 56 (remaining gas: 1039905.062 units remaining) + [ (Pair { Elt "2" "two" } { Elt "1" "one" }) ] + - location: 57 (remaining gas: 1039904.987 units remaining) + [ (Left (Pair { Elt "2" "two" } { Elt "1" "one" })) ] + - location: -1 (remaining gas: 1039904.942 units remaining) + [ (Left (Pair { Elt "2" "two" } { Elt "1" "one" })) ] + - location: 151 (remaining gas: 1039904.867 units remaining) + [ {} + (Left (Pair { Elt "2" "two" } { Elt "1" "one" })) ] + - location: 153 (remaining gas: 1039904.792 units remaining) + [ (Pair {} (Left (Pair { Elt "2" "two" } { Elt "1" "one" }))) ] + - location: -1 (remaining gas: 1039904.747 units remaining) + [ (Pair {} (Left (Pair { Elt "2" "two" } { Elt "1" "one" }))) ] + diff --git "a/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_big_map_magic[(Left (Pair { Elt \"1\" \"one\" } { Elt \"2\" \"two\" }))-(Right (Left .45ba7bbe6e.out" "b/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_big_map_magic[(Left (Pair { Elt \"1\" \"one\" } { Elt \"2\" \"two\" }))-(Right (Left .45ba7bbe6e.out" new file mode 100644 index 0000000000000000000000000000000000000000..8f5f8ad4a9e28d33c4a40829f929aaa20c8b8d3f --- /dev/null +++ "b/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_big_map_magic[(Left (Pair { Elt \"1\" \"one\" } { Elt \"2\" \"two\" }))-(Right (Left .45ba7bbe6e.out" @@ -0,0 +1,35 @@ +tests_alpha/test_contract_opcodes.py::TestContractOpcodes::test_big_map_magic[(Left (Pair { Elt "1" "one" } { Elt "2" "two" }))-(Right (Left (Left (Pair { Elt "3" "three" } { Elt "4" "four" }))))-(Left (Pair 2 3))-big_map_diff1] + +storage + (Left (Pair 2 3)) +emitted operations + +big_map diff + New map(3) of type (big_map string string) + Set map(3)["4"] to "four" + New map(2) of type (big_map string string) + Set map(2)["3"] to "three" +trace + - location: 42 (remaining gas: 1039884.434 units remaining) + [ (Pair (Right (Left (Left (Pair { Elt "3" "three" } { Elt "4" "four" })))) + (Left (Pair { Elt "1" "one" } { Elt "2" "two" }))) ] + - location: 43 (remaining gas: 1039884.354 units remaining) + [ (Right (Left (Left (Pair { Elt "3" "three" } { Elt "4" "four" })))) @parameter + (Left (Pair { Elt "1" "one" } { Elt "2" "two" })) @storage ] + - location: 62 (remaining gas: 1039884.164 units remaining) + [ (Left (Pair { Elt "1" "one" } { Elt "2" "two" })) @storage + (Left (Pair { Elt "3" "three" } { Elt "4" "four" })) @parameter.right.reset ] + - location: 63 (remaining gas: 1039884.089 units remaining) + [ (Left (Pair { Elt "3" "three" } { Elt "4" "four" })) @parameter.right.reset ] + - location: -1 (remaining gas: 1039884.044 units remaining) + [ (Left (Pair { Elt "3" "three" } { Elt "4" "four" })) @parameter.right.reset ] + - location: 59 (remaining gas: 1039883.999 units remaining) + [ (Left (Pair { Elt "3" "three" } { Elt "4" "four" })) ] + - location: 151 (remaining gas: 1039883.924 units remaining) + [ {} + (Left (Pair { Elt "3" "three" } { Elt "4" "four" })) ] + - location: 153 (remaining gas: 1039883.849 units remaining) + [ (Pair {} (Left (Pair { Elt "3" "three" } { Elt "4" "four" }))) ] + - location: -1 (remaining gas: 1039883.804 units remaining) + [ (Pair {} (Left (Pair { Elt "3" "three" } { Elt "4" "four" }))) ] + diff --git "a/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_big_map_magic[(Left (Pair { Elt \"1\" \"one\" } { Elt \"2\" \"two\" }))-(Right (Right.b11b9d15f4.out" "b/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_big_map_magic[(Left (Pair { Elt \"1\" \"one\" } { Elt \"2\" \"two\" }))-(Right (Right.b11b9d15f4.out" new file mode 100644 index 0000000000000000000000000000000000000000..a9412d32a3d09fecb927d0a4c2e5998b7922d86d --- /dev/null +++ "b/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_big_map_magic[(Left (Pair { Elt \"1\" \"one\" } { Elt \"2\" \"two\" }))-(Right (Right.b11b9d15f4.out" @@ -0,0 +1,74 @@ +tests_alpha/test_contract_opcodes.py::TestContractOpcodes::test_big_map_magic[(Left (Pair { Elt "1" "one" } { Elt "2" "two" }))-(Right (Right (Right (Right { "1" }))))-(Left (Pair 2 3))-big_map_diff5] + +storage + (Left (Pair 2 3)) +emitted operations + +big_map diff + New map(3) of type (big_map string string) + Set map(3)["2"] to "two" + New map(2) of type (big_map string string) + Unset map(2)["1"] +trace + - location: 42 (remaining gas: 1039904.323 units remaining) + [ (Pair (Right (Right (Right (Right { "1" })))) + (Left (Pair { Elt "1" "one" } { Elt "2" "two" }))) ] + - location: 43 (remaining gas: 1039904.243 units remaining) + [ (Right (Right (Right (Right { "1" })))) @parameter + (Left (Pair { Elt "1" "one" } { Elt "2" "two" })) @storage ] + - location: 135 (remaining gas: 1039903.793 units remaining) + [ (Pair { Elt "1" "one" } { Elt "2" "two" }) @storage.left ] + - location: 133 (remaining gas: 1039903.748 units remaining) + [ (Pair { Elt "1" "one" } { Elt "2" "two" }) @storage.left ] + - location: 140 (remaining gas: 1039903.668 units remaining) + [ { Elt "1" "one" } + { Elt "2" "two" } ] + - location: -1 (remaining gas: 1039903.623 units remaining) + [ { Elt "1" "one" } + { Elt "2" "two" } ] + - location: 131 (remaining gas: 1039903.623 units remaining) + [ { "1" } @parameter.right.right.right.rem + { Elt "1" "one" } + { Elt "2" "two" } ] + - location: 145 (remaining gas: 1039902.936 units remaining) + [ None + { Elt "1" "one" } + { Elt "2" "two" } ] + - location: 144 (remaining gas: 1039902.891 units remaining) + [ None + { Elt "1" "one" } + { Elt "2" "two" } ] + - location: 143 (remaining gas: 1039902.891 units remaining) + [ "1" @parameter.right.right.right.rem.elt + None + { Elt "1" "one" } + { Elt "2" "two" } ] + - location: 147 (remaining gas: 1039894.026 units remaining) + [ {} + { Elt "2" "two" } ] + - location: -1 (remaining gas: 1039893.981 units remaining) + [ {} + { Elt "2" "two" } ] + - location: 141 (remaining gas: 1039893.981 units remaining) + [ {} + { Elt "2" "two" } ] + - location: 148 (remaining gas: 1039893.906 units remaining) + [ (Pair {} { Elt "2" "two" }) ] + - location: 149 (remaining gas: 1039893.831 units remaining) + [ (Left (Pair {} { Elt "2" "two" })) ] + - location: -1 (remaining gas: 1039893.786 units remaining) + [ (Left (Pair {} { Elt "2" "two" })) ] + - location: 107 (remaining gas: 1039893.741 units remaining) + [ (Left (Pair {} { Elt "2" "two" })) ] + - location: 64 (remaining gas: 1039893.696 units remaining) + [ (Left (Pair {} { Elt "2" "two" })) ] + - location: 59 (remaining gas: 1039893.651 units remaining) + [ (Left (Pair {} { Elt "2" "two" })) ] + - location: 151 (remaining gas: 1039893.576 units remaining) + [ {} + (Left (Pair {} { Elt "2" "two" })) ] + - location: 153 (remaining gas: 1039893.501 units remaining) + [ (Pair {} (Left (Pair {} { Elt "2" "two" }))) ] + - location: -1 (remaining gas: 1039893.456 units remaining) + [ (Pair {} (Left (Pair {} { Elt "2" "two" }))) ] + diff --git "a/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_big_map_magic[(Right Unit)-(Right (Right (Left (Pair { Pair \"foo\" \"bar\" } { P.4cc6d15be9.out" "b/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_big_map_magic[(Right Unit)-(Right (Right (Left (Pair { Pair \"foo\" \"bar\" } { P.4cc6d15be9.out" new file mode 100644 index 0000000000000000000000000000000000000000..99bb61491df248c276d92efa2dd6c7a4fb0c1289 --- /dev/null +++ "b/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_big_map_magic[(Right Unit)-(Right (Right (Left (Pair { Pair \"foo\" \"bar\" } { P.4cc6d15be9.out" @@ -0,0 +1,128 @@ +tests_alpha/test_contract_opcodes.py::TestContractOpcodes::test_big_map_magic[(Right Unit)-(Right (Right (Left (Pair { Pair "foo" "bar" } { Pair "gaz" "baz" }) )))-(Left (Pair 2 3))-big_map_diff3] + +storage + (Left (Pair 2 3)) +emitted operations + +big_map diff + New map(3) of type (big_map string string) + Set map(3)["gaz"] to "baz" + New map(2) of type (big_map string string) + Set map(2)["foo"] to "bar" +trace + - location: 42 (remaining gas: 1039922.719 units remaining) + [ (Pair (Right (Right (Left (Pair { Pair "foo" "bar" } { Pair "gaz" "baz" })))) (Right Unit)) ] + - location: 43 (remaining gas: 1039922.639 units remaining) + [ (Right (Right (Left (Pair { Pair "foo" "bar" } { Pair "gaz" "baz" })))) @parameter + (Right Unit) @storage ] + - location: 75 (remaining gas: 1039922.249 units remaining) + [ Unit @storage.right ] + - location: 69 (remaining gas: 1039922.204 units remaining) + [ Unit @storage.right ] + - location: 76 (remaining gas: 1039922.129 units remaining) + [ ] + - location: -1 (remaining gas: 1039922.084 units remaining) + [ ] + - location: 67 (remaining gas: 1039922.084 units remaining) + [ (Pair { Pair "foo" "bar" } { Pair "gaz" "baz" }) @parameter.right.right.import ] + - location: 77 (remaining gas: 1039922.004 units remaining) + [ { Pair "foo" "bar" } + { Pair "gaz" "baz" } ] + - location: 80 (remaining gas: 1039921.699 units remaining) + [ {} + { Pair "gaz" "baz" } ] + - location: 79 (remaining gas: 1039921.654 units remaining) + [ {} + { Pair "gaz" "baz" } ] + - location: 78 (remaining gas: 1039921.654 units remaining) + [ { Pair "foo" "bar" } + {} + { Pair "gaz" "baz" } ] + - location: 85 (remaining gas: 1039921.037 units remaining) + [ "foo" + "bar" + {} + { Pair "gaz" "baz" } ] + - location: 88 (remaining gas: 1039920.887 units remaining) + [ (Some "bar") + {} + { Pair "gaz" "baz" } ] + - location: 87 (remaining gas: 1039920.842 units remaining) + [ (Some "bar") + {} + { Pair "gaz" "baz" } ] + - location: 86 (remaining gas: 1039920.842 units remaining) + [ "foo" + (Some "bar") + {} + { Pair "gaz" "baz" } ] + - location: 89 (remaining gas: 1039909.978 units remaining) + [ { Elt "foo" "bar" } + { Pair "gaz" "baz" } ] + - location: -1 (remaining gas: 1039909.933 units remaining) + [ { Elt "foo" "bar" } + { Pair "gaz" "baz" } ] + - location: 83 (remaining gas: 1039909.933 units remaining) + [ { Elt "foo" "bar" } + { Pair "gaz" "baz" } ] + - location: 90 (remaining gas: 1039909.863 units remaining) + [ { Pair "gaz" "baz" } + { Elt "foo" "bar" } ] + - location: 93 (remaining gas: 1039909.558 units remaining) + [ {} + { Elt "foo" "bar" } ] + - location: 92 (remaining gas: 1039909.513 units remaining) + [ {} + { Elt "foo" "bar" } ] + - location: 91 (remaining gas: 1039909.513 units remaining) + [ { Pair "gaz" "baz" } + {} + { Elt "foo" "bar" } ] + - location: 98 (remaining gas: 1039908.896 units remaining) + [ "gaz" + "baz" + {} + { Elt "foo" "bar" } ] + - location: 101 (remaining gas: 1039908.746 units remaining) + [ (Some "baz") + {} + { Elt "foo" "bar" } ] + - location: 100 (remaining gas: 1039908.701 units remaining) + [ (Some "baz") + {} + { Elt "foo" "bar" } ] + - location: 99 (remaining gas: 1039908.701 units remaining) + [ "gaz" + (Some "baz") + {} + { Elt "foo" "bar" } ] + - location: 102 (remaining gas: 1039897.837 units remaining) + [ { Elt "gaz" "baz" } + { Elt "foo" "bar" } ] + - location: -1 (remaining gas: 1039897.792 units remaining) + [ { Elt "gaz" "baz" } + { Elt "foo" "bar" } ] + - location: 96 (remaining gas: 1039897.792 units remaining) + [ { Elt "gaz" "baz" } + { Elt "foo" "bar" } ] + - location: 103 (remaining gas: 1039897.722 units remaining) + [ { Elt "foo" "bar" } + { Elt "gaz" "baz" } ] + - location: 104 (remaining gas: 1039897.647 units remaining) + [ (Pair { Elt "foo" "bar" } { Elt "gaz" "baz" }) ] + - location: 105 (remaining gas: 1039897.572 units remaining) + [ (Left (Pair { Elt "foo" "bar" } { Elt "gaz" "baz" })) ] + - location: -1 (remaining gas: 1039897.527 units remaining) + [ (Left (Pair { Elt "foo" "bar" } { Elt "gaz" "baz" })) ] + - location: 64 (remaining gas: 1039897.482 units remaining) + [ (Left (Pair { Elt "foo" "bar" } { Elt "gaz" "baz" })) ] + - location: 59 (remaining gas: 1039897.437 units remaining) + [ (Left (Pair { Elt "foo" "bar" } { Elt "gaz" "baz" })) ] + - location: 151 (remaining gas: 1039897.362 units remaining) + [ {} + (Left (Pair { Elt "foo" "bar" } { Elt "gaz" "baz" })) ] + - location: 153 (remaining gas: 1039897.287 units remaining) + [ (Pair {} (Left (Pair { Elt "foo" "bar" } { Elt "gaz" "baz" }))) ] + - location: -1 (remaining gas: 1039897.242 units remaining) + [ (Pair {} (Left (Pair { Elt "foo" "bar" } { Elt "gaz" "baz" }))) ] + diff --git a/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_contract_input_output[big_map_mem_nat.tz-(Pair { Elt 0 1 } None)-1-(Pair 0 (S.f91eafd1f7.out b/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_contract_input_output[big_map_mem_nat.tz-(Pair { Elt 0 1 } None)-1-(Pair 0 (S.f91eafd1f7.out new file mode 100644 index 0000000000000000000000000000000000000000..c2b4b3b83fe367a1ed7c2e5bfc701522540ff81a --- /dev/null +++ b/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_contract_input_output[big_map_mem_nat.tz-(Pair { Elt 0 1 } None)-1-(Pair 0 (S.f91eafd1f7.out @@ -0,0 +1,46 @@ +tests_alpha/test_contract_opcodes.py::TestContractOpcodes::test_contract_input_output[big_map_mem_nat.tz-(Pair { Elt 0 1 } None)-1-(Pair 0 (Some False))] + +storage + (Pair 0 (Some False)) +emitted operations + +big_map diff + New map(0) of type (big_map nat nat) + Set map(0)[0] to 1 +trace + - location: 11 (remaining gas: 1039977.424 units remaining) + [ (Pair 1 { Elt 0 1 } None) ] + - location: 12 (remaining gas: 1039977.344 units remaining) + [ 1 @parameter + (Pair { Elt 0 1 } None) @storage ] + - location: 15 (remaining gas: 1039977.189 units remaining) + [ { Elt 0 1 } ] + - location: 16 (remaining gas: 1039977.109 units remaining) + [ { Elt 0 1 } + { Elt 0 1 } ] + - location: -1 (remaining gas: 1039977.064 units remaining) + [ { Elt 0 1 } + { Elt 0 1 } ] + - location: 13 (remaining gas: 1039977.064 units remaining) + [ 1 @parameter + { Elt 0 1 } + { Elt 0 1 } ] + - location: 17 (remaining gas: 1039968.208 units remaining) + [ False + { Elt 0 1 } ] + - location: 18 (remaining gas: 1039968.133 units remaining) + [ (Some False) + { Elt 0 1 } ] + - location: 19 (remaining gas: 1039968.063 units remaining) + [ { Elt 0 1 } + (Some False) ] + - location: 20 (remaining gas: 1039967.988 units remaining) + [ (Pair { Elt 0 1 } (Some False)) ] + - location: 21 (remaining gas: 1039967.913 units remaining) + [ {} + (Pair { Elt 0 1 } (Some False)) ] + - location: 23 (remaining gas: 1039967.838 units remaining) + [ (Pair {} { Elt 0 1 } (Some False)) ] + - location: -1 (remaining gas: 1039967.793 units remaining) + [ (Pair {} { Elt 0 1 } (Some False)) ] + diff --git a/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_contract_input_output[big_map_mem_nat.tz-(Pair { Elt 0 1 } None)-1-(Pair 2 (S.3a3a8a99c0.out b/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_contract_input_output[big_map_mem_nat.tz-(Pair { Elt 0 1 } None)-1-(Pair 2 (S.3a3a8a99c0.out new file mode 100644 index 0000000000000000000000000000000000000000..cfe1ba1c26a9c3d4ff363dcfb726e6734eed64d1 --- /dev/null +++ b/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_contract_input_output[big_map_mem_nat.tz-(Pair { Elt 0 1 } None)-1-(Pair 2 (S.3a3a8a99c0.out @@ -0,0 +1,46 @@ +tests_alpha/test_contract_opcodes.py::TestContractOpcodes::test_contract_input_output[big_map_mem_nat.tz-(Pair { Elt 0 1 } None)-1-(Pair 2 (Some False))0] + +storage + (Pair 2 (Some False)) +emitted operations + +big_map diff + New map(2) of type (big_map nat nat) + Set map(2)[0] to 1 +trace + - location: 11 (remaining gas: 1039977.424 units remaining) + [ (Pair 1 { Elt 0 1 } None) ] + - location: 12 (remaining gas: 1039977.344 units remaining) + [ 1 @parameter + (Pair { Elt 0 1 } None) @storage ] + - location: 15 (remaining gas: 1039977.189 units remaining) + [ { Elt 0 1 } ] + - location: 16 (remaining gas: 1039977.109 units remaining) + [ { Elt 0 1 } + { Elt 0 1 } ] + - location: -1 (remaining gas: 1039977.064 units remaining) + [ { Elt 0 1 } + { Elt 0 1 } ] + - location: 13 (remaining gas: 1039977.064 units remaining) + [ 1 @parameter + { Elt 0 1 } + { Elt 0 1 } ] + - location: 17 (remaining gas: 1039968.208 units remaining) + [ False + { Elt 0 1 } ] + - location: 18 (remaining gas: 1039968.133 units remaining) + [ (Some False) + { Elt 0 1 } ] + - location: 19 (remaining gas: 1039968.063 units remaining) + [ { Elt 0 1 } + (Some False) ] + - location: 20 (remaining gas: 1039967.988 units remaining) + [ (Pair { Elt 0 1 } (Some False)) ] + - location: 21 (remaining gas: 1039967.913 units remaining) + [ {} + (Pair { Elt 0 1 } (Some False)) ] + - location: 23 (remaining gas: 1039967.838 units remaining) + [ (Pair {} { Elt 0 1 } (Some False)) ] + - location: -1 (remaining gas: 1039967.793 units remaining) + [ (Pair {} { Elt 0 1 } (Some False)) ] + diff --git a/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_contract_input_output[big_map_mem_nat.tz-(Pair { Elt 0 1 } None)-1-(Pair 2 (S.7495f2e912.out b/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_contract_input_output[big_map_mem_nat.tz-(Pair { Elt 0 1 } None)-1-(Pair 2 (S.7495f2e912.out new file mode 100644 index 0000000000000000000000000000000000000000..4185b9399131e6a9710f6b5b105173780a0bab7b --- /dev/null +++ b/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_contract_input_output[big_map_mem_nat.tz-(Pair { Elt 0 1 } None)-1-(Pair 2 (S.7495f2e912.out @@ -0,0 +1,46 @@ +tests_alpha/test_contract_opcodes.py::TestContractOpcodes::test_contract_input_output[big_map_mem_nat.tz-(Pair { Elt 0 1 } None)-1-(Pair 2 (Some False))1] + +storage + (Pair 2 (Some False)) +emitted operations + +big_map diff + New map(2) of type (big_map nat nat) + Set map(2)[0] to 1 +trace + - location: 11 (remaining gas: 1039977.424 units remaining) + [ (Pair 1 { Elt 0 1 } None) ] + - location: 12 (remaining gas: 1039977.344 units remaining) + [ 1 @parameter + (Pair { Elt 0 1 } None) @storage ] + - location: 15 (remaining gas: 1039977.189 units remaining) + [ { Elt 0 1 } ] + - location: 16 (remaining gas: 1039977.109 units remaining) + [ { Elt 0 1 } + { Elt 0 1 } ] + - location: -1 (remaining gas: 1039977.064 units remaining) + [ { Elt 0 1 } + { Elt 0 1 } ] + - location: 13 (remaining gas: 1039977.064 units remaining) + [ 1 @parameter + { Elt 0 1 } + { Elt 0 1 } ] + - location: 17 (remaining gas: 1039968.208 units remaining) + [ False + { Elt 0 1 } ] + - location: 18 (remaining gas: 1039968.133 units remaining) + [ (Some False) + { Elt 0 1 } ] + - location: 19 (remaining gas: 1039968.063 units remaining) + [ { Elt 0 1 } + (Some False) ] + - location: 20 (remaining gas: 1039967.988 units remaining) + [ (Pair { Elt 0 1 } (Some False)) ] + - location: 21 (remaining gas: 1039967.913 units remaining) + [ {} + (Pair { Elt 0 1 } (Some False)) ] + - location: 23 (remaining gas: 1039967.838 units remaining) + [ (Pair {} { Elt 0 1 } (Some False)) ] + - location: -1 (remaining gas: 1039967.793 units remaining) + [ (Pair {} { Elt 0 1 } (Some False)) ] + diff --git a/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_contract_input_output[big_map_mem_nat.tz-(Pair { Elt 1 0 } None)-1-(Pair 2 (S.5fbf509810.out b/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_contract_input_output[big_map_mem_nat.tz-(Pair { Elt 1 0 } None)-1-(Pair 2 (S.5fbf509810.out new file mode 100644 index 0000000000000000000000000000000000000000..951bfd5c328fb687b028b92ae86231857e39d71e --- /dev/null +++ b/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_contract_input_output[big_map_mem_nat.tz-(Pair { Elt 1 0 } None)-1-(Pair 2 (S.5fbf509810.out @@ -0,0 +1,46 @@ +tests_alpha/test_contract_opcodes.py::TestContractOpcodes::test_contract_input_output[big_map_mem_nat.tz-(Pair { Elt 1 0 } None)-1-(Pair 2 (Some True))1] + +storage + (Pair 2 (Some True)) +emitted operations + +big_map diff + New map(2) of type (big_map nat nat) + Set map(2)[1] to 0 +trace + - location: 11 (remaining gas: 1039977.424 units remaining) + [ (Pair 1 { Elt 1 0 } None) ] + - location: 12 (remaining gas: 1039977.344 units remaining) + [ 1 @parameter + (Pair { Elt 1 0 } None) @storage ] + - location: 15 (remaining gas: 1039977.189 units remaining) + [ { Elt 1 0 } ] + - location: 16 (remaining gas: 1039977.109 units remaining) + [ { Elt 1 0 } + { Elt 1 0 } ] + - location: -1 (remaining gas: 1039977.064 units remaining) + [ { Elt 1 0 } + { Elt 1 0 } ] + - location: 13 (remaining gas: 1039977.064 units remaining) + [ 1 @parameter + { Elt 1 0 } + { Elt 1 0 } ] + - location: 17 (remaining gas: 1039968.208 units remaining) + [ True + { Elt 1 0 } ] + - location: 18 (remaining gas: 1039968.133 units remaining) + [ (Some True) + { Elt 1 0 } ] + - location: 19 (remaining gas: 1039968.063 units remaining) + [ { Elt 1 0 } + (Some True) ] + - location: 20 (remaining gas: 1039967.988 units remaining) + [ (Pair { Elt 1 0 } (Some True)) ] + - location: 21 (remaining gas: 1039967.913 units remaining) + [ {} + (Pair { Elt 1 0 } (Some True)) ] + - location: 23 (remaining gas: 1039967.838 units remaining) + [ (Pair {} { Elt 1 0 } (Some True)) ] + - location: -1 (remaining gas: 1039967.793 units remaining) + [ (Pair {} { Elt 1 0 } (Some True)) ] + diff --git a/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_contract_input_output[big_map_mem_nat.tz-(Pair { Elt 1 0 } None)-1-(Pair 2 (S.cc58463f52.out b/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_contract_input_output[big_map_mem_nat.tz-(Pair { Elt 1 0 } None)-1-(Pair 2 (S.cc58463f52.out new file mode 100644 index 0000000000000000000000000000000000000000..1d8b53d3c1eb4feed66b9f0f3b86f9a15a21ef44 --- /dev/null +++ b/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_contract_input_output[big_map_mem_nat.tz-(Pair { Elt 1 0 } None)-1-(Pair 2 (S.cc58463f52.out @@ -0,0 +1,46 @@ +tests_alpha/test_contract_opcodes.py::TestContractOpcodes::test_contract_input_output[big_map_mem_nat.tz-(Pair { Elt 1 0 } None)-1-(Pair 2 (Some True))0] + +storage + (Pair 2 (Some True)) +emitted operations + +big_map diff + New map(2) of type (big_map nat nat) + Set map(2)[1] to 0 +trace + - location: 11 (remaining gas: 1039977.424 units remaining) + [ (Pair 1 { Elt 1 0 } None) ] + - location: 12 (remaining gas: 1039977.344 units remaining) + [ 1 @parameter + (Pair { Elt 1 0 } None) @storage ] + - location: 15 (remaining gas: 1039977.189 units remaining) + [ { Elt 1 0 } ] + - location: 16 (remaining gas: 1039977.109 units remaining) + [ { Elt 1 0 } + { Elt 1 0 } ] + - location: -1 (remaining gas: 1039977.064 units remaining) + [ { Elt 1 0 } + { Elt 1 0 } ] + - location: 13 (remaining gas: 1039977.064 units remaining) + [ 1 @parameter + { Elt 1 0 } + { Elt 1 0 } ] + - location: 17 (remaining gas: 1039968.208 units remaining) + [ True + { Elt 1 0 } ] + - location: 18 (remaining gas: 1039968.133 units remaining) + [ (Some True) + { Elt 1 0 } ] + - location: 19 (remaining gas: 1039968.063 units remaining) + [ { Elt 1 0 } + (Some True) ] + - location: 20 (remaining gas: 1039967.988 units remaining) + [ (Pair { Elt 1 0 } (Some True)) ] + - location: 21 (remaining gas: 1039967.913 units remaining) + [ {} + (Pair { Elt 1 0 } (Some True)) ] + - location: 23 (remaining gas: 1039967.838 units remaining) + [ (Pair {} { Elt 1 0 } (Some True)) ] + - location: -1 (remaining gas: 1039967.793 units remaining) + [ (Pair {} { Elt 1 0 } (Some True)) ] + diff --git a/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_contract_input_output[big_map_mem_nat.tz-(Pair { Elt 1 4 ; Elt 2 11 } None)-1.3684da1d4a.out b/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_contract_input_output[big_map_mem_nat.tz-(Pair { Elt 1 4 ; Elt 2 11 } None)-1.3684da1d4a.out new file mode 100644 index 0000000000000000000000000000000000000000..40c1c359ea6d2d7f33a0a34fbbf09467cf3bdb38 --- /dev/null +++ b/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_contract_input_output[big_map_mem_nat.tz-(Pair { Elt 1 4 ; Elt 2 11 } None)-1.3684da1d4a.out @@ -0,0 +1,47 @@ +tests_alpha/test_contract_opcodes.py::TestContractOpcodes::test_contract_input_output[big_map_mem_nat.tz-(Pair { Elt 1 4 ; Elt 2 11 } None)-1-(Pair 2 (Some True))1] + +storage + (Pair 2 (Some True)) +emitted operations + +big_map diff + New map(2) of type (big_map nat nat) + Set map(2)[1] to 4 + Set map(2)[2] to 11 +trace + - location: 11 (remaining gas: 1039967.964 units remaining) + [ (Pair 1 { Elt 1 4 ; Elt 2 11 } None) ] + - location: 12 (remaining gas: 1039967.884 units remaining) + [ 1 @parameter + (Pair { Elt 1 4 ; Elt 2 11 } None) @storage ] + - location: 15 (remaining gas: 1039967.729 units remaining) + [ { Elt 1 4 ; Elt 2 11 } ] + - location: 16 (remaining gas: 1039967.649 units remaining) + [ { Elt 1 4 ; Elt 2 11 } + { Elt 1 4 ; Elt 2 11 } ] + - location: -1 (remaining gas: 1039967.604 units remaining) + [ { Elt 1 4 ; Elt 2 11 } + { Elt 1 4 ; Elt 2 11 } ] + - location: 13 (remaining gas: 1039967.604 units remaining) + [ 1 @parameter + { Elt 1 4 ; Elt 2 11 } + { Elt 1 4 ; Elt 2 11 } ] + - location: 17 (remaining gas: 1039958.747 units remaining) + [ True + { Elt 1 4 ; Elt 2 11 } ] + - location: 18 (remaining gas: 1039958.672 units remaining) + [ (Some True) + { Elt 1 4 ; Elt 2 11 } ] + - location: 19 (remaining gas: 1039958.602 units remaining) + [ { Elt 1 4 ; Elt 2 11 } + (Some True) ] + - location: 20 (remaining gas: 1039958.527 units remaining) + [ (Pair { Elt 1 4 ; Elt 2 11 } (Some True)) ] + - location: 21 (remaining gas: 1039958.452 units remaining) + [ {} + (Pair { Elt 1 4 ; Elt 2 11 } (Some True)) ] + - location: 23 (remaining gas: 1039958.377 units remaining) + [ (Pair {} { Elt 1 4 ; Elt 2 11 } (Some True)) ] + - location: -1 (remaining gas: 1039958.332 units remaining) + [ (Pair {} { Elt 1 4 ; Elt 2 11 } (Some True)) ] + diff --git a/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_contract_input_output[big_map_mem_nat.tz-(Pair { Elt 1 4 ; Elt 2 11 } None)-1.596eedbdf9.out b/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_contract_input_output[big_map_mem_nat.tz-(Pair { Elt 1 4 ; Elt 2 11 } None)-1.596eedbdf9.out new file mode 100644 index 0000000000000000000000000000000000000000..c855d2a9fdeb488cc0d4244a2e3089de1120e32d --- /dev/null +++ b/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_contract_input_output[big_map_mem_nat.tz-(Pair { Elt 1 4 ; Elt 2 11 } None)-1.596eedbdf9.out @@ -0,0 +1,47 @@ +tests_alpha/test_contract_opcodes.py::TestContractOpcodes::test_contract_input_output[big_map_mem_nat.tz-(Pair { Elt 1 4 ; Elt 2 11 } None)-1-(Pair 2 (Some True))0] + +storage + (Pair 2 (Some True)) +emitted operations + +big_map diff + New map(2) of type (big_map nat nat) + Set map(2)[1] to 4 + Set map(2)[2] to 11 +trace + - location: 11 (remaining gas: 1039967.964 units remaining) + [ (Pair 1 { Elt 1 4 ; Elt 2 11 } None) ] + - location: 12 (remaining gas: 1039967.884 units remaining) + [ 1 @parameter + (Pair { Elt 1 4 ; Elt 2 11 } None) @storage ] + - location: 15 (remaining gas: 1039967.729 units remaining) + [ { Elt 1 4 ; Elt 2 11 } ] + - location: 16 (remaining gas: 1039967.649 units remaining) + [ { Elt 1 4 ; Elt 2 11 } + { Elt 1 4 ; Elt 2 11 } ] + - location: -1 (remaining gas: 1039967.604 units remaining) + [ { Elt 1 4 ; Elt 2 11 } + { Elt 1 4 ; Elt 2 11 } ] + - location: 13 (remaining gas: 1039967.604 units remaining) + [ 1 @parameter + { Elt 1 4 ; Elt 2 11 } + { Elt 1 4 ; Elt 2 11 } ] + - location: 17 (remaining gas: 1039958.747 units remaining) + [ True + { Elt 1 4 ; Elt 2 11 } ] + - location: 18 (remaining gas: 1039958.672 units remaining) + [ (Some True) + { Elt 1 4 ; Elt 2 11 } ] + - location: 19 (remaining gas: 1039958.602 units remaining) + [ { Elt 1 4 ; Elt 2 11 } + (Some True) ] + - location: 20 (remaining gas: 1039958.527 units remaining) + [ (Pair { Elt 1 4 ; Elt 2 11 } (Some True)) ] + - location: 21 (remaining gas: 1039958.452 units remaining) + [ {} + (Pair { Elt 1 4 ; Elt 2 11 } (Some True)) ] + - location: 23 (remaining gas: 1039958.377 units remaining) + [ (Pair {} { Elt 1 4 ; Elt 2 11 } (Some True)) ] + - location: -1 (remaining gas: 1039958.332 units remaining) + [ (Pair {} { Elt 1 4 ; Elt 2 11 } (Some True)) ] + diff --git a/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_contract_input_output[big_map_mem_nat.tz-(Pair { Elt 1 4 ; Elt 2 11 } None)-2.2dc784176c.out b/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_contract_input_output[big_map_mem_nat.tz-(Pair { Elt 1 4 ; Elt 2 11 } None)-2.2dc784176c.out new file mode 100644 index 0000000000000000000000000000000000000000..b5e7b7d051b147e39549811b93e62def9425ab28 --- /dev/null +++ b/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_contract_input_output[big_map_mem_nat.tz-(Pair { Elt 1 4 ; Elt 2 11 } None)-2.2dc784176c.out @@ -0,0 +1,47 @@ +tests_alpha/test_contract_opcodes.py::TestContractOpcodes::test_contract_input_output[big_map_mem_nat.tz-(Pair { Elt 1 4 ; Elt 2 11 } None)-2-(Pair 2 (Some True))1] + +storage + (Pair 2 (Some True)) +emitted operations + +big_map diff + New map(2) of type (big_map nat nat) + Set map(2)[1] to 4 + Set map(2)[2] to 11 +trace + - location: 11 (remaining gas: 1039967.964 units remaining) + [ (Pair 2 { Elt 1 4 ; Elt 2 11 } None) ] + - location: 12 (remaining gas: 1039967.884 units remaining) + [ 2 @parameter + (Pair { Elt 1 4 ; Elt 2 11 } None) @storage ] + - location: 15 (remaining gas: 1039967.729 units remaining) + [ { Elt 1 4 ; Elt 2 11 } ] + - location: 16 (remaining gas: 1039967.649 units remaining) + [ { Elt 1 4 ; Elt 2 11 } + { Elt 1 4 ; Elt 2 11 } ] + - location: -1 (remaining gas: 1039967.604 units remaining) + [ { Elt 1 4 ; Elt 2 11 } + { Elt 1 4 ; Elt 2 11 } ] + - location: 13 (remaining gas: 1039967.604 units remaining) + [ 2 @parameter + { Elt 1 4 ; Elt 2 11 } + { Elt 1 4 ; Elt 2 11 } ] + - location: 17 (remaining gas: 1039958.747 units remaining) + [ True + { Elt 1 4 ; Elt 2 11 } ] + - location: 18 (remaining gas: 1039958.672 units remaining) + [ (Some True) + { Elt 1 4 ; Elt 2 11 } ] + - location: 19 (remaining gas: 1039958.602 units remaining) + [ { Elt 1 4 ; Elt 2 11 } + (Some True) ] + - location: 20 (remaining gas: 1039958.527 units remaining) + [ (Pair { Elt 1 4 ; Elt 2 11 } (Some True)) ] + - location: 21 (remaining gas: 1039958.452 units remaining) + [ {} + (Pair { Elt 1 4 ; Elt 2 11 } (Some True)) ] + - location: 23 (remaining gas: 1039958.377 units remaining) + [ (Pair {} { Elt 1 4 ; Elt 2 11 } (Some True)) ] + - location: -1 (remaining gas: 1039958.332 units remaining) + [ (Pair {} { Elt 1 4 ; Elt 2 11 } (Some True)) ] + diff --git a/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_contract_input_output[big_map_mem_nat.tz-(Pair { Elt 1 4 ; Elt 2 11 } None)-2.ff2ac70f53.out b/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_contract_input_output[big_map_mem_nat.tz-(Pair { Elt 1 4 ; Elt 2 11 } None)-2.ff2ac70f53.out new file mode 100644 index 0000000000000000000000000000000000000000..77256b5bb364ca22e7b1db8aa4a010649c4a6ecd --- /dev/null +++ b/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_contract_input_output[big_map_mem_nat.tz-(Pair { Elt 1 4 ; Elt 2 11 } None)-2.ff2ac70f53.out @@ -0,0 +1,47 @@ +tests_alpha/test_contract_opcodes.py::TestContractOpcodes::test_contract_input_output[big_map_mem_nat.tz-(Pair { Elt 1 4 ; Elt 2 11 } None)-2-(Pair 2 (Some True))0] + +storage + (Pair 2 (Some True)) +emitted operations + +big_map diff + New map(2) of type (big_map nat nat) + Set map(2)[1] to 4 + Set map(2)[2] to 11 +trace + - location: 11 (remaining gas: 1039967.964 units remaining) + [ (Pair 2 { Elt 1 4 ; Elt 2 11 } None) ] + - location: 12 (remaining gas: 1039967.884 units remaining) + [ 2 @parameter + (Pair { Elt 1 4 ; Elt 2 11 } None) @storage ] + - location: 15 (remaining gas: 1039967.729 units remaining) + [ { Elt 1 4 ; Elt 2 11 } ] + - location: 16 (remaining gas: 1039967.649 units remaining) + [ { Elt 1 4 ; Elt 2 11 } + { Elt 1 4 ; Elt 2 11 } ] + - location: -1 (remaining gas: 1039967.604 units remaining) + [ { Elt 1 4 ; Elt 2 11 } + { Elt 1 4 ; Elt 2 11 } ] + - location: 13 (remaining gas: 1039967.604 units remaining) + [ 2 @parameter + { Elt 1 4 ; Elt 2 11 } + { Elt 1 4 ; Elt 2 11 } ] + - location: 17 (remaining gas: 1039958.747 units remaining) + [ True + { Elt 1 4 ; Elt 2 11 } ] + - location: 18 (remaining gas: 1039958.672 units remaining) + [ (Some True) + { Elt 1 4 ; Elt 2 11 } ] + - location: 19 (remaining gas: 1039958.602 units remaining) + [ { Elt 1 4 ; Elt 2 11 } + (Some True) ] + - location: 20 (remaining gas: 1039958.527 units remaining) + [ (Pair { Elt 1 4 ; Elt 2 11 } (Some True)) ] + - location: 21 (remaining gas: 1039958.452 units remaining) + [ {} + (Pair { Elt 1 4 ; Elt 2 11 } (Some True)) ] + - location: 23 (remaining gas: 1039958.377 units remaining) + [ (Pair {} { Elt 1 4 ; Elt 2 11 } (Some True)) ] + - location: -1 (remaining gas: 1039958.332 units remaining) + [ (Pair {} { Elt 1 4 ; Elt 2 11 } (Some True)) ] + diff --git a/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_contract_input_output[big_map_mem_nat.tz-(Pair { Elt 1 4 ; Elt 2 11 } None)-3.1b9e98462c.out b/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_contract_input_output[big_map_mem_nat.tz-(Pair { Elt 1 4 ; Elt 2 11 } None)-3.1b9e98462c.out new file mode 100644 index 0000000000000000000000000000000000000000..133a9e531673ddbb6081183469de3a353cc47e9d --- /dev/null +++ b/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_contract_input_output[big_map_mem_nat.tz-(Pair { Elt 1 4 ; Elt 2 11 } None)-3.1b9e98462c.out @@ -0,0 +1,47 @@ +tests_alpha/test_contract_opcodes.py::TestContractOpcodes::test_contract_input_output[big_map_mem_nat.tz-(Pair { Elt 1 4 ; Elt 2 11 } None)-3-(Pair 2 (Some False))0] + +storage + (Pair 2 (Some False)) +emitted operations + +big_map diff + New map(2) of type (big_map nat nat) + Set map(2)[1] to 4 + Set map(2)[2] to 11 +trace + - location: 11 (remaining gas: 1039967.964 units remaining) + [ (Pair 3 { Elt 1 4 ; Elt 2 11 } None) ] + - location: 12 (remaining gas: 1039967.884 units remaining) + [ 3 @parameter + (Pair { Elt 1 4 ; Elt 2 11 } None) @storage ] + - location: 15 (remaining gas: 1039967.729 units remaining) + [ { Elt 1 4 ; Elt 2 11 } ] + - location: 16 (remaining gas: 1039967.649 units remaining) + [ { Elt 1 4 ; Elt 2 11 } + { Elt 1 4 ; Elt 2 11 } ] + - location: -1 (remaining gas: 1039967.604 units remaining) + [ { Elt 1 4 ; Elt 2 11 } + { Elt 1 4 ; Elt 2 11 } ] + - location: 13 (remaining gas: 1039967.604 units remaining) + [ 3 @parameter + { Elt 1 4 ; Elt 2 11 } + { Elt 1 4 ; Elt 2 11 } ] + - location: 17 (remaining gas: 1039958.747 units remaining) + [ False + { Elt 1 4 ; Elt 2 11 } ] + - location: 18 (remaining gas: 1039958.672 units remaining) + [ (Some False) + { Elt 1 4 ; Elt 2 11 } ] + - location: 19 (remaining gas: 1039958.602 units remaining) + [ { Elt 1 4 ; Elt 2 11 } + (Some False) ] + - location: 20 (remaining gas: 1039958.527 units remaining) + [ (Pair { Elt 1 4 ; Elt 2 11 } (Some False)) ] + - location: 21 (remaining gas: 1039958.452 units remaining) + [ {} + (Pair { Elt 1 4 ; Elt 2 11 } (Some False)) ] + - location: 23 (remaining gas: 1039958.377 units remaining) + [ (Pair {} { Elt 1 4 ; Elt 2 11 } (Some False)) ] + - location: -1 (remaining gas: 1039958.332 units remaining) + [ (Pair {} { Elt 1 4 ; Elt 2 11 } (Some False)) ] + diff --git a/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_contract_input_output[big_map_mem_nat.tz-(Pair { Elt 1 4 ; Elt 2 11 } None)-3.cf9af2765c.out b/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_contract_input_output[big_map_mem_nat.tz-(Pair { Elt 1 4 ; Elt 2 11 } None)-3.cf9af2765c.out new file mode 100644 index 0000000000000000000000000000000000000000..bac2ad97b192f837ea622e79ffa932ff53059967 --- /dev/null +++ b/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_contract_input_output[big_map_mem_nat.tz-(Pair { Elt 1 4 ; Elt 2 11 } None)-3.cf9af2765c.out @@ -0,0 +1,47 @@ +tests_alpha/test_contract_opcodes.py::TestContractOpcodes::test_contract_input_output[big_map_mem_nat.tz-(Pair { Elt 1 4 ; Elt 2 11 } None)-3-(Pair 2 (Some False))1] + +storage + (Pair 2 (Some False)) +emitted operations + +big_map diff + New map(2) of type (big_map nat nat) + Set map(2)[1] to 4 + Set map(2)[2] to 11 +trace + - location: 11 (remaining gas: 1039967.964 units remaining) + [ (Pair 3 { Elt 1 4 ; Elt 2 11 } None) ] + - location: 12 (remaining gas: 1039967.884 units remaining) + [ 3 @parameter + (Pair { Elt 1 4 ; Elt 2 11 } None) @storage ] + - location: 15 (remaining gas: 1039967.729 units remaining) + [ { Elt 1 4 ; Elt 2 11 } ] + - location: 16 (remaining gas: 1039967.649 units remaining) + [ { Elt 1 4 ; Elt 2 11 } + { Elt 1 4 ; Elt 2 11 } ] + - location: -1 (remaining gas: 1039967.604 units remaining) + [ { Elt 1 4 ; Elt 2 11 } + { Elt 1 4 ; Elt 2 11 } ] + - location: 13 (remaining gas: 1039967.604 units remaining) + [ 3 @parameter + { Elt 1 4 ; Elt 2 11 } + { Elt 1 4 ; Elt 2 11 } ] + - location: 17 (remaining gas: 1039958.747 units remaining) + [ False + { Elt 1 4 ; Elt 2 11 } ] + - location: 18 (remaining gas: 1039958.672 units remaining) + [ (Some False) + { Elt 1 4 ; Elt 2 11 } ] + - location: 19 (remaining gas: 1039958.602 units remaining) + [ { Elt 1 4 ; Elt 2 11 } + (Some False) ] + - location: 20 (remaining gas: 1039958.527 units remaining) + [ (Pair { Elt 1 4 ; Elt 2 11 } (Some False)) ] + - location: 21 (remaining gas: 1039958.452 units remaining) + [ {} + (Pair { Elt 1 4 ; Elt 2 11 } (Some False)) ] + - location: 23 (remaining gas: 1039958.377 units remaining) + [ (Pair {} { Elt 1 4 ; Elt 2 11 } (Some False)) ] + - location: -1 (remaining gas: 1039958.332 units remaining) + [ (Pair {} { Elt 1 4 ; Elt 2 11 } (Some False)) ] + diff --git a/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_contract_input_output[big_map_mem_nat.tz-(Pair {} None)-1-(Pair 2 (Some False))0].out b/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_contract_input_output[big_map_mem_nat.tz-(Pair {} None)-1-(Pair 2 (Some False))0].out new file mode 100644 index 0000000000000000000000000000000000000000..65e8f6cad01fa1c98922ed2ae7ef9e72c0f8eb5e --- /dev/null +++ b/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_contract_input_output[big_map_mem_nat.tz-(Pair {} None)-1-(Pair 2 (Some False))0].out @@ -0,0 +1,45 @@ +tests_alpha/test_contract_opcodes.py::TestContractOpcodes::test_contract_input_output[big_map_mem_nat.tz-(Pair {} None)-1-(Pair 2 (Some False))0] + +storage + (Pair 2 (Some False)) +emitted operations + +big_map diff + New map(2) of type (big_map nat nat) +trace + - location: 11 (remaining gas: 1039986.730 units remaining) + [ (Pair 1 {} None) ] + - location: 12 (remaining gas: 1039986.650 units remaining) + [ 1 @parameter + (Pair {} None) @storage ] + - location: 15 (remaining gas: 1039986.495 units remaining) + [ {} ] + - location: 16 (remaining gas: 1039986.415 units remaining) + [ {} + {} ] + - location: -1 (remaining gas: 1039986.370 units remaining) + [ {} + {} ] + - location: 13 (remaining gas: 1039986.370 units remaining) + [ 1 @parameter + {} + {} ] + - location: 17 (remaining gas: 1039977.516 units remaining) + [ False + {} ] + - location: 18 (remaining gas: 1039977.441 units remaining) + [ (Some False) + {} ] + - location: 19 (remaining gas: 1039977.371 units remaining) + [ {} + (Some False) ] + - location: 20 (remaining gas: 1039977.296 units remaining) + [ (Pair {} (Some False)) ] + - location: 21 (remaining gas: 1039977.221 units remaining) + [ {} + (Pair {} (Some False)) ] + - location: 23 (remaining gas: 1039977.146 units remaining) + [ (Pair {} {} (Some False)) ] + - location: -1 (remaining gas: 1039977.101 units remaining) + [ (Pair {} {} (Some False)) ] + diff --git a/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_contract_input_output[big_map_mem_nat.tz-(Pair {} None)-1-(Pair 2 (Some False))1].out b/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_contract_input_output[big_map_mem_nat.tz-(Pair {} None)-1-(Pair 2 (Some False))1].out new file mode 100644 index 0000000000000000000000000000000000000000..d35cf9dfc84824b77b067430d0b6fbb4f79c069a --- /dev/null +++ b/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_contract_input_output[big_map_mem_nat.tz-(Pair {} None)-1-(Pair 2 (Some False))1].out @@ -0,0 +1,45 @@ +tests_alpha/test_contract_opcodes.py::TestContractOpcodes::test_contract_input_output[big_map_mem_nat.tz-(Pair {} None)-1-(Pair 2 (Some False))1] + +storage + (Pair 2 (Some False)) +emitted operations + +big_map diff + New map(2) of type (big_map nat nat) +trace + - location: 11 (remaining gas: 1039986.730 units remaining) + [ (Pair 1 {} None) ] + - location: 12 (remaining gas: 1039986.650 units remaining) + [ 1 @parameter + (Pair {} None) @storage ] + - location: 15 (remaining gas: 1039986.495 units remaining) + [ {} ] + - location: 16 (remaining gas: 1039986.415 units remaining) + [ {} + {} ] + - location: -1 (remaining gas: 1039986.370 units remaining) + [ {} + {} ] + - location: 13 (remaining gas: 1039986.370 units remaining) + [ 1 @parameter + {} + {} ] + - location: 17 (remaining gas: 1039977.516 units remaining) + [ False + {} ] + - location: 18 (remaining gas: 1039977.441 units remaining) + [ (Some False) + {} ] + - location: 19 (remaining gas: 1039977.371 units remaining) + [ {} + (Some False) ] + - location: 20 (remaining gas: 1039977.296 units remaining) + [ (Pair {} (Some False)) ] + - location: 21 (remaining gas: 1039977.221 units remaining) + [ {} + (Pair {} (Some False)) ] + - location: 23 (remaining gas: 1039977.146 units remaining) + [ (Pair {} {} (Some False)) ] + - location: -1 (remaining gas: 1039977.101 units remaining) + [ (Pair {} {} (Some False)) ] + diff --git "a/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_contract_input_output[big_map_mem_string.tz-(Pair { Elt \"bar\" 4 ; Elt \"foo\" 1.06d068bc9e.out" "b/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_contract_input_output[big_map_mem_string.tz-(Pair { Elt \"bar\" 4 ; Elt \"foo\" 1.06d068bc9e.out" new file mode 100644 index 0000000000000000000000000000000000000000..a5541718ebbe712302a4c9de38d6b099698bf4e2 --- /dev/null +++ "b/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_contract_input_output[big_map_mem_string.tz-(Pair { Elt \"bar\" 4 ; Elt \"foo\" 1.06d068bc9e.out" @@ -0,0 +1,47 @@ +tests_alpha/test_contract_opcodes.py::TestContractOpcodes::test_contract_input_output[big_map_mem_string.tz-(Pair { Elt "bar" 4 ; Elt "foo" 11 } None)-"baz"-(Pair 2 (Some False))] + +storage + (Pair 2 (Some False)) +emitted operations + +big_map diff + New map(2) of type (big_map string nat) + Set map(2)["bar"] to 4 + Set map(2)["foo"] to 11 +trace + - location: 11 (remaining gas: 1039963.846 units remaining) + [ (Pair "baz" { Elt "bar" 4 ; Elt "foo" 11 } None) ] + - location: 12 (remaining gas: 1039963.766 units remaining) + [ "baz" @parameter + (Pair { Elt "bar" 4 ; Elt "foo" 11 } None) @storage ] + - location: 15 (remaining gas: 1039963.611 units remaining) + [ { Elt "bar" 4 ; Elt "foo" 11 } ] + - location: 16 (remaining gas: 1039963.531 units remaining) + [ { Elt "bar" 4 ; Elt "foo" 11 } + { Elt "bar" 4 ; Elt "foo" 11 } ] + - location: -1 (remaining gas: 1039963.486 units remaining) + [ { Elt "bar" 4 ; Elt "foo" 11 } + { Elt "bar" 4 ; Elt "foo" 11 } ] + - location: 13 (remaining gas: 1039963.486 units remaining) + [ "baz" @parameter + { Elt "bar" 4 ; Elt "foo" 11 } + { Elt "bar" 4 ; Elt "foo" 11 } ] + - location: 17 (remaining gas: 1039952.621 units remaining) + [ False + { Elt "bar" 4 ; Elt "foo" 11 } ] + - location: 18 (remaining gas: 1039952.546 units remaining) + [ (Some False) + { Elt "bar" 4 ; Elt "foo" 11 } ] + - location: 19 (remaining gas: 1039952.476 units remaining) + [ { Elt "bar" 4 ; Elt "foo" 11 } + (Some False) ] + - location: 20 (remaining gas: 1039952.401 units remaining) + [ (Pair { Elt "bar" 4 ; Elt "foo" 11 } (Some False)) ] + - location: 21 (remaining gas: 1039952.326 units remaining) + [ {} + (Pair { Elt "bar" 4 ; Elt "foo" 11 } (Some False)) ] + - location: 23 (remaining gas: 1039952.251 units remaining) + [ (Pair {} { Elt "bar" 4 ; Elt "foo" 11 } (Some False)) ] + - location: -1 (remaining gas: 1039952.206 units remaining) + [ (Pair {} { Elt "bar" 4 ; Elt "foo" 11 } (Some False)) ] + diff --git "a/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_contract_input_output[big_map_mem_string.tz-(Pair { Elt \"bar\" 4 ; Elt \"foo\" 1.1ef1e816d2.out" "b/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_contract_input_output[big_map_mem_string.tz-(Pair { Elt \"bar\" 4 ; Elt \"foo\" 1.1ef1e816d2.out" new file mode 100644 index 0000000000000000000000000000000000000000..f66abce4939d0dc5f15ced5635232b93228e07de --- /dev/null +++ "b/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_contract_input_output[big_map_mem_string.tz-(Pair { Elt \"bar\" 4 ; Elt \"foo\" 1.1ef1e816d2.out" @@ -0,0 +1,47 @@ +tests_alpha/test_contract_opcodes.py::TestContractOpcodes::test_contract_input_output[big_map_mem_string.tz-(Pair { Elt "bar" 4 ; Elt "foo" 11 } None)-"bar"-(Pair 2 (Some True))] + +storage + (Pair 2 (Some True)) +emitted operations + +big_map diff + New map(2) of type (big_map string nat) + Set map(2)["bar"] to 4 + Set map(2)["foo"] to 11 +trace + - location: 11 (remaining gas: 1039963.846 units remaining) + [ (Pair "bar" { Elt "bar" 4 ; Elt "foo" 11 } None) ] + - location: 12 (remaining gas: 1039963.766 units remaining) + [ "bar" @parameter + (Pair { Elt "bar" 4 ; Elt "foo" 11 } None) @storage ] + - location: 15 (remaining gas: 1039963.611 units remaining) + [ { Elt "bar" 4 ; Elt "foo" 11 } ] + - location: 16 (remaining gas: 1039963.531 units remaining) + [ { Elt "bar" 4 ; Elt "foo" 11 } + { Elt "bar" 4 ; Elt "foo" 11 } ] + - location: -1 (remaining gas: 1039963.486 units remaining) + [ { Elt "bar" 4 ; Elt "foo" 11 } + { Elt "bar" 4 ; Elt "foo" 11 } ] + - location: 13 (remaining gas: 1039963.486 units remaining) + [ "bar" @parameter + { Elt "bar" 4 ; Elt "foo" 11 } + { Elt "bar" 4 ; Elt "foo" 11 } ] + - location: 17 (remaining gas: 1039952.621 units remaining) + [ True + { Elt "bar" 4 ; Elt "foo" 11 } ] + - location: 18 (remaining gas: 1039952.546 units remaining) + [ (Some True) + { Elt "bar" 4 ; Elt "foo" 11 } ] + - location: 19 (remaining gas: 1039952.476 units remaining) + [ { Elt "bar" 4 ; Elt "foo" 11 } + (Some True) ] + - location: 20 (remaining gas: 1039952.401 units remaining) + [ (Pair { Elt "bar" 4 ; Elt "foo" 11 } (Some True)) ] + - location: 21 (remaining gas: 1039952.326 units remaining) + [ {} + (Pair { Elt "bar" 4 ; Elt "foo" 11 } (Some True)) ] + - location: 23 (remaining gas: 1039952.251 units remaining) + [ (Pair {} { Elt "bar" 4 ; Elt "foo" 11 } (Some True)) ] + - location: -1 (remaining gas: 1039952.206 units remaining) + [ (Pair {} { Elt "bar" 4 ; Elt "foo" 11 } (Some True)) ] + diff --git "a/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_contract_input_output[big_map_mem_string.tz-(Pair { Elt \"bar\" 4 ; Elt \"foo\" 1.42f59ef508.out" "b/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_contract_input_output[big_map_mem_string.tz-(Pair { Elt \"bar\" 4 ; Elt \"foo\" 1.42f59ef508.out" new file mode 100644 index 0000000000000000000000000000000000000000..38bfa54cdb62b35ea7a42aa3ca05617cdc156a2b --- /dev/null +++ "b/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_contract_input_output[big_map_mem_string.tz-(Pair { Elt \"bar\" 4 ; Elt \"foo\" 1.42f59ef508.out" @@ -0,0 +1,47 @@ +tests_alpha/test_contract_opcodes.py::TestContractOpcodes::test_contract_input_output[big_map_mem_string.tz-(Pair { Elt "bar" 4 ; Elt "foo" 11 } None)-"foo"-(Pair 2 (Some True))] + +storage + (Pair 2 (Some True)) +emitted operations + +big_map diff + New map(2) of type (big_map string nat) + Set map(2)["bar"] to 4 + Set map(2)["foo"] to 11 +trace + - location: 11 (remaining gas: 1039963.846 units remaining) + [ (Pair "foo" { Elt "bar" 4 ; Elt "foo" 11 } None) ] + - location: 12 (remaining gas: 1039963.766 units remaining) + [ "foo" @parameter + (Pair { Elt "bar" 4 ; Elt "foo" 11 } None) @storage ] + - location: 15 (remaining gas: 1039963.611 units remaining) + [ { Elt "bar" 4 ; Elt "foo" 11 } ] + - location: 16 (remaining gas: 1039963.531 units remaining) + [ { Elt "bar" 4 ; Elt "foo" 11 } + { Elt "bar" 4 ; Elt "foo" 11 } ] + - location: -1 (remaining gas: 1039963.486 units remaining) + [ { Elt "bar" 4 ; Elt "foo" 11 } + { Elt "bar" 4 ; Elt "foo" 11 } ] + - location: 13 (remaining gas: 1039963.486 units remaining) + [ "foo" @parameter + { Elt "bar" 4 ; Elt "foo" 11 } + { Elt "bar" 4 ; Elt "foo" 11 } ] + - location: 17 (remaining gas: 1039952.621 units remaining) + [ True + { Elt "bar" 4 ; Elt "foo" 11 } ] + - location: 18 (remaining gas: 1039952.546 units remaining) + [ (Some True) + { Elt "bar" 4 ; Elt "foo" 11 } ] + - location: 19 (remaining gas: 1039952.476 units remaining) + [ { Elt "bar" 4 ; Elt "foo" 11 } + (Some True) ] + - location: 20 (remaining gas: 1039952.401 units remaining) + [ (Pair { Elt "bar" 4 ; Elt "foo" 11 } (Some True)) ] + - location: 21 (remaining gas: 1039952.326 units remaining) + [ {} + (Pair { Elt "bar" 4 ; Elt "foo" 11 } (Some True)) ] + - location: 23 (remaining gas: 1039952.251 units remaining) + [ (Pair {} { Elt "bar" 4 ; Elt "foo" 11 } (Some True)) ] + - location: -1 (remaining gas: 1039952.206 units remaining) + [ (Pair {} { Elt "bar" 4 ; Elt "foo" 11 } (Some True)) ] + diff --git "a/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_contract_input_output[big_map_mem_string.tz-(Pair { Elt \"foo\" 0 } None)-\"foo\".ef9b82f95d.out" "b/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_contract_input_output[big_map_mem_string.tz-(Pair { Elt \"foo\" 0 } None)-\"foo\".ef9b82f95d.out" new file mode 100644 index 0000000000000000000000000000000000000000..33bc2ee80a1a0a16ad81c7b9d633cfa861f357d3 --- /dev/null +++ "b/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_contract_input_output[big_map_mem_string.tz-(Pair { Elt \"foo\" 0 } None)-\"foo\".ef9b82f95d.out" @@ -0,0 +1,46 @@ +tests_alpha/test_contract_opcodes.py::TestContractOpcodes::test_contract_input_output[big_map_mem_string.tz-(Pair { Elt "foo" 0 } None)-"foo"-(Pair 2 (Some True))] + +storage + (Pair 2 (Some True)) +emitted operations + +big_map diff + New map(2) of type (big_map string nat) + Set map(2)["foo"] to 0 +trace + - location: 11 (remaining gas: 1039975.328 units remaining) + [ (Pair "foo" { Elt "foo" 0 } None) ] + - location: 12 (remaining gas: 1039975.248 units remaining) + [ "foo" @parameter + (Pair { Elt "foo" 0 } None) @storage ] + - location: 15 (remaining gas: 1039975.093 units remaining) + [ { Elt "foo" 0 } ] + - location: 16 (remaining gas: 1039975.013 units remaining) + [ { Elt "foo" 0 } + { Elt "foo" 0 } ] + - location: -1 (remaining gas: 1039974.968 units remaining) + [ { Elt "foo" 0 } + { Elt "foo" 0 } ] + - location: 13 (remaining gas: 1039974.968 units remaining) + [ "foo" @parameter + { Elt "foo" 0 } + { Elt "foo" 0 } ] + - location: 17 (remaining gas: 1039964.104 units remaining) + [ True + { Elt "foo" 0 } ] + - location: 18 (remaining gas: 1039964.029 units remaining) + [ (Some True) + { Elt "foo" 0 } ] + - location: 19 (remaining gas: 1039963.959 units remaining) + [ { Elt "foo" 0 } + (Some True) ] + - location: 20 (remaining gas: 1039963.884 units remaining) + [ (Pair { Elt "foo" 0 } (Some True)) ] + - location: 21 (remaining gas: 1039963.809 units remaining) + [ {} + (Pair { Elt "foo" 0 } (Some True)) ] + - location: 23 (remaining gas: 1039963.734 units remaining) + [ (Pair {} { Elt "foo" 0 } (Some True)) ] + - location: -1 (remaining gas: 1039963.689 units remaining) + [ (Pair {} { Elt "foo" 0 } (Some True)) ] + diff --git "a/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_contract_input_output[big_map_mem_string.tz-(Pair { Elt \"foo\" 1 } None)-\"bar\".68bbace451.out" "b/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_contract_input_output[big_map_mem_string.tz-(Pair { Elt \"foo\" 1 } None)-\"bar\".68bbace451.out" new file mode 100644 index 0000000000000000000000000000000000000000..62e69da07e0d9ececdf0316a0ac429fe76041c8f --- /dev/null +++ "b/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_contract_input_output[big_map_mem_string.tz-(Pair { Elt \"foo\" 1 } None)-\"bar\".68bbace451.out" @@ -0,0 +1,46 @@ +tests_alpha/test_contract_opcodes.py::TestContractOpcodes::test_contract_input_output[big_map_mem_string.tz-(Pair { Elt "foo" 1 } None)-"bar"-(Pair 2 (Some False))] + +storage + (Pair 2 (Some False)) +emitted operations + +big_map diff + New map(2) of type (big_map string nat) + Set map(2)["foo"] to 1 +trace + - location: 11 (remaining gas: 1039975.328 units remaining) + [ (Pair "bar" { Elt "foo" 1 } None) ] + - location: 12 (remaining gas: 1039975.248 units remaining) + [ "bar" @parameter + (Pair { Elt "foo" 1 } None) @storage ] + - location: 15 (remaining gas: 1039975.093 units remaining) + [ { Elt "foo" 1 } ] + - location: 16 (remaining gas: 1039975.013 units remaining) + [ { Elt "foo" 1 } + { Elt "foo" 1 } ] + - location: -1 (remaining gas: 1039974.968 units remaining) + [ { Elt "foo" 1 } + { Elt "foo" 1 } ] + - location: 13 (remaining gas: 1039974.968 units remaining) + [ "bar" @parameter + { Elt "foo" 1 } + { Elt "foo" 1 } ] + - location: 17 (remaining gas: 1039964.104 units remaining) + [ False + { Elt "foo" 1 } ] + - location: 18 (remaining gas: 1039964.029 units remaining) + [ (Some False) + { Elt "foo" 1 } ] + - location: 19 (remaining gas: 1039963.959 units remaining) + [ { Elt "foo" 1 } + (Some False) ] + - location: 20 (remaining gas: 1039963.884 units remaining) + [ (Pair { Elt "foo" 1 } (Some False)) ] + - location: 21 (remaining gas: 1039963.809 units remaining) + [ {} + (Pair { Elt "foo" 1 } (Some False)) ] + - location: 23 (remaining gas: 1039963.734 units remaining) + [ (Pair {} { Elt "foo" 1 } (Some False)) ] + - location: -1 (remaining gas: 1039963.689 units remaining) + [ (Pair {} { Elt "foo" 1 } (Some False)) ] + diff --git "a/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_contract_input_output[big_map_mem_string.tz-(Pair {} None)-\"bar\"-(Pair 2 (Some False))].out" "b/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_contract_input_output[big_map_mem_string.tz-(Pair {} None)-\"bar\"-(Pair 2 (Some False))].out" new file mode 100644 index 0000000000000000000000000000000000000000..6beaee9a281c7ed26b3604665577d10d617f225c --- /dev/null +++ "b/tests_python/tests_alpha/_regtest_outputs/test_contract_opcodes.TestContractOpcodes::test_contract_input_output[big_map_mem_string.tz-(Pair {} None)-\"bar\"-(Pair 2 (Some False))].out" @@ -0,0 +1,45 @@ +tests_alpha/test_contract_opcodes.py::TestContractOpcodes::test_contract_input_output[big_map_mem_string.tz-(Pair {} None)-"bar"-(Pair 2 (Some False))] + +storage + (Pair 2 (Some False)) +emitted operations + +big_map diff + New map(2) of type (big_map string nat) +trace + - location: 11 (remaining gas: 1039986.686 units remaining) + [ (Pair "bar" {} None) ] + - location: 12 (remaining gas: 1039986.606 units remaining) + [ "bar" @parameter + (Pair {} None) @storage ] + - location: 15 (remaining gas: 1039986.451 units remaining) + [ {} ] + - location: 16 (remaining gas: 1039986.371 units remaining) + [ {} + {} ] + - location: -1 (remaining gas: 1039986.326 units remaining) + [ {} + {} ] + - location: 13 (remaining gas: 1039986.326 units remaining) + [ "bar" @parameter + {} + {} ] + - location: 17 (remaining gas: 1039975.464 units remaining) + [ False + {} ] + - location: 18 (remaining gas: 1039975.389 units remaining) + [ (Some False) + {} ] + - location: 19 (remaining gas: 1039975.319 units remaining) + [ {} + (Some False) ] + - location: 20 (remaining gas: 1039975.244 units remaining) + [ (Pair {} (Some False)) ] + - location: 21 (remaining gas: 1039975.169 units remaining) + [ {} + (Pair {} (Some False)) ] + - location: 23 (remaining gas: 1039975.094 units remaining) + [ (Pair {} {} (Some False)) ] + - location: -1 (remaining gas: 1039975.049 units remaining) + [ (Pair {} {} (Some False)) ] + diff --git a/tests_python/tests_alpha/protocol.py b/tests_python/tests_alpha/protocol.py index 6216b7f8960f6ae8f34e40764e765270021ece31..76fd0b9fb5a077f9848e0e9d0915e0404fd2df7f 100644 --- a/tests_python/tests_alpha/protocol.py +++ b/tests_python/tests_alpha/protocol.py @@ -4,9 +4,9 @@ HASH = constants.ALPHA DAEMON = constants.ALPHA_DAEMON PARAMETERS = constants.ALPHA_PARAMETERS -PREV_HASH = constants.EDO -PREV_DAEMON = constants.EDO_DAEMON -PREV_PARAMETERS = constants.EDO_PARAMETERS +PREV_HASH = constants.FLORENCE +PREV_DAEMON = constants.FLORENCE_DAEMON +PREV_PARAMETERS = constants.FLORENCE_PARAMETERS def activate( diff --git a/tests_python/tests_alpha/test_migration.py b/tests_python/tests_alpha/test_migration.py index 44022dc77c7610837560d3130d0402e5fc8933ee..2908724f656b581847e351c8a7dd6e8f1bc8dc81 100644 --- a/tests_python/tests_alpha/test_migration.py +++ b/tests_python/tests_alpha/test_migration.py @@ -21,20 +21,8 @@ BAKE_ARGS = [ MIGRATION_LEVEL = 3 BAKER = 'bootstrap1' BAKER_PKH = constants.IDENTITIES[BAKER]['identity'] -PREV_DEPOSIT = protocol.PREV_PARAMETERS["block_security_deposit"] DEPOSIT = protocol.PARAMETERS["block_security_deposit"] -PREV_DEPOSIT_RECEIPTS = [ - {"kind": "contract", "contract": BAKER_PKH, "change": "-" + PREV_DEPOSIT}, - { - "kind": "freezer", - "category": "deposits", - "delegate": BAKER_PKH, - "cycle": 0, - "change": PREV_DEPOSIT, - }, -] -# in protocol Alpha, the "origin" field is added DEPOSIT_RECEIPTS = [ { "kind": "contract", @@ -120,7 +108,7 @@ class TestMigration: assert client.get_protocol() == protocol.PREV_HASH assert sandbox.client(0).get_head()['header']['proto'] == 1 metadata = client.get_metadata() - assert metadata['balance_updates'] == PREV_DEPOSIT_RECEIPTS + assert metadata['balance_updates'] == DEPOSIT_RECEIPTS # PROTO_A is using env. V1, metadata hashes should be present _ops_metadata_hash = client.get_operations_metadata_hash() _block_metadata_hash = client.get_block_metadata_hash() @@ -130,7 +118,7 @@ class TestMigration: client.bake(BAKER, BAKE_ARGS) metadata = client.get_metadata() assert metadata['next_protocol'] == protocol.HASH - assert metadata['balance_updates'] == PREV_DEPOSIT_RECEIPTS + assert metadata['balance_updates'] == DEPOSIT_RECEIPTS # PROTO_B is using env. V1, metadata hashes should be present _ops_metadata_hash = client.get_operations_metadata_hash() _block_metadata_hash = client.get_block_metadata_hash() diff --git a/tests_python/tests_alpha/test_mockup.py b/tests_python/tests_alpha/test_mockup.py index 49c721001e70d4aa93a80f2d22e2b675f0ec86ca..2b0ce52ad2be4009c43744fc029723811b76aa1e 100644 --- a/tests_python/tests_alpha/test_mockup.py +++ b/tests_python/tests_alpha/test_mockup.py @@ -604,6 +604,9 @@ def _test_create_mockup_init_show_roundtrip( "blocks_per_commitment": 5, "blocks_per_cycle": 9, "preserved_cycles": 3, + "liquidity_baking_escape_ema_threshold": 500000, + "liquidity_baking_subsidy": "5000000", + "liquidity_baking_sunset_duration": 1024, } ), ], diff --git a/tests_python/tests_alpha/test_voting_full.py b/tests_python/tests_alpha/test_voting_full.py index fff8707c4a5c46667548f772307657eecb0eaec3..de80df7d1ccc605d73ec76b5108432c9c13ca0cf 100644 --- a/tests_python/tests_alpha/test_voting_full.py +++ b/tests_python/tests_alpha/test_voting_full.py @@ -118,7 +118,7 @@ class TestVotingFull: bake_until_next_voting_period(client, BAKER, OFFSET) clients = sandbox.all_clients() wait_until_level(clients, client.get_level()) - assert_all_clients_in_period(clients, 'testing_vote') + assert_all_clients_in_period(clients, 'exploration') def test_delegates_vote_proto_b(self, sandbox: Sandbox): client = sandbox.client(0) @@ -132,14 +132,14 @@ class TestVotingFull: bake_until_next_voting_period(client, BAKER, OFFSET) clients = sandbox.all_clients() wait_until_level(clients, client.get_level()) - assert_all_clients_in_period(clients, 'testing') + assert_all_clients_in_period(clients, 'cooldown') def test_wait_for_promotion_vote_period(self, sandbox: Sandbox): client = sandbox.client(0) bake_until_next_voting_period(client, BAKER, OFFSET) clients = sandbox.all_clients() wait_until_level(clients, client.get_level()) - assert_all_clients_in_period(clients, 'promotion_vote') + assert_all_clients_in_period(clients, 'promotion') def test_vote_in_promotion_phase(self, sandbox: Sandbox): client = sandbox.client(0) diff --git a/tezt/_regressions/encoding/alpha.block_header.out b/tezt/_regressions/encoding/alpha.block_header.out index 92ee2f6fe8daedb4d299f727b293c20951ae5909..d75487b4d94e61e19214dbb4e39ff967e64475d2 100644 --- a/tezt/_regressions/encoding/alpha.block_header.out +++ b/tezt/_regressions/encoding/alpha.block_header.out @@ -15,11 +15,12 @@ tezt/_regressions/encoding/alpha.block_header.out "priority": 21021, "proof_of_work_nonce": "101895ca00000000", "seed_nonce_hash": "nceUFoeQDgkJCmzdMWh19ZjBYqQD3N9fe6bXQ1ZsUKKvMn7iun5Z3", + "liquidity_baking_escape_vote": false, "signature": "sigbQ5ZNvkjvGssJgoAnUAfY4Wvvg3QZqawBYB1j1VDBNTMBAALnCzRHWzer34bnfmzgHg3EvwdzQKdxgSghB897cono6gbQ" }' -00000533010e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8000000005e9dcbb00242e9bc4583d4f9fa6ba422733f45d3a44397141a953d2237bf8df62e5046eef700000011000000010100000008000000000000000a4c7319284b55068bb7c4e0b9f8585729db7fb27ab4ca9cff2038a1fc324f650c521d101895ca00000000ff043691f53c02ca1ac6f1a0c1586bf77973e04c2d9b618a8309e79651daf0d55866804fe735e06e97e26da8236b6341b91c625d5e82b3524ec0a88cc982365e70f8a5b9bc65df2ea6d21ee244cc3a96fb33031c394c78b1179ff1b8a44237740c +00000533010e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8000000005e9dcbb00242e9bc4583d4f9fa6ba422733f45d3a44397141a953d2237bf8df62e5046eef700000011000000010100000008000000000000000a4c7319284b55068bb7c4e0b9f8585729db7fb27ab4ca9cff2038a1fc324f650c521d101895ca00000000ff043691f53c02ca1ac6f1a0c1586bf77973e04c2d9b618a8309e79651daf0d5580066804fe735e06e97e26da8236b6341b91c625d5e82b3524ec0a88cc982365e70f8a5b9bc65df2ea6d21ee244cc3a96fb33031c394c78b1179ff1b8a44237740c -./tezos-codec decode alpha.block_header from 00000533010e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8000000005e9dcbb00242e9bc4583d4f9fa6ba422733f45d3a44397141a953d2237bf8df62e5046eef700000011000000010100000008000000000000000a4c7319284b55068bb7c4e0b9f8585729db7fb27ab4ca9cff2038a1fc324f650c521d101895ca00000000ff043691f53c02ca1ac6f1a0c1586bf77973e04c2d9b618a8309e79651daf0d55866804fe735e06e97e26da8236b6341b91c625d5e82b3524ec0a88cc982365e70f8a5b9bc65df2ea6d21ee244cc3a96fb33031c394c78b1179ff1b8a44237740c +./tezos-codec decode alpha.block_header from 00000533010e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8000000005e9dcbb00242e9bc4583d4f9fa6ba422733f45d3a44397141a953d2237bf8df62e5046eef700000011000000010100000008000000000000000a4c7319284b55068bb7c4e0b9f8585729db7fb27ab4ca9cff2038a1fc324f650c521d101895ca00000000ff043691f53c02ca1ac6f1a0c1586bf77973e04c2d9b618a8309e79651daf0d5580066804fe735e06e97e26da8236b6341b91c625d5e82b3524ec0a88cc982365e70f8a5b9bc65df2ea6d21ee244cc3a96fb33031c394c78b1179ff1b8a44237740c { "level": 1331, "proto": 1, "predecessor": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", "timestamp": "2020-04-20T16:20:00Z", "validation_pass": 2, @@ -28,5 +29,6 @@ tezt/_regressions/encoding/alpha.block_header.out "context": "CoVDyf9y9gHfAkPWofBJffo4X4bWjmehH2LeVonDcCKKzyQYwqdk", "priority": 21021, "proof_of_work_nonce": "101895ca00000000", "seed_nonce_hash": "nceUFoeQDgkJCmzdMWh19ZjBYqQD3N9fe6bXQ1ZsUKKvMn7iun5Z3", + "liquidity_baking_escape_vote": false, "signature": "sigbQ5ZNvkjvGssJgoAnUAfY4Wvvg3QZqawBYB1j1VDBNTMBAALnCzRHWzer34bnfmzgHg3EvwdzQKdxgSghB897cono6gbQ" } diff --git a/tezt/_regressions/encoding/alpha.block_header.unsigned.out b/tezt/_regressions/encoding/alpha.block_header.unsigned.out index 6ce4df4b3ead00328e86644d036f5c5afd67cb0b..ac43c090ceb767b521eb111de4594737f8ed5a67 100644 --- a/tezt/_regressions/encoding/alpha.block_header.unsigned.out +++ b/tezt/_regressions/encoding/alpha.block_header.unsigned.out @@ -14,11 +14,12 @@ tezt/_regressions/encoding/alpha.block_header.unsigned.out "context": "CoVDyf9y9gHfAkPWofBJffo4X4bWjmehH2LeVonDcCKKzyQYwqdk", "priority": 21021, "proof_of_work_nonce": "101895ca00000000", - "seed_nonce_hash": "nceUFoeQDgkJCmzdMWh19ZjBYqQD3N9fe6bXQ1ZsUKKvMn7iun5Z3" + "seed_nonce_hash": "nceUFoeQDgkJCmzdMWh19ZjBYqQD3N9fe6bXQ1ZsUKKvMn7iun5Z3", + "liquidity_baking_escape_vote": false }' -00000533010e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8000000005e9dcbb00242e9bc4583d4f9fa6ba422733f45d3a44397141a953d2237bf8df62e5046eef700000011000000010100000008000000000000000a4c7319284b55068bb7c4e0b9f8585729db7fb27ab4ca9cff2038a1fc324f650c521d101895ca00000000ff043691f53c02ca1ac6f1a0c1586bf77973e04c2d9b618a8309e79651daf0d558 +00000533010e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8000000005e9dcbb00242e9bc4583d4f9fa6ba422733f45d3a44397141a953d2237bf8df62e5046eef700000011000000010100000008000000000000000a4c7319284b55068bb7c4e0b9f8585729db7fb27ab4ca9cff2038a1fc324f650c521d101895ca00000000ff043691f53c02ca1ac6f1a0c1586bf77973e04c2d9b618a8309e79651daf0d55800 -./tezos-codec decode alpha.block_header.unsigned from 00000533010e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8000000005e9dcbb00242e9bc4583d4f9fa6ba422733f45d3a44397141a953d2237bf8df62e5046eef700000011000000010100000008000000000000000a4c7319284b55068bb7c4e0b9f8585729db7fb27ab4ca9cff2038a1fc324f650c521d101895ca00000000ff043691f53c02ca1ac6f1a0c1586bf77973e04c2d9b618a8309e79651daf0d558 +./tezos-codec decode alpha.block_header.unsigned from 00000533010e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8000000005e9dcbb00242e9bc4583d4f9fa6ba422733f45d3a44397141a953d2237bf8df62e5046eef700000011000000010100000008000000000000000a4c7319284b55068bb7c4e0b9f8585729db7fb27ab4ca9cff2038a1fc324f650c521d101895ca00000000ff043691f53c02ca1ac6f1a0c1586bf77973e04c2d9b618a8309e79651daf0d55800 { "level": 1331, "proto": 1, "predecessor": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", "timestamp": "2020-04-20T16:20:00Z", "validation_pass": 2, @@ -26,4 +27,5 @@ tezt/_regressions/encoding/alpha.block_header.unsigned.out "fitness": [ "01", "000000000000000a" ], "context": "CoVDyf9y9gHfAkPWofBJffo4X4bWjmehH2LeVonDcCKKzyQYwqdk", "priority": 21021, "proof_of_work_nonce": "101895ca00000000", - "seed_nonce_hash": "nceUFoeQDgkJCmzdMWh19ZjBYqQD3N9fe6bXQ1ZsUKKvMn7iun5Z3" } + "seed_nonce_hash": "nceUFoeQDgkJCmzdMWh19ZjBYqQD3N9fe6bXQ1ZsUKKvMn7iun5Z3", + "liquidity_baking_escape_vote": false } diff --git a/tezt/_regressions/encoding/alpha.operation.out b/tezt/_regressions/encoding/alpha.operation.out index 2335ce7ef35fcc9777cee1c0cec4914990ffa57f..d7577433f2e08995069ca8e37ef0d00b5136959d 100644 --- a/tezt/_regressions/encoding/alpha.operation.out +++ b/tezt/_regressions/encoding/alpha.operation.out @@ -120,6 +120,7 @@ tezt/_regressions/encoding/alpha.operation.out "context": "CoVDyf9y9gHfAkPWofBJffo4X4bWjmehH2LeVonDcCKKzyQYwqdk", "priority": 0, "proof_of_work_nonce": "101895ca00000000", + "liquidity_baking_escape_vote": false, "signature": "sigbQ5ZNvkjvGssJgoAnUAfY4Wvvg3QZqawBYB1j1VDBNTMBAALnCzRHWzer34bnfmzgHg3EvwdzQKdxgSghB897cono6gbQ" }, "bh2": { @@ -136,15 +137,16 @@ tezt/_regressions/encoding/alpha.operation.out "context": "CoVDyf9y9gHfAkPWofBJffo4X4bWjmehH2LeVonDcCKKzyQYwqdk", "priority": 0, "proof_of_work_nonce": "101895ca00000000", + "liquidity_baking_escape_vote": false, "signature": "sigbQ5ZNvkjvGssJgoAnUAfY4Wvvg3QZqawBYB1j1VDBNTMBAALnCzRHWzer34bnfmzgHg3EvwdzQKdxgSghB897cono6gbQ" } } ], "signature": "sigbQ5ZNvkjvGssJgoAnUAfY4Wvvg3QZqawBYB1j1VDBNTMBAALnCzRHWzer34bnfmzgHg3EvwdzQKdxgSghB897cono6gbQ" }' -0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a803000000ce00000533010e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8000000005e9dcbb00442e9bc4583d4f9fa6ba422733f45d3a44397141a953d2237bf8df62e5046eef700000011000000010100000008000000000000000a4c7319284b55068bb7c4e0b9f8585729db7fb27ab4ca9cff2038a1fc324f650c0000101895ca000000000066804fe735e06e97e26da8236b6341b91c625d5e82b3524ec0a88cc982365e70f8a5b9bc65df2ea6d21ee244cc3a96fb33031c394c78b1179ff1b8a44237740c000000ce00000533010e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8000000005e9dcbb00442e9bc4583d4f9fa6ba422733f45d3a44397141a953d2237bf8df62e5046eef700000011000000010100000008000000000000000a4c7319284b55068bb7c4e0b9f8585729db7fb27ab4ca9cff2038a1fc324f650c0000101895ca000000000066804fe735e06e97e26da8236b6341b91c625d5e82b3524ec0a88cc982365e70f8a5b9bc65df2ea6d21ee244cc3a96fb33031c394c78b1179ff1b8a44237740c66804fe735e06e97e26da8236b6341b91c625d5e82b3524ec0a88cc982365e70f8a5b9bc65df2ea6d21ee244cc3a96fb33031c394c78b1179ff1b8a44237740c +0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a803000000cf00000533010e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8000000005e9dcbb00442e9bc4583d4f9fa6ba422733f45d3a44397141a953d2237bf8df62e5046eef700000011000000010100000008000000000000000a4c7319284b55068bb7c4e0b9f8585729db7fb27ab4ca9cff2038a1fc324f650c0000101895ca00000000000066804fe735e06e97e26da8236b6341b91c625d5e82b3524ec0a88cc982365e70f8a5b9bc65df2ea6d21ee244cc3a96fb33031c394c78b1179ff1b8a44237740c000000cf00000533010e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8000000005e9dcbb00442e9bc4583d4f9fa6ba422733f45d3a44397141a953d2237bf8df62e5046eef700000011000000010100000008000000000000000a4c7319284b55068bb7c4e0b9f8585729db7fb27ab4ca9cff2038a1fc324f650c0000101895ca00000000000066804fe735e06e97e26da8236b6341b91c625d5e82b3524ec0a88cc982365e70f8a5b9bc65df2ea6d21ee244cc3a96fb33031c394c78b1179ff1b8a44237740c66804fe735e06e97e26da8236b6341b91c625d5e82b3524ec0a88cc982365e70f8a5b9bc65df2ea6d21ee244cc3a96fb33031c394c78b1179ff1b8a44237740c -./tezos-codec decode alpha.operation from 0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a803000000ce00000533010e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8000000005e9dcbb00442e9bc4583d4f9fa6ba422733f45d3a44397141a953d2237bf8df62e5046eef700000011000000010100000008000000000000000a4c7319284b55068bb7c4e0b9f8585729db7fb27ab4ca9cff2038a1fc324f650c0000101895ca000000000066804fe735e06e97e26da8236b6341b91c625d5e82b3524ec0a88cc982365e70f8a5b9bc65df2ea6d21ee244cc3a96fb33031c394c78b1179ff1b8a44237740c000000ce00000533010e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8000000005e9dcbb00442e9bc4583d4f9fa6ba422733f45d3a44397141a953d2237bf8df62e5046eef700000011000000010100000008000000000000000a4c7319284b55068bb7c4e0b9f8585729db7fb27ab4ca9cff2038a1fc324f650c0000101895ca000000000066804fe735e06e97e26da8236b6341b91c625d5e82b3524ec0a88cc982365e70f8a5b9bc65df2ea6d21ee244cc3a96fb33031c394c78b1179ff1b8a44237740c66804fe735e06e97e26da8236b6341b91c625d5e82b3524ec0a88cc982365e70f8a5b9bc65df2ea6d21ee244cc3a96fb33031c394c78b1179ff1b8a44237740c +./tezos-codec decode alpha.operation from 0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a803000000cf00000533010e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8000000005e9dcbb00442e9bc4583d4f9fa6ba422733f45d3a44397141a953d2237bf8df62e5046eef700000011000000010100000008000000000000000a4c7319284b55068bb7c4e0b9f8585729db7fb27ab4ca9cff2038a1fc324f650c0000101895ca00000000000066804fe735e06e97e26da8236b6341b91c625d5e82b3524ec0a88cc982365e70f8a5b9bc65df2ea6d21ee244cc3a96fb33031c394c78b1179ff1b8a44237740c000000cf00000533010e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8000000005e9dcbb00442e9bc4583d4f9fa6ba422733f45d3a44397141a953d2237bf8df62e5046eef700000011000000010100000008000000000000000a4c7319284b55068bb7c4e0b9f8585729db7fb27ab4ca9cff2038a1fc324f650c0000101895ca00000000000066804fe735e06e97e26da8236b6341b91c625d5e82b3524ec0a88cc982365e70f8a5b9bc65df2ea6d21ee244cc3a96fb33031c394c78b1179ff1b8a44237740c66804fe735e06e97e26da8236b6341b91c625d5e82b3524ec0a88cc982365e70f8a5b9bc65df2ea6d21ee244cc3a96fb33031c394c78b1179ff1b8a44237740c { "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", "contents": [ { "kind": "double_baking_evidence", @@ -158,6 +160,7 @@ tezt/_regressions/encoding/alpha.operation.out "fitness": [ "01", "000000000000000a" ], "context": "CoVDyf9y9gHfAkPWofBJffo4X4bWjmehH2LeVonDcCKKzyQYwqdk", "priority": 0, "proof_of_work_nonce": "101895ca00000000", + "liquidity_baking_escape_vote": false, "signature": "sigbQ5ZNvkjvGssJgoAnUAfY4Wvvg3QZqawBYB1j1VDBNTMBAALnCzRHWzer34bnfmzgHg3EvwdzQKdxgSghB897cono6gbQ" }, "bh2": @@ -170,6 +173,7 @@ tezt/_regressions/encoding/alpha.operation.out "fitness": [ "01", "000000000000000a" ], "context": "CoVDyf9y9gHfAkPWofBJffo4X4bWjmehH2LeVonDcCKKzyQYwqdk", "priority": 0, "proof_of_work_nonce": "101895ca00000000", + "liquidity_baking_escape_vote": false, "signature": "sigbQ5ZNvkjvGssJgoAnUAfY4Wvvg3QZqawBYB1j1VDBNTMBAALnCzRHWzer34bnfmzgHg3EvwdzQKdxgSghB897cono6gbQ" } } ], "signature": diff --git a/tezt/_regressions/encoding/alpha.operation.unsigned.out b/tezt/_regressions/encoding/alpha.operation.unsigned.out index 2eba3e1fe38ea771a112e5fda24f6c07e4eba14a..a8d479ad345b7c86b1b71c3cc11520cc14841b58 100644 --- a/tezt/_regressions/encoding/alpha.operation.unsigned.out +++ b/tezt/_regressions/encoding/alpha.operation.unsigned.out @@ -108,6 +108,7 @@ tezt/_regressions/encoding/alpha.operation.unsigned.out "context": "CoVDyf9y9gHfAkPWofBJffo4X4bWjmehH2LeVonDcCKKzyQYwqdk", "priority": 0, "proof_of_work_nonce": "101895ca00000000", + "liquidity_baking_escape_vote": false, "signature": "sigbQ5ZNvkjvGssJgoAnUAfY4Wvvg3QZqawBYB1j1VDBNTMBAALnCzRHWzer34bnfmzgHg3EvwdzQKdxgSghB897cono6gbQ" }, "bh2": { @@ -124,14 +125,15 @@ tezt/_regressions/encoding/alpha.operation.unsigned.out "context": "CoVDyf9y9gHfAkPWofBJffo4X4bWjmehH2LeVonDcCKKzyQYwqdk", "priority": 0, "proof_of_work_nonce": "101895ca00000000", + "liquidity_baking_escape_vote": false, "signature": "sigbQ5ZNvkjvGssJgoAnUAfY4Wvvg3QZqawBYB1j1VDBNTMBAALnCzRHWzer34bnfmzgHg3EvwdzQKdxgSghB897cono6gbQ" } } ] }' -0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a803000000ce00000533010e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8000000005e9dcbb00442e9bc4583d4f9fa6ba422733f45d3a44397141a953d2237bf8df62e5046eef700000011000000010100000008000000000000000a4c7319284b55068bb7c4e0b9f8585729db7fb27ab4ca9cff2038a1fc324f650c0000101895ca000000000066804fe735e06e97e26da8236b6341b91c625d5e82b3524ec0a88cc982365e70f8a5b9bc65df2ea6d21ee244cc3a96fb33031c394c78b1179ff1b8a44237740c000000ce00000533010e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8000000005e9dcbb00442e9bc4583d4f9fa6ba422733f45d3a44397141a953d2237bf8df62e5046eef700000011000000010100000008000000000000000a4c7319284b55068bb7c4e0b9f8585729db7fb27ab4ca9cff2038a1fc324f650c0000101895ca000000000066804fe735e06e97e26da8236b6341b91c625d5e82b3524ec0a88cc982365e70f8a5b9bc65df2ea6d21ee244cc3a96fb33031c394c78b1179ff1b8a44237740c +0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a803000000cf00000533010e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8000000005e9dcbb00442e9bc4583d4f9fa6ba422733f45d3a44397141a953d2237bf8df62e5046eef700000011000000010100000008000000000000000a4c7319284b55068bb7c4e0b9f8585729db7fb27ab4ca9cff2038a1fc324f650c0000101895ca00000000000066804fe735e06e97e26da8236b6341b91c625d5e82b3524ec0a88cc982365e70f8a5b9bc65df2ea6d21ee244cc3a96fb33031c394c78b1179ff1b8a44237740c000000cf00000533010e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8000000005e9dcbb00442e9bc4583d4f9fa6ba422733f45d3a44397141a953d2237bf8df62e5046eef700000011000000010100000008000000000000000a4c7319284b55068bb7c4e0b9f8585729db7fb27ab4ca9cff2038a1fc324f650c0000101895ca00000000000066804fe735e06e97e26da8236b6341b91c625d5e82b3524ec0a88cc982365e70f8a5b9bc65df2ea6d21ee244cc3a96fb33031c394c78b1179ff1b8a44237740c -./tezos-codec decode alpha.operation.unsigned from 0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a803000000ce00000533010e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8000000005e9dcbb00442e9bc4583d4f9fa6ba422733f45d3a44397141a953d2237bf8df62e5046eef700000011000000010100000008000000000000000a4c7319284b55068bb7c4e0b9f8585729db7fb27ab4ca9cff2038a1fc324f650c0000101895ca000000000066804fe735e06e97e26da8236b6341b91c625d5e82b3524ec0a88cc982365e70f8a5b9bc65df2ea6d21ee244cc3a96fb33031c394c78b1179ff1b8a44237740c000000ce00000533010e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8000000005e9dcbb00442e9bc4583d4f9fa6ba422733f45d3a44397141a953d2237bf8df62e5046eef700000011000000010100000008000000000000000a4c7319284b55068bb7c4e0b9f8585729db7fb27ab4ca9cff2038a1fc324f650c0000101895ca000000000066804fe735e06e97e26da8236b6341b91c625d5e82b3524ec0a88cc982365e70f8a5b9bc65df2ea6d21ee244cc3a96fb33031c394c78b1179ff1b8a44237740c +./tezos-codec decode alpha.operation.unsigned from 0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a803000000cf00000533010e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8000000005e9dcbb00442e9bc4583d4f9fa6ba422733f45d3a44397141a953d2237bf8df62e5046eef700000011000000010100000008000000000000000a4c7319284b55068bb7c4e0b9f8585729db7fb27ab4ca9cff2038a1fc324f650c0000101895ca00000000000066804fe735e06e97e26da8236b6341b91c625d5e82b3524ec0a88cc982365e70f8a5b9bc65df2ea6d21ee244cc3a96fb33031c394c78b1179ff1b8a44237740c000000cf00000533010e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8000000005e9dcbb00442e9bc4583d4f9fa6ba422733f45d3a44397141a953d2237bf8df62e5046eef700000011000000010100000008000000000000000a4c7319284b55068bb7c4e0b9f8585729db7fb27ab4ca9cff2038a1fc324f650c0000101895ca00000000000066804fe735e06e97e26da8236b6341b91c625d5e82b3524ec0a88cc982365e70f8a5b9bc65df2ea6d21ee244cc3a96fb33031c394c78b1179ff1b8a44237740c { "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", "contents": [ { "kind": "double_baking_evidence", @@ -145,6 +147,7 @@ tezt/_regressions/encoding/alpha.operation.unsigned.out "fitness": [ "01", "000000000000000a" ], "context": "CoVDyf9y9gHfAkPWofBJffo4X4bWjmehH2LeVonDcCKKzyQYwqdk", "priority": 0, "proof_of_work_nonce": "101895ca00000000", + "liquidity_baking_escape_vote": false, "signature": "sigbQ5ZNvkjvGssJgoAnUAfY4Wvvg3QZqawBYB1j1VDBNTMBAALnCzRHWzer34bnfmzgHg3EvwdzQKdxgSghB897cono6gbQ" }, "bh2": @@ -157,6 +160,7 @@ tezt/_regressions/encoding/alpha.operation.unsigned.out "fitness": [ "01", "000000000000000a" ], "context": "CoVDyf9y9gHfAkPWofBJffo4X4bWjmehH2LeVonDcCKKzyQYwqdk", "priority": 0, "proof_of_work_nonce": "101895ca00000000", + "liquidity_baking_escape_vote": false, "signature": "sigbQ5ZNvkjvGssJgoAnUAfY4Wvvg3QZqawBYB1j1VDBNTMBAALnCzRHWzer34bnfmzgHg3EvwdzQKdxgSghB897cono6gbQ" } } ] } diff --git a/tezt/_regressions/rpc/alpha.client.contracts.out b/tezt/_regressions/rpc/alpha.client.contracts.out index dad019e8278f1de91ebde84620e627a6b1563f61..9f5594b9b6f5616263ea16eea594c6d0c9f8cd8b 100644 --- a/tezt/_regressions/rpc/alpha.client.contracts.out +++ b/tezt/_regressions/rpc/alpha.client.contracts.out @@ -2,7 +2,10 @@ tezt/_regressions/rpc/alpha.client.contracts.out ./tezos-client rpc get /chains/main/blocks/head/context/contracts [ "[PUBLIC_KEY_HASH]", + "[CONTRACT_HASH]", + "[CONTRACT_HASH]", "[PUBLIC_KEY_HASH]", + "[CONTRACT_HASH]", "[PUBLIC_KEY_HASH]", "[PUBLIC_KEY_HASH]", "[PUBLIC_KEY_HASH]" ] diff --git a/tezt/_regressions/rpc/alpha.client.others.out b/tezt/_regressions/rpc/alpha.client.others.out index 1f65a7683e540998bb559917f4655c64f7b8b71e..c43e984d75ea8bad8bd3b019becf8532496a9f15 100644 --- a/tezt/_regressions/rpc/alpha.client.others.out +++ b/tezt/_regressions/rpc/alpha.client.others.out @@ -15,9 +15,12 @@ tezt/_regressions/rpc/alpha.client.others.out "endorsement_security_deposit": "64000000", "baking_reward_per_endorsement": [ "1250000", "187500" ], "endorsement_reward": [ "1250000", "833333" ], "cost_per_byte": "250", - "hard_storage_limit_per_operation": "60000", "test_chain_duration": "0", - "quorum_min": 2000, "quorum_max": 7000, "min_proposal_quorum": 500, - "initial_endorsers": 1, "delay_per_missing_endorsement": "1" } + "hard_storage_limit_per_operation": "60000", "quorum_min": 2000, + "quorum_max": 7000, "min_proposal_quorum": 500, "initial_endorsers": 1, + "delay_per_missing_endorsement": "1", + "liquidity_baking_subsidy": "5000000", + "liquidity_baking_sunset_duration": 1024, + "liquidity_baking_escape_ema_threshold": 500000 } ./tezos-client rpc get /chains/main/blocks/head/helpers/baking_rights [ { "level": 2, "delegate": "[PUBLIC_KEY_HASH]", diff --git a/tezt/_regressions/rpc/alpha.proxy.contracts.out b/tezt/_regressions/rpc/alpha.proxy.contracts.out index 62e42ef98d277bb8dcb870f8dac9d09b57cee927..7653024adf2f63147829b075e8d2569ca59c638f 100644 --- a/tezt/_regressions/rpc/alpha.proxy.contracts.out +++ b/tezt/_regressions/rpc/alpha.proxy.contracts.out @@ -3,7 +3,10 @@ tezt/_regressions/rpc/alpha.proxy.contracts.out ./tezos-client --mode proxy rpc get /chains/main/blocks/head/context/contracts protocol of proxy unspecified, using the node's protocol: ProtoGenesisGenesisGenesisGenesisGenesisGenesk612im [ "[PUBLIC_KEY_HASH]", + "[CONTRACT_HASH]", + "[CONTRACT_HASH]", "[PUBLIC_KEY_HASH]", + "[CONTRACT_HASH]", "[PUBLIC_KEY_HASH]", "[PUBLIC_KEY_HASH]", "[PUBLIC_KEY_HASH]" ] diff --git a/tezt/_regressions/rpc/alpha.proxy.others.out b/tezt/_regressions/rpc/alpha.proxy.others.out index df1fcc9a9b073af7587c2f024ffdab10ddb30a65..530a7f794e2909f0ac6d9c6a5f3b38e57769df4d 100644 --- a/tezt/_regressions/rpc/alpha.proxy.others.out +++ b/tezt/_regressions/rpc/alpha.proxy.others.out @@ -16,9 +16,12 @@ protocol of proxy unspecified, using the node's protocol: ProtoGenesisGenesisGen "endorsement_security_deposit": "64000000", "baking_reward_per_endorsement": [ "1250000", "187500" ], "endorsement_reward": [ "1250000", "833333" ], "cost_per_byte": "250", - "hard_storage_limit_per_operation": "60000", "test_chain_duration": "0", - "quorum_min": 2000, "quorum_max": 7000, "min_proposal_quorum": 500, - "initial_endorsers": 1, "delay_per_missing_endorsement": "1" } + "hard_storage_limit_per_operation": "60000", "quorum_min": 2000, + "quorum_max": 7000, "min_proposal_quorum": 500, "initial_endorsers": 1, + "delay_per_missing_endorsement": "1", + "liquidity_baking_subsidy": "5000000", + "liquidity_baking_sunset_duration": 1024, + "liquidity_baking_escape_ema_threshold": 500000 } ./tezos-client --mode proxy rpc get /chains/main/blocks/head/helpers/baking_rights protocol of proxy unspecified, using the node's protocol: ProtoGenesisGenesisGenesisGenesisGenesisGenesk612im diff --git a/tezt/tests/encoding_samples/alpha/block_header.unsigned/block_header.unsigned.sample.json b/tezt/tests/encoding_samples/alpha/block_header.unsigned/block_header.unsigned.sample.json index 1347e3ebbe47db50f3aa8d16c9f27902cd5194f7..067f6ab46d9e92303aa8d45e4a0bbb94bb7e7fc1 100644 --- a/tezt/tests/encoding_samples/alpha/block_header.unsigned/block_header.unsigned.sample.json +++ b/tezt/tests/encoding_samples/alpha/block_header.unsigned/block_header.unsigned.sample.json @@ -9,5 +9,6 @@ "context": "CoVDyf9y9gHfAkPWofBJffo4X4bWjmehH2LeVonDcCKKzyQYwqdk", "priority": 21021, "proof_of_work_nonce": "101895ca00000000", - "seed_nonce_hash": "nceUFoeQDgkJCmzdMWh19ZjBYqQD3N9fe6bXQ1ZsUKKvMn7iun5Z3" + "seed_nonce_hash": "nceUFoeQDgkJCmzdMWh19ZjBYqQD3N9fe6bXQ1ZsUKKvMn7iun5Z3", + "liquidity_baking_escape_vote": false } diff --git a/tezt/tests/encoding_samples/alpha/block_header/block_header.sample.json b/tezt/tests/encoding_samples/alpha/block_header/block_header.sample.json index 8890db3a04397a92a7239390448078a9fffb2f69..e7ea5355ffab96d87b5ed7d12b1861a74bc3fac3 100644 --- a/tezt/tests/encoding_samples/alpha/block_header/block_header.sample.json +++ b/tezt/tests/encoding_samples/alpha/block_header/block_header.sample.json @@ -10,5 +10,6 @@ "priority": 21021, "proof_of_work_nonce": "101895ca00000000", "seed_nonce_hash": "nceUFoeQDgkJCmzdMWh19ZjBYqQD3N9fe6bXQ1ZsUKKvMn7iun5Z3", + "liquidity_baking_escape_vote": false, "signature": "sigbQ5ZNvkjvGssJgoAnUAfY4Wvvg3QZqawBYB1j1VDBNTMBAALnCzRHWzer34bnfmzgHg3EvwdzQKdxgSghB897cono6gbQ" } diff --git a/tezt/tests/encoding_samples/alpha/operation.unsigned/operation.unsigned-double-baking-evidence.sample.json b/tezt/tests/encoding_samples/alpha/operation.unsigned/operation.unsigned-double-baking-evidence.sample.json index 88a2ec6de05d013672af8e42b26ab3ff71dc10e2..3e2066e129c2fc6b076ee2e62b82857bf7ac2da5 100644 --- a/tezt/tests/encoding_samples/alpha/operation.unsigned/operation.unsigned-double-baking-evidence.sample.json +++ b/tezt/tests/encoding_samples/alpha/operation.unsigned/operation.unsigned-double-baking-evidence.sample.json @@ -13,6 +13,7 @@ "context": "CoVDyf9y9gHfAkPWofBJffo4X4bWjmehH2LeVonDcCKKzyQYwqdk", "priority": 0, "proof_of_work_nonce": "101895ca00000000", + "liquidity_baking_escape_vote": false, "signature": "sigbQ5ZNvkjvGssJgoAnUAfY4Wvvg3QZqawBYB1j1VDBNTMBAALnCzRHWzer34bnfmzgHg3EvwdzQKdxgSghB897cono6gbQ" }, "bh2": { @@ -26,6 +27,7 @@ "context": "CoVDyf9y9gHfAkPWofBJffo4X4bWjmehH2LeVonDcCKKzyQYwqdk", "priority": 0, "proof_of_work_nonce": "101895ca00000000", + "liquidity_baking_escape_vote": false, "signature": "sigbQ5ZNvkjvGssJgoAnUAfY4Wvvg3QZqawBYB1j1VDBNTMBAALnCzRHWzer34bnfmzgHg3EvwdzQKdxgSghB897cono6gbQ" } }] diff --git a/tezt/tests/encoding_samples/alpha/operation/operation-double-baking-evidence.sample.json b/tezt/tests/encoding_samples/alpha/operation/operation-double-baking-evidence.sample.json index 8f5adf00f849a85d24e121f9b634678a2ac52958..63ae234307a4197da559ad7795de72f79d897210 100644 --- a/tezt/tests/encoding_samples/alpha/operation/operation-double-baking-evidence.sample.json +++ b/tezt/tests/encoding_samples/alpha/operation/operation-double-baking-evidence.sample.json @@ -13,6 +13,7 @@ "context": "CoVDyf9y9gHfAkPWofBJffo4X4bWjmehH2LeVonDcCKKzyQYwqdk", "priority": 0, "proof_of_work_nonce": "101895ca00000000", + "liquidity_baking_escape_vote": false, "signature": "sigbQ5ZNvkjvGssJgoAnUAfY4Wvvg3QZqawBYB1j1VDBNTMBAALnCzRHWzer34bnfmzgHg3EvwdzQKdxgSghB897cono6gbQ" }, "bh2": { @@ -26,6 +27,7 @@ "context": "CoVDyf9y9gHfAkPWofBJffo4X4bWjmehH2LeVonDcCKKzyQYwqdk", "priority": 0, "proof_of_work_nonce": "101895ca00000000", + "liquidity_baking_escape_vote": false, "signature": "sigbQ5ZNvkjvGssJgoAnUAfY4Wvvg3QZqawBYB1j1VDBNTMBAALnCzRHWzer34bnfmzgHg3EvwdzQKdxgSghB897cono6gbQ" } }], diff --git a/vendors/flextesa-lib/tezos_protocol.ml b/vendors/flextesa-lib/tezos_protocol.ml index 0e6195327b5f41a95788cdc2004564455ada03ef..99a1536b3a2d5418807dc982c5c905b89f391010 100644 --- a/vendors/flextesa-lib/tezos_protocol.ml +++ b/vendors/flextesa-lib/tezos_protocol.ml @@ -150,6 +150,22 @@ let protocol_parameters_json t : Ezjsonm.t = (* `src/proto_005_PsBabyM1/lib_protocol/parameters_repr.ml` `src/proto_006_PsCARTHA/lib_parameters/default_parameters.ml` `src/proto_007_PsDELPH1/lib_parameters/default_parameters.ml` *) + let alpha_specific_parameters = + match subkind with + | `Alpha -> + [ ( "liquidity_baking_subsidy" + , string "5000000" ); + ( "liquidity_baking_sunset_duration" + , int 262800 ); + ( "liquidity_baking_escape_ema_threshold" + , int 500000 ); ] + | _ -> [] in + let legacy_parameters = + match subkind with + | `Babylon | `Carthage | `Delphi | `Edo -> + [ ("test_chain_duration", string (Int.to_string 1_966_080)) ] + | `Florence | `Alpha -> [] + in let op_gas_limit, block_gas_limit = match subkind with | `Babylon -> (800_000, 8_000_000) @@ -157,33 +173,34 @@ let protocol_parameters_json t : Ezjsonm.t = | `Delphi | `Edo | `Florence | `Alpha -> (1_040_000, 10_400_000) in let open Ezjsonm in let list_of_zs = list (fun i -> string (Int.to_string i)) in - [ ("blocks_per_commitment", int 4); ("endorsers_per_block", int 32) - ; ("hard_gas_limit_per_operation", string (Int.to_string op_gas_limit)) - ; ("hard_gas_limit_per_block", string (Int.to_string block_gas_limit)) - ; ("tokens_per_roll", string (Int.to_string 8_000_000_000)) - ; ("michelson_maximum_type_size", int 1_000) - ; ("seed_nonce_revelation_tip", string (Int.to_string 125_000)) - ; ("origination_size", int 257) - ; ("block_security_deposit", string (Int.to_string 512_000_000)) - ; ("endorsement_security_deposit", string (Int.to_string 64_000_000)) - ; ( match subkind with - | `Babylon -> ("block_reward", string (Int.to_string 16_000_000)) - | `Carthage | `Delphi | `Edo | `Florence | `Alpha -> - ( "baking_reward_per_endorsement" - , list_of_zs t.baking_reward_per_endorsement ) ) - ; ( "endorsement_reward" - , match subkind with - | `Babylon -> string (Int.to_string 2_000_000) - | `Carthage | `Delphi | `Edo | `Florence | `Alpha -> list_of_zs t.endorsement_reward - ); ("hard_storage_limit_per_operation", string (Int.to_string 60_000)) - ; ( "cost_per_byte" - , match subkind with - | `Babylon | `Carthage -> string (Int.to_string 1_000) - | `Delphi | `Edo | `Florence | `Alpha -> string (Int.to_string 250) ) - ; ("test_chain_duration", string (Int.to_string 1_966_080)) - ; ("quorum_min", int 3_000); ("quorum_max", int 7_000) - ; ("min_proposal_quorum", int 500); ("initial_endorsers", int 1) - ; ("delay_per_missing_endorsement", string (Int.to_string 1)) ] in + alpha_specific_parameters + @ legacy_parameters + @ [ ("blocks_per_commitment", int 4); ("endorsers_per_block", int 32) + ; ("hard_gas_limit_per_operation", string (Int.to_string op_gas_limit)) + ; ("hard_gas_limit_per_block", string (Int.to_string block_gas_limit)) + ; ("tokens_per_roll", string (Int.to_string 8_000_000_000)) + ; ("michelson_maximum_type_size", int 1_000) + ; ("seed_nonce_revelation_tip", string (Int.to_string 125_000)) + ; ("origination_size", int 257) + ; ("block_security_deposit", string (Int.to_string 512_000_000)) + ; ("endorsement_security_deposit", string (Int.to_string 64_000_000)) + ; ( match subkind with + | `Babylon -> ("block_reward", string (Int.to_string 16_000_000)) + | `Carthage | `Delphi | `Edo | `Florence | `Alpha -> + ( "baking_reward_per_endorsement" + , list_of_zs t.baking_reward_per_endorsement ) ) + ; ( "endorsement_reward" + , match subkind with + | `Babylon -> string (Int.to_string 2_000_000) + | `Carthage | `Delphi | `Edo | `Florence | `Alpha -> list_of_zs t.endorsement_reward + ); ("hard_storage_limit_per_operation", string (Int.to_string 60_000)) + ; ( "cost_per_byte" + , match subkind with + | `Babylon | `Carthage -> string (Int.to_string 1_000) + | `Delphi | `Edo | `Florence | `Alpha -> string (Int.to_string 250) ) + ; ("quorum_min", int 3_000); ("quorum_max", int 7_000) + ; ("min_proposal_quorum", int 500); ("initial_endorsers", int 1) + ; ("delay_per_missing_endorsement", string (Int.to_string 1)) ] in let common = [ ( "bootstrap_accounts" , list make_account (t.bootstrap_accounts @ [(t.dictator, 10_000_000L)])