123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778(*****************************************************************************)(* *)(* Open Source License *)(* Copyright (c) 2023 Nomadic Labs <contact@nomadic-labs.com> *)(* *)(* 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. *)(* *)(*****************************************************************************)typefa12_script={name:stringlist;build_storage:Account.key->string;mint_entrypoint:string;mint_arg:Account.key->Tez.t->string;}letfa12_reference={name=["mini_scenarios";"fa12_reference"];build_storage=(funadmin->sf{|Pair {} (Pair "%s" (Pair False 0))|}admin.public_key_hash);mint_entrypoint="mint";mint_arg=(funowneramount->sf{|(Pair "%s" %d)|}owner.public_key_hash(Tez.to_mutezamount));}letlqt_fa12={name=["mini_scenarios";"lqt_fa12.mligo"];build_storage=(funadmin->sf{|Pair {} {} "%s" 0|}admin.public_key_hash);mint_entrypoint="mintOrBurn";mint_arg=(funowneramount->sf{|(Pair %d "%s")|}(Tez.to_mutezamount)owner.public_key_hash);}letfa12_scripts=[fa12_reference;lqt_fa12]letoriginate_fa12~src~admin~fa12_scriptclientprotocol=letinitial_storage=fa12_script.build_storageadmininClient.originate_contract_at~amount:Tez.zero~src~init:initial_storage~burn_cap:(Tez.of_int2)clientfa12_script.nameprotocolletmint~admin~mint~dest~fa12_address~fa12_scriptclient=letmint_arg=fa12_script.mint_argdestmintinClient.transfer~amount:Tez.zero~giver:admin.Account.public_key_hash~receiver:fa12_address~entrypoint:fa12_script.mint_entrypoint~arg:mint_arg~burn_cap:Tez.oneclient