[
  {
    "path": ".env.example",
    "content": "DEPLOYER_MNEMONIC=\nADMIN_ADDRESS=\n# API_KEY=\nTESTNET=yes\n# MAINNET=no"
  },
  {
    "path": ".gitignore",
    "content": "build/*.fif\nbuild/*.cell\nnode_modules\n.env*\n!.env.example\n.wget-hsts\nbin\n.vs_code\n/.idea\n.DS_Store\n"
  },
  {
    "path": "LICENSE",
    "content": "                    GNU GENERAL PUBLIC LICENSE\n                       Version 3, 29 June 2007\n\n Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n                            Preamble\n\n  The GNU General Public License is a free, copyleft license for\nsoftware and other kinds of works.\n\n  The licenses for most software and other practical works are designed\nto take away your freedom to share and change the works.  By contrast,\nthe GNU General Public License is intended to guarantee your freedom to\nshare and change all versions of a program--to make sure it remains free\nsoftware for all its users.  We, the Free Software Foundation, use the\nGNU General Public License for most of our software; it applies also to\nany other work released this way by its authors.  You can apply it to\nyour programs, too.\n\n  When we speak of free software, we are referring to freedom, not\nprice.  Our General Public Licenses are designed to make sure that you\nhave the freedom to distribute copies of free software (and charge for\nthem if you wish), that you receive source code or can get it if you\nwant it, that you can change the software or use pieces of it in new\nfree programs, and that you know you can do these things.\n\n  To protect your rights, we need to prevent others from denying you\nthese rights or asking you to surrender the rights.  Therefore, you have\ncertain responsibilities if you distribute copies of the software, or if\nyou modify it: responsibilities to respect the freedom of others.\n\n  For example, if you distribute copies of such a program, whether\ngratis or for a fee, you must pass on to the recipients the same\nfreedoms that you received.  You must make sure that they, too, receive\nor can get the source code.  And you must show them these terms so they\nknow their rights.\n\n  Developers that use the GNU GPL protect your rights with two steps:\n(1) assert copyright on the software, and (2) offer you this License\ngiving you legal permission to copy, distribute and/or modify it.\n\n  For the developers' and authors' protection, the GPL clearly explains\nthat there is no warranty for this free software.  For both users' and\nauthors' sake, the GPL requires that modified versions be marked as\nchanged, so that their problems will not be attributed erroneously to\nauthors of previous versions.\n\n  Some devices are designed to deny users access to install or run\nmodified versions of the software inside them, although the manufacturer\ncan do so.  This is fundamentally incompatible with the aim of\nprotecting users' freedom to change the software.  The systematic\npattern of such abuse occurs in the area of products for individuals to\nuse, which is precisely where it is most unacceptable.  Therefore, we\nhave designed this version of the GPL to prohibit the practice for those\nproducts.  If such problems arise substantially in other domains, we\nstand ready to extend this provision to those domains in future versions\nof the GPL, as needed to protect the freedom of users.\n\n  Finally, every program is threatened constantly by software patents.\nStates should not allow patents to restrict development and use of\nsoftware on general-purpose computers, but in those that do, we wish to\navoid the special danger that patents applied to a free program could\nmake it effectively proprietary.  To prevent this, the GPL assures that\npatents cannot be used to render the program non-free.\n\n  The precise terms and conditions for copying, distribution and\nmodification follow.\n\n                       TERMS AND CONDITIONS\n\n  0. Definitions.\n\n  \"This License\" refers to version 3 of the GNU General Public License.\n\n  \"Copyright\" also means copyright-like laws that apply to other kinds of\nworks, such as semiconductor masks.\n\n  \"The Program\" refers to any copyrightable work licensed under this\nLicense.  Each licensee is addressed as \"you\".  \"Licensees\" and\n\"recipients\" may be individuals or organizations.\n\n  To \"modify\" a work means to copy from or adapt all or part of the work\nin a fashion requiring copyright permission, other than the making of an\nexact copy.  The resulting work is called a \"modified version\" of the\nearlier work or a work \"based on\" the earlier work.\n\n  A \"covered work\" means either the unmodified Program or a work based\non the Program.\n\n  To \"propagate\" a work means to do anything with it that, without\npermission, would make you directly or secondarily liable for\ninfringement under applicable copyright law, except executing it on a\ncomputer or modifying a private copy.  Propagation includes copying,\ndistribution (with or without modification), making available to the\npublic, and in some countries other activities as well.\n\n  To \"convey\" a work means any kind of propagation that enables other\nparties to make or receive copies.  Mere interaction with a user through\na computer network, with no transfer of a copy, is not conveying.\n\n  An interactive user interface displays \"Appropriate Legal Notices\"\nto the extent that it includes a convenient and prominently visible\nfeature that (1) displays an appropriate copyright notice, and (2)\ntells the user that there is no warranty for the work (except to the\nextent that warranties are provided), that licensees may convey the\nwork under this License, and how to view a copy of this License.  If\nthe interface presents a list of user commands or options, such as a\nmenu, a prominent item in the list meets this criterion.\n\n  1. Source Code.\n\n  The \"source code\" for a work means the preferred form of the work\nfor making modifications to it.  \"Object code\" means any non-source\nform of a work.\n\n  A \"Standard Interface\" means an interface that either is an official\nstandard defined by a recognized standards body, or, in the case of\ninterfaces specified for a particular programming language, one that\nis widely used among developers working in that language.\n\n  The \"System Libraries\" of an executable work include anything, other\nthan the work as a whole, that (a) is included in the normal form of\npackaging a Major Component, but which is not part of that Major\nComponent, and (b) serves only to enable use of the work with that\nMajor Component, or to implement a Standard Interface for which an\nimplementation is available to the public in source code form.  A\n\"Major Component\", in this context, means a major essential component\n(kernel, window system, and so on) of the specific operating system\n(if any) on which the executable work runs, or a compiler used to\nproduce the work, or an object code interpreter used to run it.\n\n  The \"Corresponding Source\" for a work in object code form means all\nthe source code needed to generate, install, and (for an executable\nwork) run the object code and to modify the work, including scripts to\ncontrol those activities.  However, it does not include the work's\nSystem Libraries, or general-purpose tools or generally available free\nprograms which are used unmodified in performing those activities but\nwhich are not part of the work.  For example, Corresponding Source\nincludes interface definition files associated with source files for\nthe work, and the source code for shared libraries and dynamically\nlinked subprograms that the work is specifically designed to require,\nsuch as by intimate data communication or control flow between those\nsubprograms and other parts of the work.\n\n  The Corresponding Source need not include anything that users\ncan regenerate automatically from other parts of the Corresponding\nSource.\n\n  The Corresponding Source for a work in source code form is that\nsame work.\n\n  2. Basic Permissions.\n\n  All rights granted under this License are granted for the term of\ncopyright on the Program, and are irrevocable provided the stated\nconditions are met.  This License explicitly affirms your unlimited\npermission to run the unmodified Program.  The output from running a\ncovered work is covered by this License only if the output, given its\ncontent, constitutes a covered work.  This License acknowledges your\nrights of fair use or other equivalent, as provided by copyright law.\n\n  You may make, run and propagate covered works that you do not\nconvey, without conditions so long as your license otherwise remains\nin force.  You may convey covered works to others for the sole purpose\nof having them make modifications exclusively for you, or provide you\nwith facilities for running those works, provided that you comply with\nthe terms of this License in conveying all material for which you do\nnot control copyright.  Those thus making or running the covered works\nfor you must do so exclusively on your behalf, under your direction\nand control, on terms that prohibit them from making any copies of\nyour copyrighted material outside their relationship with you.\n\n  Conveying under any other circumstances is permitted solely under\nthe conditions stated below.  Sublicensing is not allowed; section 10\nmakes it unnecessary.\n\n  3. Protecting Users' Legal Rights From Anti-Circumvention Law.\n\n  No covered work shall be deemed part of an effective technological\nmeasure under any applicable law fulfilling obligations under article\n11 of the WIPO copyright treaty adopted on 20 December 1996, or\nsimilar laws prohibiting or restricting circumvention of such\nmeasures.\n\n  When you convey a covered work, you waive any legal power to forbid\ncircumvention of technological measures to the extent such circumvention\nis effected by exercising rights under this License with respect to\nthe covered work, and you disclaim any intention to limit operation or\nmodification of the work as a means of enforcing, against the work's\nusers, your or third parties' legal rights to forbid circumvention of\ntechnological measures.\n\n  4. Conveying Verbatim Copies.\n\n  You may convey verbatim copies of the Program's source code as you\nreceive it, in any medium, provided that you conspicuously and\nappropriately publish on each copy an appropriate copyright notice;\nkeep intact all notices stating that this License and any\nnon-permissive terms added in accord with section 7 apply to the code;\nkeep intact all notices of the absence of any warranty; and give all\nrecipients a copy of this License along with the Program.\n\n  You may charge any price or no price for each copy that you convey,\nand you may offer support or warranty protection for a fee.\n\n  5. Conveying Modified Source Versions.\n\n  You may convey a work based on the Program, or the modifications to\nproduce it from the Program, in the form of source code under the\nterms of section 4, provided that you also meet all of these conditions:\n\n    a) The work must carry prominent notices stating that you modified\n    it, and giving a relevant date.\n\n    b) The work must carry prominent notices stating that it is\n    released under this License and any conditions added under section\n    7.  This requirement modifies the requirement in section 4 to\n    \"keep intact all notices\".\n\n    c) You must license the entire work, as a whole, under this\n    License to anyone who comes into possession of a copy.  This\n    License will therefore apply, along with any applicable section 7\n    additional terms, to the whole of the work, and all its parts,\n    regardless of how they are packaged.  This License gives no\n    permission to license the work in any other way, but it does not\n    invalidate such permission if you have separately received it.\n\n    d) If the work has interactive user interfaces, each must display\n    Appropriate Legal Notices; however, if the Program has interactive\n    interfaces that do not display Appropriate Legal Notices, your\n    work need not make them do so.\n\n  A compilation of a covered work with other separate and independent\nworks, which are not by their nature extensions of the covered work,\nand which are not combined with it such as to form a larger program,\nin or on a volume of a storage or distribution medium, is called an\n\"aggregate\" if the compilation and its resulting copyright are not\nused to limit the access or legal rights of the compilation's users\nbeyond what the individual works permit.  Inclusion of a covered work\nin an aggregate does not cause this License to apply to the other\nparts of the aggregate.\n\n  6. Conveying Non-Source Forms.\n\n  You may convey a covered work in object code form under the terms\nof sections 4 and 5, provided that you also convey the\nmachine-readable Corresponding Source under the terms of this License,\nin one of these ways:\n\n    a) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by the\n    Corresponding Source fixed on a durable physical medium\n    customarily used for software interchange.\n\n    b) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by a\n    written offer, valid for at least three years and valid for as\n    long as you offer spare parts or customer support for that product\n    model, to give anyone who possesses the object code either (1) a\n    copy of the Corresponding Source for all the software in the\n    product that is covered by this License, on a durable physical\n    medium customarily used for software interchange, for a price no\n    more than your reasonable cost of physically performing this\n    conveying of source, or (2) access to copy the\n    Corresponding Source from a network server at no charge.\n\n    c) Convey individual copies of the object code with a copy of the\n    written offer to provide the Corresponding Source.  This\n    alternative is allowed only occasionally and noncommercially, and\n    only if you received the object code with such an offer, in accord\n    with subsection 6b.\n\n    d) Convey the object code by offering access from a designated\n    place (gratis or for a charge), and offer equivalent access to the\n    Corresponding Source in the same way through the same place at no\n    further charge.  You need not require recipients to copy the\n    Corresponding Source along with the object code.  If the place to\n    copy the object code is a network server, the Corresponding Source\n    may be on a different server (operated by you or a third party)\n    that supports equivalent copying facilities, provided you maintain\n    clear directions next to the object code saying where to find the\n    Corresponding Source.  Regardless of what server hosts the\n    Corresponding Source, you remain obligated to ensure that it is\n    available for as long as needed to satisfy these requirements.\n\n    e) Convey the object code using peer-to-peer transmission, provided\n    you inform other peers where the object code and Corresponding\n    Source of the work are being offered to the general public at no\n    charge under subsection 6d.\n\n  A separable portion of the object code, whose source code is excluded\nfrom the Corresponding Source as a System Library, need not be\nincluded in conveying the object code work.\n\n  A \"User Product\" is either (1) a \"consumer product\", which means any\ntangible personal property which is normally used for personal, family,\nor household purposes, or (2) anything designed or sold for incorporation\ninto a dwelling.  In determining whether a product is a consumer product,\ndoubtful cases shall be resolved in favor of coverage.  For a particular\nproduct received by a particular user, \"normally used\" refers to a\ntypical or common use of that class of product, regardless of the status\nof the particular user or of the way in which the particular user\nactually uses, or expects or is expected to use, the product.  A product\nis a consumer product regardless of whether the product has substantial\ncommercial, industrial or non-consumer uses, unless such uses represent\nthe only significant mode of use of the product.\n\n  \"Installation Information\" for a User Product means any methods,\nprocedures, authorization keys, or other information required to install\nand execute modified versions of a covered work in that User Product from\na modified version of its Corresponding Source.  The information must\nsuffice to ensure that the continued functioning of the modified object\ncode is in no case prevented or interfered with solely because\nmodification has been made.\n\n  If you convey an object code work under this section in, or with, or\nspecifically for use in, a User Product, and the conveying occurs as\npart of a transaction in which the right of possession and use of the\nUser Product is transferred to the recipient in perpetuity or for a\nfixed term (regardless of how the transaction is characterized), the\nCorresponding Source conveyed under this section must be accompanied\nby the Installation Information.  But this requirement does not apply\nif neither you nor any third party retains the ability to install\nmodified object code on the User Product (for example, the work has\nbeen installed in ROM).\n\n  The requirement to provide Installation Information does not include a\nrequirement to continue to provide support service, warranty, or updates\nfor a work that has been modified or installed by the recipient, or for\nthe User Product in which it has been modified or installed.  Access to a\nnetwork may be denied when the modification itself materially and\nadversely affects the operation of the network or violates the rules and\nprotocols for communication across the network.\n\n  Corresponding Source conveyed, and Installation Information provided,\nin accord with this section must be in a format that is publicly\ndocumented (and with an implementation available to the public in\nsource code form), and must require no special password or key for\nunpacking, reading or copying.\n\n  7. Additional Terms.\n\n  \"Additional permissions\" are terms that supplement the terms of this\nLicense by making exceptions from one or more of its conditions.\nAdditional permissions that are applicable to the entire Program shall\nbe treated as though they were included in this License, to the extent\nthat they are valid under applicable law.  If additional permissions\napply only to part of the Program, that part may be used separately\nunder those permissions, but the entire Program remains governed by\nthis License without regard to the additional permissions.\n\n  When you convey a copy of a covered work, you may at your option\nremove any additional permissions from that copy, or from any part of\nit.  (Additional permissions may be written to require their own\nremoval in certain cases when you modify the work.)  You may place\nadditional permissions on material, added by you to a covered work,\nfor which you have or can give appropriate copyright permission.\n\n  Notwithstanding any other provision of this License, for material you\nadd to a covered work, you may (if authorized by the copyright holders of\nthat material) supplement the terms of this License with terms:\n\n    a) Disclaiming warranty or limiting liability differently from the\n    terms of sections 15 and 16 of this License; or\n\n    b) Requiring preservation of specified reasonable legal notices or\n    author attributions in that material or in the Appropriate Legal\n    Notices displayed by works containing it; or\n\n    c) Prohibiting misrepresentation of the origin of that material, or\n    requiring that modified versions of such material be marked in\n    reasonable ways as different from the original version; or\n\n    d) Limiting the use for publicity purposes of names of licensors or\n    authors of the material; or\n\n    e) Declining to grant rights under trademark law for use of some\n    trade names, trademarks, or service marks; or\n\n    f) Requiring indemnification of licensors and authors of that\n    material by anyone who conveys the material (or modified versions of\n    it) with contractual assumptions of liability to the recipient, for\n    any liability that these contractual assumptions directly impose on\n    those licensors and authors.\n\n  All other non-permissive additional terms are considered \"further\nrestrictions\" within the meaning of section 10.  If the Program as you\nreceived it, or any part of it, contains a notice stating that it is\ngoverned by this License along with a term that is a further\nrestriction, you may remove that term.  If a license document contains\na further restriction but permits relicensing or conveying under this\nLicense, you may add to a covered work material governed by the terms\nof that license document, provided that the further restriction does\nnot survive such relicensing or conveying.\n\n  If you add terms to a covered work in accord with this section, you\nmust place, in the relevant source files, a statement of the\nadditional terms that apply to those files, or a notice indicating\nwhere to find the applicable terms.\n\n  Additional terms, permissive or non-permissive, may be stated in the\nform of a separately written license, or stated as exceptions;\nthe above requirements apply either way.\n\n  8. Termination.\n\n  You may not propagate or modify a covered work except as expressly\nprovided under this License.  Any attempt otherwise to propagate or\nmodify it is void, and will automatically terminate your rights under\nthis License (including any patent licenses granted under the third\nparagraph of section 11).\n\n  However, if you cease all violation of this License, then your\nlicense from a particular copyright holder is reinstated (a)\nprovisionally, unless and until the copyright holder explicitly and\nfinally terminates your license, and (b) permanently, if the copyright\nholder fails to notify you of the violation by some reasonable means\nprior to 60 days after the cessation.\n\n  Moreover, your license from a particular copyright holder is\nreinstated permanently if the copyright holder notifies you of the\nviolation by some reasonable means, this is the first time you have\nreceived notice of violation of this License (for any work) from that\ncopyright holder, and you cure the violation prior to 30 days after\nyour receipt of the notice.\n\n  Termination of your rights under this section does not terminate the\nlicenses of parties who have received copies or rights from you under\nthis License.  If your rights have been terminated and not permanently\nreinstated, you do not qualify to receive new licenses for the same\nmaterial under section 10.\n\n  9. Acceptance Not Required for Having Copies.\n\n  You are not required to accept this License in order to receive or\nrun a copy of the Program.  Ancillary propagation of a covered work\noccurring solely as a consequence of using peer-to-peer transmission\nto receive a copy likewise does not require acceptance.  However,\nnothing other than this License grants you permission to propagate or\nmodify any covered work.  These actions infringe copyright if you do\nnot accept this License.  Therefore, by modifying or propagating a\ncovered work, you indicate your acceptance of this License to do so.\n\n  10. Automatic Licensing of Downstream Recipients.\n\n  Each time you convey a covered work, the recipient automatically\nreceives a license from the original licensors, to run, modify and\npropagate that work, subject to this License.  You are not responsible\nfor enforcing compliance by third parties with this License.\n\n  An \"entity transaction\" is a transaction transferring control of an\norganization, or substantially all assets of one, or subdividing an\norganization, or merging organizations.  If propagation of a covered\nwork results from an entity transaction, each party to that\ntransaction who receives a copy of the work also receives whatever\nlicenses to the work the party's predecessor in interest had or could\ngive under the previous paragraph, plus a right to possession of the\nCorresponding Source of the work from the predecessor in interest, if\nthe predecessor has it or can get it with reasonable efforts.\n\n  You may not impose any further restrictions on the exercise of the\nrights granted or affirmed under this License.  For example, you may\nnot impose a license fee, royalty, or other charge for exercise of\nrights granted under this License, and you may not initiate litigation\n(including a cross-claim or counterclaim in a lawsuit) alleging that\nany patent claim is infringed by making, using, selling, offering for\nsale, or importing the Program or any portion of it.\n\n  11. Patents.\n\n  A \"contributor\" is a copyright holder who authorizes use under this\nLicense of the Program or a work on which the Program is based.  The\nwork thus licensed is called the contributor's \"contributor version\".\n\n  A contributor's \"essential patent claims\" are all patent claims\nowned or controlled by the contributor, whether already acquired or\nhereafter acquired, that would be infringed by some manner, permitted\nby this License, of making, using, or selling its contributor version,\nbut do not include claims that would be infringed only as a\nconsequence of further modification of the contributor version.  For\npurposes of this definition, \"control\" includes the right to grant\npatent sublicenses in a manner consistent with the requirements of\nthis License.\n\n  Each contributor grants you a non-exclusive, worldwide, royalty-free\npatent license under the contributor's essential patent claims, to\nmake, use, sell, offer for sale, import and otherwise run, modify and\npropagate the contents of its contributor version.\n\n  In the following three paragraphs, a \"patent license\" is any express\nagreement or commitment, however denominated, not to enforce a patent\n(such as an express permission to practice a patent or covenant not to\nsue for patent infringement).  To \"grant\" such a patent license to a\nparty means to make such an agreement or commitment not to enforce a\npatent against the party.\n\n  If you convey a covered work, knowingly relying on a patent license,\nand the Corresponding Source of the work is not available for anyone\nto copy, free of charge and under the terms of this License, through a\npublicly available network server or other readily accessible means,\nthen you must either (1) cause the Corresponding Source to be so\navailable, or (2) arrange to deprive yourself of the benefit of the\npatent license for this particular work, or (3) arrange, in a manner\nconsistent with the requirements of this License, to extend the patent\nlicense to downstream recipients.  \"Knowingly relying\" means you have\nactual knowledge that, but for the patent license, your conveying the\ncovered work in a country, or your recipient's use of the covered work\nin a country, would infringe one or more identifiable patents in that\ncountry that you have reason to believe are valid.\n\n  If, pursuant to or in connection with a single transaction or\narrangement, you convey, or propagate by procuring conveyance of, a\ncovered work, and grant a patent license to some of the parties\nreceiving the covered work authorizing them to use, propagate, modify\nor convey a specific copy of the covered work, then the patent license\nyou grant is automatically extended to all recipients of the covered\nwork and works based on it.\n\n  A patent license is \"discriminatory\" if it does not include within\nthe scope of its coverage, prohibits the exercise of, or is\nconditioned on the non-exercise of one or more of the rights that are\nspecifically granted under this License.  You may not convey a covered\nwork if you are a party to an arrangement with a third party that is\nin the business of distributing software, under which you make payment\nto the third party based on the extent of your activity of conveying\nthe work, and under which the third party grants, to any of the\nparties who would receive the covered work from you, a discriminatory\npatent license (a) in connection with copies of the covered work\nconveyed by you (or copies made from those copies), or (b) primarily\nfor and in connection with specific products or compilations that\ncontain the covered work, unless you entered into that arrangement,\nor that patent license was granted, prior to 28 March 2007.\n\n  Nothing in this License shall be construed as excluding or limiting\nany implied license or other defenses to infringement that may\notherwise be available to you under applicable patent law.\n\n  12. No Surrender of Others' Freedom.\n\n  If conditions are imposed on you (whether by court order, agreement or\notherwise) that contradict the conditions of this License, they do not\nexcuse you from the conditions of this License.  If you cannot convey a\ncovered work so as to satisfy simultaneously your obligations under this\nLicense and any other pertinent obligations, then as a consequence you may\nnot convey it at all.  For example, if you agree to terms that obligate you\nto collect a royalty for further conveying from those to whom you convey\nthe Program, the only way you could satisfy both those terms and this\nLicense would be to refrain entirely from conveying the Program.\n\n  13. Use with the GNU Affero General Public License.\n\n  Notwithstanding any other provision of this License, you have\npermission to link or combine any covered work with a work licensed\nunder version 3 of the GNU Affero General Public License into a single\ncombined work, and to convey the resulting work.  The terms of this\nLicense will continue to apply to the part which is the covered work,\nbut the special requirements of the GNU Affero General Public License,\nsection 13, concerning interaction through a network will apply to the\ncombination as such.\n\n  14. Revised Versions of this License.\n\n  The Free Software Foundation may publish revised and/or new versions of\nthe GNU General Public License from time to time.  Such new versions will\nbe similar in spirit to the present version, but may differ in detail to\naddress new problems or concerns.\n\n  Each version is given a distinguishing version number.  If the\nProgram specifies that a certain numbered version of the GNU General\nPublic License \"or any later version\" applies to it, you have the\noption of following the terms and conditions either of that numbered\nversion or of any later version published by the Free Software\nFoundation.  If the Program does not specify a version number of the\nGNU General Public License, you may choose any version ever published\nby the Free Software Foundation.\n\n  If the Program specifies that a proxy can decide which future\nversions of the GNU General Public License can be used, that proxy's\npublic statement of acceptance of a version permanently authorizes you\nto choose that version for the Program.\n\n  Later license versions may give you additional or different\npermissions.  However, no additional obligations are imposed on any\nauthor or copyright holder as a result of your choosing to follow a\nlater version.\n\n  15. Disclaimer of Warranty.\n\n  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY\nAPPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT\nHOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY\nOF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,\nTHE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM\nIS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF\nALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\n  16. Limitation of Liability.\n\n  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\nWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS\nTHE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY\nGENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE\nUSE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF\nDATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD\nPARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),\nEVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF\nSUCH DAMAGES.\n\n  17. Interpretation of Sections 15 and 16.\n\n  If the disclaimer of warranty and limitation of liability provided\nabove cannot be given local legal effect according to their terms,\nreviewing courts shall apply local law that most closely approximates\nan absolute waiver of all civil liability in connection with the\nProgram, unless a warranty or assumption of liability accompanies a\ncopy of the Program in return for a fee.\n\n                     END OF TERMS AND CONDITIONS\n\n            How to Apply These Terms to Your New Programs\n\n  If you develop a new program, and you want it to be of the greatest\npossible use to the public, the best way to achieve this is to make it\nfree software which everyone can redistribute and change under these terms.\n\n  To do so, attach the following notices to the program.  It is safest\nto attach them to the start of each source file to most effectively\nstate the exclusion of warranty; and each file should have at least\nthe \"copyright\" line and a pointer to where the full notice is found.\n\n    <one line to give the program's name and a brief idea of what it does.>\n    Copyright (C) <year>  <name of author>\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with this program.  If not, see <https://www.gnu.org/licenses/>.\n\nAlso add information on how to contact you by electronic and paper mail.\n\n  If the program does terminal interaction, make it output a short\nnotice like this when it starts in an interactive mode:\n\n    <program>  Copyright (C) <year>  <name of author>\n    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\n    This is free software, and you are welcome to redistribute it\n    under certain conditions; type `show c' for details.\n\nThe hypothetical commands `show w' and `show c' should show the appropriate\nparts of the General Public License.  Of course, your program's commands\nmight be different; for a GUI interface, you would use an \"about box\".\n\n  You should also get your employer (if you work as a programmer) or school,\nif any, to sign a \"copyright disclaimer\" for the program, if necessary.\nFor more information on this, and how to apply and follow the GNU GPL, see\n<https://www.gnu.org/licenses/>.\n\n  The GNU General Public License does not permit incorporating your program\ninto proprietary programs.  If your program is a subroutine library, you\nmay consider it more useful to permit linking proprietary applications with\nthe library.  If this is what you want to do, use the GNU Lesser General\nPublic License instead of this License.  But first, please read\n<https://www.gnu.org/licenses/why-not-lgpl.html>.\n"
  },
  {
    "path": "README.md",
    "content": "# STON.fi Decentralized Exchange\n[![TON](https://img.shields.io/badge/based%20on-TON-blue)](https://ton.org/)\n[![License](https://img.shields.io/badge/license-GPL--3.0-brightgreen)](https://opensource.org/licenses/GPL-3.0)\n\nCore contracts for the STON.fi DEX protocol.\n\n## Contract deployments\nThe current version of DEX contracts are deployed at the following addresses:\n- `EQB3ncyBUTjZUA5EnFKR5_EnOMI9V1tTEAAPaiU71gc4TiUt` for [mainnet](https://tonscan.org/address/EQB3ncyBUTjZUA5EnFKR5_EnOMI9V1tTEAAPaiU71gc4TiUt)\n- `EQBsGx9ArADUrREB34W-ghgsCgBShvfUr4Jvlu-0KGc33Rbt` for [testnet](https://testnet.tonscan.org/address/EQBsGx9ArADUrREB34W-ghgsCgBShvfUr4Jvlu-0KGc33Rbt) \n\nIt was built from tag [v1.0.0](https://github.com/ston-fi/dex-core/releases/tag/v1.0.0).\n\n## Local Development\nThe following assumes the use of `node@>=16`.\n\n### Install Dependencies\n`npm install`\n\n### Compile Contracts\n`npm run build`\n\n### Run Tests\n`npm run test`\n\n### Deploy Contracts\n`npm run deploy`\n\n## Security\nThis repository is subject to STON.fi bug bounty program, see [here](https://github.com/ston-fi/bug-bounty) for more info.\nSecurity vulnerabilities should be disclosed to the project maintainers by email to security@ston.fi.\n\n## Licensing\nThe license for STON.fi Decentralized Exchange is the GNU General Public License v3.0 (GPL-3.0), see [LICENSE](LICENSE).\n"
  },
  {
    "path": "build/_build.ts",
    "content": "import fs from \"fs\";\nimport path from \"path\";\nimport glob from \"fast-glob\";\nimport { compileContract } from \"ton-compiler\";\n\nasync function main() {\n  console.log(`=================================================================`);\n  console.log(`Build script running, let's find some FunC contracts to compile..`);\n\n  // go over all the root contracts in the contracts directory\n  const rootContracts = glob.sync([\"contracts/*.fc\", \"contracts/*.func\"]);\n\n  for (const rootContract of rootContracts) {\n    const contractName = path.parse(rootContract).name;\n    if (contractName == \"common\") break;\n    console.log(`\\n* Found contract '${contractName}' - let's compile it:`);\n\n    let result = await compileContract({\n      files: [rootContract],\n    });\n\n    if (!result.ok) {\n      console.error(`\\n* Compilation failed!`);\n      console.error(result.log);\n      return;\n    }\n\n    console.log(` - Deleting old build artifact...`);\n    glob.sync([`build/${contractName}.cell`, `build/${contractName}.fif`]).map((f) => {\n      fs.unlinkSync(f);\n    });\n\n    let fiftCellSource = '\"Asm.fif\" include\\n' + result.fift + \"\\n\";\n    fs.writeFileSync(`build/${contractName}.fif`, fiftCellSource.replace(/\\\\n/g, \"\\n\"), \"utf8\");\n    fs.writeFileSync(`build/${contractName}.cell`, result.output as Buffer);\n  }\n\n  console.log(``);\n}\n\nmain();\n"
  },
  {
    "path": "build/_deploy.ts",
    "content": "import axios from \"axios\";\nimport axiosThrottle from \"axios-request-throttle\";\naxiosThrottle.use(axios, { requestsPerSecond: 0.5 });\n\nimport dotenv from \"dotenv\";\ndotenv.config();\n\nimport fs from \"fs\";\nimport path from \"path\";\nimport glob from \"fast-glob\";\nimport { Address, Cell, CellMessage, CommonMessageInfo, fromNano, InternalMessage, StateInit, toNano } from \"ton\";\nimport { TonClient, WalletContract, WalletV3R2Source, contractAddress, SendMode } from \"ton\";\nimport { mnemonicNew, mnemonicToWalletKey } from \"ton-crypto\";\n\nasync function main() {\n  console.log(`=================================================================`);\n  console.log(`Deploy script running, let's find some contracts to deploy..`);\n\n  let chain: string,\n    endpointUrl: string;\n  if (process.env.TESTNET || process.env.npm_lifecycle_event == \"deploy:testnet\") {\n    console.log(`\\n* We are working with 'testnet' (https://t.me/testgiver_ton_bot will give you testnet TON)`);\n    endpointUrl = \"https://testnet.toncenter.com/api/v2/jsonRPC\";\n  } else {\n    console.log(`\\n* We are working with 'mainnet'`);\n    endpointUrl = \"https://mainnet.tonhubapi.com/jsonRPC\";\n  }\n\n  // initialize globals\n  const client = new TonClient({ endpoint: endpointUrl, apiKey: process.env.API_KEY });\n  const newContractFunding = toNano(0.1); // this will be (almost in full) the balance of a new deployed contract and allow it to pay rent\n  const workchain = 0;\n\n  const deployConfigEnv = \".env\";\n  let deployerMnemonic;\n  if (!process.env.DEPLOYER_MNEMONIC) {\n    console.log(` - ERROR: No DEPLOYER_MNEMONIC env variable found, please add it to env`);\n    process.exit(1);\n  } else {\n    console.log(`\\n* Config file '${deployConfigEnv}' found and will be used for deployment!`);\n    deployerMnemonic = process.env.DEPLOYER_MNEMONIC;\n  }\n\n  // open the wallet and make sure it has enough TON\n  const walletKey = await mnemonicToWalletKey(deployerMnemonic.split(\" \"));\n  const walletContract = WalletContract.create(client, WalletV3R2Source.create({ publicKey: walletKey.publicKey, workchain }));\n  console.log(` - Wallet address used to deploy from is: ${walletContract.address.toFriendly()}`);\n  const walletBalance = await client.getBalance(walletContract.address);\n  await sleep(3 * 1000);\n  if (walletBalance.lt(toNano(0.2))) {\n    console.log(` - ERROR: Wallet has less than 0.2 TON for gas (${fromNano(walletBalance)} TON), please send some TON for gas first`);\n    process.exit(1);\n  } else {\n    console.log(` - Wallet balance is ${fromNano(walletBalance)} TON, which will be used for gas`);\n  }\n\n  const rootContracts = glob.sync([\"build/*.deploy.ts\"]);\n  for (const rootContract of rootContracts) {\n    console.log(`\\n* Found root contract '${rootContract} - let's deploy it':`);\n    const contractName = path.parse(path.parse(rootContract).name).name;\n\n    const deployInitScript = require(__dirname + \"/../\" + rootContract);\n    if (typeof deployInitScript.initData !== \"function\") {\n      console.log(` - ERROR: '${rootContract}' does not have 'initData()' function`);\n      process.exit(1);\n    }\n    const initDataCell = deployInitScript.initData() as Cell;\n\n    if (typeof deployInitScript.initMessage !== \"function\") {\n      console.log(` - ERROR: '${rootContract}' does not have 'initMessage()' function`);\n      process.exit(1);\n    }\n    const initMessageCell = deployInitScript.initMessage() as Cell | null;\n\n    const cellArtifact = `build/${contractName}.cell`;\n    if (!fs.existsSync(cellArtifact)) {\n      console.log(` - ERROR: '${cellArtifact}' not found, did you build?`);\n      process.exit(1);\n    }\n    const initCodeCell = Cell.fromBoc(fs.readFileSync(cellArtifact))[0];\n\n    const newContractAddress = contractAddress({ workchain, initialData: initDataCell, initialCode: initCodeCell });\n    console.log(` - Based on your init code+data, your new contract address is: ${newContractAddress.toFriendly()}`);\n    if (await client.isContractDeployed(newContractAddress)) {\n      console.log(` - Looks like the contract is already deployed in this address, skipping deployment`);\n      continue;\n    }\n    await sleep(2000);\n\n    console.log(` - Let's deploy the contract on-chain..`);\n    const seqno = await walletContract.getSeqNo();\n    await sleep(2000);\n\n    const transfer = walletContract.createTransfer({\n      secretKey: walletKey.secretKey,\n      seqno: seqno,\n      sendMode: SendMode.PAY_GAS_SEPARATLY + SendMode.IGNORE_ERRORS,\n      order: new InternalMessage({\n        to: newContractAddress,\n        value: newContractFunding,\n        bounce: false,\n        body: new CommonMessageInfo({\n          stateInit: new StateInit({ data: initDataCell, code: initCodeCell }),\n          body: initMessageCell !== null ? new CellMessage(initMessageCell) : null,\n        }),\n      }),\n    });\n    await client.sendExternalMessage(walletContract, transfer);\n    await sleep(1000);\n    console.log(` - Deploy transaction sent successfully`);\n\n    console.log(` - Waiting up to 75 seconds to check if the contract was actually deployed..`);\n    for (let attempt = 0; attempt < 30; attempt++) {\n      await sleep(2500);\n      const seqnoAfter = await walletContract.getSeqNo();\n      if (seqnoAfter > seqno) break;\n    }\n    await sleep(5 * 1000);\n    if (await client.isContractDeployed(newContractAddress)) {\n      console.log(` - SUCCESS! Contract deployed successfully to address: ${newContractAddress.toFriendly()}`);\n      await sleep(1000);\n      const contractBalance = await client.getBalance(newContractAddress);\n      console.log(` - New contract balance is now ${fromNano(contractBalance)} TON, make sure it has enough to pay rent`);\n    } else {\n      console.log(` - FAILURE! Contract address still looks uninitialized: ${newContractAddress.toFriendly()}`);\n    }\n  }\n\n  console.log(``);\n}\n\nmain();\n\nfunction sleep(ms: number) {\n  return new Promise((resolve) => setTimeout(resolve, ms));\n}\n"
  },
  {
    "path": "build/router.deploy.ts",
    "content": "import * as router from \"../contracts/router\";\nimport fs from \"fs\";\nimport { Address, TupleSlice, WalletContract, Cell, beginCell } from \"ton\";\nimport dotenv from \"dotenv\";\ndotenv.config();\n\nexport function initData() {\n  if (process.env.ADMIN_ADDRESS === undefined)\n    throw new Error(\"ADMIN_ADDRESS is not defined\");\n\n  return router.data({\n    isLocked: false,\n    adminAddress: Address.parseFriendly(process.env.ADMIN_ADDRESS).address,\n    LPWalletCode: Cell.fromBoc(fs.readFileSync(\"build/lp_wallet.cell\"))[0],\n    poolCode: Cell.fromBoc(fs.readFileSync(\"build/pool.cell\"))[0],\n    LPAccountCode: Cell.fromBoc(fs.readFileSync(\"build/lp_account.cell\"))[0],\n  });\n}\n\nexport function initMessage() {\n  return null;\n}\n"
  },
  {
    "path": "contracts/common/gas.func",
    "content": "cell get_gas_config_param(int wc) inline {\n    if (wc == -1) {\n        return config_param(20);\n    } else {\n        return config_param(21);\n    }\n}\n\n(slice, (int, int)) load_gas_flat_pfx(slice param) inline {\n    var flat_gas_limit = param~load_uint(64);\n    var flat_gas_price = param~load_uint(64);\n    return (param, (flat_gas_limit, flat_gas_price));\n}\n\n(slice, int) load_gas_prices(slice param) inline {\n    var gas_price = param~load_uint(64);\n    return (param, gas_price);\n}\n\n(slice, (int, int, int)) load_gas_limits_prices(slice param) inline_ref {\n    var contructor_tag = param~load_uint(8);\n    if (contructor_tag == 0xd1) {\n        var (flat_gas_limit, flat_gas_price) = param~load_gas_flat_pfx();\n        var (_, _, gas_price) = param~load_gas_limits_prices();\n        return (param, (flat_gas_limit, flat_gas_price, gas_price));\n    } elseif ((contructor_tag == 0xde) | (contructor_tag == 0xdd)) {\n        var gas_price = param~load_gas_prices();\n        return (param, (0, 0, gas_price));\n    } else {\n        return (param, (0, 0, 0));\n    }\n}\n\n(int, int, int) get_gas_limits_prices(int wc) inline {\n    var gas_price_config = get_gas_config_param(wc).begin_parse();\n    return gas_price_config~load_gas_limits_prices();\n}\n\nint get_gas_fee(int gas_amount, int wc) inline_ref {\n    var (flat_gas_limit, flat_gas_price, gas_price) = get_gas_limits_prices(wc);\n    return gas_amount < flat_gas_limit ? flat_gas_price : (gas_amount - flat_gas_limit) * (gas_price >> 16) + flat_gas_price;\n}"
  },
  {
    "path": "contracts/common/jetton-utils.func",
    "content": "(builder) create_simple_transfer_body(int query_id, int fwd_amount, int jetton_amount, slice to) inline {\n    return begin_cell()\n        .store_uint(0xf8a7ea5, 32)\n        .store_uint(query_id, 64)\n        .store_coins(jetton_amount)\n        .store_slice(to) ;; to_owner_address\n        .store_slice(to)\n        .store_uint(0, 1)\n        .store_coins(fwd_amount) ;; forward_ton_amount\n        .store_uint(0, 1);\n}"
  },
  {
    "path": "contracts/common/messages.func",
    "content": "const NORMAL = 0;\nconst PAID_EXTERNALLY = 1;\nconst IGNORE_ERRORS = 2;\n\nconst DESTROY_IF_ZERO = 32;\nconst CARRY_REMAINING_GAS = 64;\nconst CARRY_ALL_BALANCE = 128;\n\n() send_empty_message(int amount, slice to, int mode) impure inline_ref {\n    cell msg = begin_cell()\n        .store_uint(0x18, 6)\n        .store_slice(to)\n        .store_coins(amount)\n        .store_uint(0, 107)\n    .end_cell();\n    send_raw_message(msg, mode);\n}\n\n() send_simple_message(int amount, slice to, cell body, int mode) impure inline_ref {\n    cell msg = begin_cell()\n        .store_uint(0x18, 6)\n        .store_slice(to)\n        .store_coins(amount)\n        .store_uint(1, 107)\n        .store_ref(body)\n    .end_cell();\n    send_raw_message(msg, mode);\n}\n\n() send_message_nobounce(int amount, slice to, cell body, int mode) impure inline_ref {\n    cell msg = begin_cell()\n        .store_uint(0x10, 6)\n        .store_slice(to)\n        .store_coins(amount)\n        .store_uint(1, 107)\n        .store_ref(body)\n    .end_cell();\n    send_raw_message(msg, mode);\n}\n\n() send_message_with_stateinit(int amount, slice to, cell state_init, cell body, int mode) impure inline_ref {\n    cell msg = begin_cell()\n        .store_uint(0x18, 6)\n        .store_slice(to)\n        .store_coins(amount)\n        .store_uint(7, 108)\n        .store_ref(state_init)\n        .store_ref(body)\n    .end_cell();\n    send_raw_message(msg, mode);\n}"
  },
  {
    "path": "contracts/common/stdlib.func",
    "content": ";; sdlib++\n(int) equal_slices (slice s1, slice s2) asm \"SDEQ\";\n(int) mod (int x, int y) asm \"MOD\";\n(int) divc (int x, int y) asm \"DIVC\";\nslice preload_bits_offset(slice s, int offset, int len) asm \"SDSUBSTR\";"
  },
  {
    "path": "contracts/common/utils.func",
    "content": "const FWD_GAS = 35000000; ;; 0.04 TON\n\n() send_payload(slice caller, cell payload) impure inline_ref {\n  cell msg = begin_cell()\n    .store_uint(0x18, 6)\n    .store_slice(caller) \n    .store_coins(0) \n    .store_uint(1, 1 + 4 + 4 + 64 + 32 + 1 + 1)\n    .store_ref(payload)\n  .end_cell();\n  send_raw_message(msg, 128); ;; CARRY_ALL_BALANCE\n}\n\n(int) get_workchain(slice address) inline {\n  (int wc, _) = parse_std_addr(address);\n  return wc;\n}\n\n() force_chain(int workchain, slice address, int error_code) impure inline {\n  (int wc) = get_workchain(address);\n  throw_unless(error_code, wc == workchain);\n}\n"
  },
  {
    "path": "contracts/helpers.ts",
    "content": "import BN from \"bn.js\";\nimport { Builder, beginCell } from \"ton\";\n\nexport function beginMessage(params: { op: BN }): Builder {\n  return beginCell()\n    .storeUint(params.op, 32)\n    .storeUint(new BN(Math.floor(Math.random() * Math.pow(2, 31))), 64);\n}\n"
  },
  {
    "path": "contracts/lp_account/errors.func",
    "content": "const NO_LIQUIDITY = 80;\nconst ZERO_OUTPUT = 81;\nconst INVALID_CALLER = 82;\nconst INSUFFICIENT_GAS = 83;\nconst WRONG_WORKCHAIN = 85;\n\nconst WRONG_OP = 0xffff;\n"
  },
  {
    "path": "contracts/lp_account/get.func",
    "content": "(slice, slice, int, int) get_lp_account_data() method_id {\n    load_storage();\n    return (storage::user_address, storage::pool_address, storage::amount0, storage::amount1);\n}\n"
  },
  {
    "path": "contracts/lp_account/getter.func",
    "content": ";; handle onchain 'get' calls\n\n(int) handle_getter_messages(int op, int query_id, slice sender_address, slice in_msg_body) impure inline {\n    raw_reserve(0, 4);\n\n    if (op == getter_lp_account_data) { \n        var payload = begin_cell()\n            .store_uint(getter_lp_account_data, 32)\n            .store_uint(query_id, 64)\n            .store_slice(storage::user_address)\n            .store_slice(storage::pool_address)\n            .store_coins(storage::amount0)\n            .store_coins(storage::amount1);\n        send_payload(sender_address, payload.end_cell());\n        return (true);\n    }\n\n    return (false); ;; wrong op\n}"
  },
  {
    "path": "contracts/lp_account/op.func",
    "content": "const reset_gas = \"reset_gas\"c;\nconst add_liquidity = \"add_liquidity\"c;\nconst cb_add_liquidity = \"cb_add_liquidity\"c;\nconst getter_lp_account_data = \"getter_lp_account_data\"c;\nconst direct_add_liquidity = \"direct_add_liquidity\"c;\nconst refund_me = \"refund_me\"c;\nconst cb_refund_me = \"cb_refund_me\"c;"
  },
  {
    "path": "contracts/lp_account/params.func",
    "content": "const WORKCHAIN = 0;\n\nconst REQUIRED_TON_RESERVE = 10000000;"
  },
  {
    "path": "contracts/lp_account/pool-calls.func",
    "content": ";; handle pool calls\n\n() handle_pool_messages(int op, int query_id, int my_balance, int msg_value, slice in_msg_body) impure inline {\n\n    if (op == add_liquidity) { \n\n        (int new_amount0, int new_amount1, int min_lp_out) = (in_msg_body~load_coins(), in_msg_body~load_coins(), in_msg_body~load_coins());\n\n        storage::amount0 += new_amount0;\n        storage::amount1 += new_amount1;\n\n        if (min_lp_out & ((storage::amount0 > 1000) & (storage::amount1 > 1000))){\n            builder msg = begin_cell()\n                .store_uint(cb_add_liquidity, 32)\n                .store_uint(query_id, 64)\n                .store_coins(storage::amount0)\n                .store_coins(storage::amount1)\n                .store_slice(storage::user_address)\n                .store_coins(min_lp_out);\n            send_payload(storage::pool_address, msg.end_cell());\n            storage::amount0 = 0;\n            storage::amount1 = 0;\n        }\n\n        save_storage();\n        return ();\n\n    }\n    \n    throw(WRONG_OP);\n}"
  },
  {
    "path": "contracts/lp_account/storage.func",
    "content": "global slice storage::user_address;\nglobal slice storage::pool_address; \nglobal int storage::amount0;\nglobal int storage::amount1;\n\n() load_storage() impure inline {\n    slice ds = get_data().begin_parse();\n    storage::user_address = ds~load_msg_addr();\n    storage::pool_address = ds~load_msg_addr(); \n    storage::amount0 = ds~load_coins();\n    storage::amount1 = ds~load_coins();\n}\n\n() save_storage() impure inline {\n    set_data(begin_cell()\n        .store_slice(storage::user_address)\n        .store_slice(storage::pool_address)\n        .store_coins(storage::amount0)\n        .store_coins(storage::amount1)\n    .end_cell());\n}"
  },
  {
    "path": "contracts/lp_account/user-calls.func",
    "content": "() handle_user_messages(int op, int query_id, int my_balance, int msg_value, slice in_msg_body) impure inline {\n\n    if(op == refund_me) {\n        throw_unless(NO_LIQUIDITY, (storage::amount0 > 0) | (storage::amount1 > 0));\n\n        builder msg = begin_cell()\n            .store_uint(cb_refund_me, 32)\n            .store_uint(query_id, 64)\n            .store_coins(storage::amount0)\n            .store_coins(storage::amount1)\n            .store_slice(storage::user_address);\n        send_simple_message(0, storage::pool_address, msg.end_cell(), CARRY_REMAINING_GAS);\n\n        storage::amount0 = 0;\n        storage::amount1 = 0;\n        save_storage();\n        return ();\n    }\n\n    if(op == direct_add_liquidity) {\n        (int am0, int am1, int min_lp_out) = (in_msg_body~load_coins(), in_msg_body~load_coins(), in_msg_body~load_coins());\n        throw_unless(ZERO_OUTPUT, min_lp_out & ((am0 > 1000) & (am1 > 1000)));\n\n        storage::amount0 -= am0;\n        storage::amount1 -= am1;\n\n        throw_unless(NO_LIQUIDITY, (storage::amount0 >= 0) & (storage::amount1 >= 0));\n\n        builder msg = begin_cell()\n            .store_uint(cb_add_liquidity, 32)\n            .store_uint(query_id, 64)\n            .store_coins(am0)\n            .store_coins(am1)\n            .store_slice(storage::user_address)\n            .store_coins(min_lp_out);\n        send_simple_message(0, storage::pool_address, msg.end_cell(), CARRY_REMAINING_GAS);\n\n        save_storage();\n        return ();\n    }\n\n    if (op == reset_gas) { \n        throw_unless(INSUFFICIENT_GAS, my_balance > REQUIRED_TON_RESERVE);\n        send_empty_message(my_balance - REQUIRED_TON_RESERVE, storage::user_address, NORMAL);\n        return ();\n    }\n\n    throw(WRONG_OP);\n}"
  },
  {
    "path": "contracts/lp_account.func",
    "content": "#pragma version >=0.2.0;\n\n#include \"common/stdlib.func\";\n#include \"common/messages.func\";\n#include \"lp_account/op.func\";\n#include \"lp_account/params.func\";\n#include \"lp_account/errors.func\";\n#include \"lp_account/storage.func\";\n#include \"common/utils.func\";\n#include \"lp_account/get.func\"; \n#include \"lp_account/pool-calls.func\"; \n#include \"lp_account/user-calls.func\"; \n#include \"lp_account/getter.func\"; \n\n() recv_internal(int my_balance, int msg_value, cell in_msg_full, slice in_msg_body) impure {\n    if (in_msg_body.slice_empty?()) { \n        return ();\n    }\n\n    slice cs = in_msg_full.begin_parse();\n    int flags = cs~load_uint(4);\n\n    load_storage();\n\n    if (flags & 1) {        \n        return ();\n    }\n\n    slice sender_address = cs~load_msg_addr();\n    force_chain(WORKCHAIN, sender_address, WRONG_WORKCHAIN);\n\n    (int op, int query_id) = (in_msg_body~load_uint(32), in_msg_body~load_uint(64));\n\n    ;; handle message from pool\n    if (equal_slices(sender_address, storage::pool_address)) {\n        handle_pool_messages(op, query_id, my_balance, msg_value, in_msg_body);\n        return ();\n    }\n\n    ;; handle message from user\n    if (equal_slices(sender_address, storage::user_address)) {\n        handle_user_messages(op, query_id, my_balance, msg_value, in_msg_body);\n        return ();\n    }\n\n    ;; make sure that the message has a valid opcode\n    if (handle_getter_messages(op, query_id, sender_address, in_msg_body)) {\n        return (); \n    }\n\n    throw(WRONG_OP);\n}\n"
  },
  {
    "path": "contracts/lp_account.ts",
    "content": "import BN from \"bn.js\";\nimport { Cell, beginCell, Address } from \"ton\";\nimport { beginMessage } from \"./helpers\";\n\nexport function data(params: {\n    user: Address;\n    pool: Address;\n    stored0: BN;\n    stored1: BN;\n}): Cell {\n    return beginCell()\n        .storeAddress(params.user)\n        .storeAddress(params.pool)\n        .storeCoins(params.stored0)\n        .storeCoins(params.stored1)\n        .endCell();\n}\n\nexport function resetGas(): Cell {\n    return beginMessage({ op: new BN(0x42a0fb43) })\n        .endCell();\n}\n\nexport function addLiquidity(params: {\n    newAmount0: BN;\n    newAmount1: BN;\n    minLPOut: BN;\n}): Cell {\n    return beginMessage({ op: new BN(0x3ebe5431) })\n        .storeCoins(params.newAmount0)\n        .storeCoins(params.newAmount1)\n        .storeCoins(params.minLPOut)\n        .endCell();\n}\n\nexport function directAddLiquidity(params: {\n    amount0: BN;\n    amount1: BN;\n    minLPOut: BN;\n}): Cell {\n    return beginMessage({ op: new BN(0x4cf82803) })\n        .storeCoins(params.amount0)\n        .storeCoins(params.amount1)\n        .storeCoins(params.minLPOut)\n        .endCell();\n}\n\nexport function refundMe(): Cell {\n    return beginMessage({ op: new BN(0x0bf3f447) })\n        .endCell();\n}\n\nexport function getLPAccountData(): Cell {\n    return beginMessage({ op: new BN(0xea97bbef) })\n        .endCell();\n}\n"
  },
  {
    "path": "contracts/lp_wallet/errors.func",
    "content": "const WRONG_WORKCHAIN = 85;\n\nconst WRONG_OP = 0xffff;"
  },
  {
    "path": "contracts/lp_wallet/jetton-utils.func",
    "content": "cell pack_jetton_lp_wallet_data(int balance, slice owner_address, slice jetton_master_address, cell jetton_wallet_code) inline {\n  return begin_cell()\n    .store_coins(balance)\n    .store_slice(owner_address)\n    .store_slice(jetton_master_address)\n    .store_ref(jetton_wallet_code)\n  .end_cell();\n}\n\ncell calculate_jetton_lp_wallet_state_init(slice owner_address, slice jetton_master_address, cell jetton_wallet_code) inline {\n  return begin_cell()\n    .store_uint(0, 2)\n    .store_dict(jetton_wallet_code)\n    .store_dict(pack_jetton_lp_wallet_data(0, owner_address, jetton_master_address, jetton_wallet_code))\n    .store_uint(0, 1)\n  .end_cell();\n}\n\nslice calculate_jetton_lp_wallet_address(cell state_init) inline {\n  return begin_cell().store_uint(4, 3)\n    .store_int(WORKCHAIN, 8)\n    .store_uint(cell_hash(state_init), 256)\n  .end_cell().begin_parse();\n}\n\nslice calculate_user_jetton_lp_wallet_address(slice owner_address, slice jetton_master_address, cell jetton_wallet_code) inline {\n  return calculate_jetton_lp_wallet_address(calculate_jetton_lp_wallet_state_init(owner_address, jetton_master_address, jetton_wallet_code));\n}\n\n(int) get_workchain(slice address) inline {\n  (int wc, _) = parse_std_addr(address);\n  return wc;\n}\n\n() force_chain(int workchain, slice address, int error_code) impure inline {\n  (int wc) = get_workchain(address);\n  throw_unless(error_code, wc == workchain);\n}\n"
  },
  {
    "path": "contracts/lp_wallet/op.func",
    "content": "const transfer = 0xf8a7ea5;\nconst transfer_notification = 0x7362d09c;\nconst internal_transfer = 0x178d4519;\nconst excesses = 0xd53276db;\nconst burn = 0x595f07bc;\nconst burn_notification = 0x7bdd97de;\n\n"
  },
  {
    "path": "contracts/lp_wallet/params.func",
    "content": "const WORKCHAIN = 0;\n\nconst REQUIRED_TON_STORAGE = 10000000;\nconst REQUIRED_GAS = 10000000;"
  },
  {
    "path": "contracts/lp_wallet/storage.func",
    "content": "(int, slice, slice, cell) load_storage() inline {\n    slice ds = get_data().begin_parse();\n    return (ds~load_coins(), ds~load_msg_addr(), ds~load_msg_addr(), ds~load_ref());\n}\n\n() save_storage(int balance, slice owner_address, slice jetton_master_address, cell jetton_wallet_code) impure inline {\n    set_data(pack_jetton_lp_wallet_data(balance, owner_address, jetton_master_address, jetton_wallet_code));\n}"
  },
  {
    "path": "contracts/lp_wallet.func",
    "content": "#pragma version >=0.2.0;\n\n#include \"common/stdlib.func\";\n#include \"lp_wallet/op.func\";\n#include \"lp_wallet/params.func\";\n#include \"lp_wallet/errors.func\";\n#include \"lp_wallet/jetton-utils.func\";\n#include \"lp_wallet/storage.func\";\n\n() send_tokens (slice in_msg_body, slice sender_address, int msg_value, int fwd_fee) impure {\n  int query_id = in_msg_body~load_uint(64);\n  int jetton_amount = in_msg_body~load_coins();\n  slice to_owner_address = in_msg_body~load_msg_addr();\n  force_chain(WORKCHAIN, to_owner_address, WRONG_WORKCHAIN);\n\n  (int balance, slice owner_address, slice jetton_master_address, cell jetton_wallet_code) = load_storage();\n  balance -= jetton_amount;\n\n  throw_unless(705, equal_slices(owner_address, sender_address));\n  throw_unless(706, balance >= 0);\n\n  cell state_init = calculate_jetton_lp_wallet_state_init(to_owner_address, jetton_master_address, jetton_wallet_code);\n  slice to_wallet_address = calculate_jetton_lp_wallet_address(state_init);\n  slice response_address = in_msg_body~load_msg_addr();\n  cell custom_payload = in_msg_body~load_dict();\n  int forward_ton_amount = in_msg_body~load_coins();\n  throw_unless(708, slice_bits(in_msg_body) >= 1);\n  slice either_forward_payload = in_msg_body;\n  var msg = begin_cell()\n    .store_uint(0x18, 6)\n    .store_slice(to_wallet_address)\n    .store_coins(0)\n    .store_uint(4 + 2 + 1, 1 + 4 + 4 + 64 + 32 + 1 + 1 + 1)\n    .store_ref(state_init);\n  var msg_body = begin_cell()\n    .store_uint(internal_transfer, 32)\n    .store_uint(query_id, 64)\n    .store_coins(jetton_amount)\n    .store_slice(owner_address)\n    .store_slice(response_address)\n    .store_coins(forward_ton_amount)\n    .store_slice(either_forward_payload)\n    .end_cell();\n  msg = msg.store_ref(msg_body);\n  int fwd_count = forward_ton_amount ? 2 : 1;\n  throw_unless(709, msg_value > forward_ton_amount + fwd_count * fwd_fee + (2 * REQUIRED_GAS + REQUIRED_TON_STORAGE));\n  send_raw_message(msg.end_cell(), 64);\n  save_storage(balance, owner_address, jetton_master_address, jetton_wallet_code);\n}\n\n() receive_tokens (slice in_msg_body, slice sender_address, int my_ton_balance, int fwd_fee, int msg_value) impure {\n  (int balance, slice owner_address, slice jetton_master_address, cell jetton_wallet_code) = load_storage();\n  int query_id = in_msg_body~load_uint(64);\n  int jetton_amount = in_msg_body~load_coins();\n  balance += jetton_amount;\n  slice from_address = in_msg_body~load_msg_addr();\n  slice response_address = in_msg_body~load_msg_addr();\n  throw_unless(707,\n    equal_slices(jetton_master_address, sender_address)\n      |\n      equal_slices(calculate_user_jetton_lp_wallet_address(from_address, jetton_master_address, jetton_wallet_code), sender_address)\n  );\n  int forward_ton_amount = in_msg_body~load_coins();\n  int ton_balance_before_msg = my_ton_balance - msg_value;\n  int storage_fee = REQUIRED_TON_STORAGE - min(ton_balance_before_msg, REQUIRED_TON_STORAGE);\n  msg_value -= (storage_fee + REQUIRED_GAS);\n  if(forward_ton_amount) {\n    msg_value -= (forward_ton_amount + fwd_fee);\n    slice either_forward_payload = in_msg_body;\n    var msg_body = begin_cell()\n        .store_uint(transfer_notification, 32)\n        .store_uint(query_id, 64)\n        .store_coins(jetton_amount)\n        .store_slice(from_address)\n        .store_slice(either_forward_payload)\n        .end_cell();\n    var msg = begin_cell()\n      .store_uint(0x18, 6)\n      .store_slice(owner_address)\n      .store_coins(forward_ton_amount)\n      .store_uint(1, 1 + 4 + 4 + 64 + 32 + 1 + 1)\n      .store_ref(msg_body);\n    send_raw_message(msg.end_cell(), 1);\n  }\n\n  if ((response_address.preload_uint(2) != 0) & (msg_value > 0)) {\n    var msg = begin_cell()\n      .store_uint(0x10, 6) \n      .store_slice(response_address)\n      .store_coins(msg_value)\n      .store_uint(0, 1 + 4 + 4 + 64 + 32 + 1 + 1)\n      .store_uint(excesses, 32)\n      .store_uint(query_id, 64);\n    send_raw_message(msg.end_cell(), 2);\n  }\n\n  save_storage(balance, owner_address, jetton_master_address, jetton_wallet_code);\n}\n\n() burn_tokens (slice in_msg_body, slice sender_address, int msg_value, int fwd_fee) impure {\n  (int balance, slice owner_address, slice jetton_master_address, cell jetton_wallet_code) = load_storage();\n  int query_id = in_msg_body~load_uint(64);\n  int jetton_amount = in_msg_body~load_coins();\n  slice response_address = in_msg_body~load_msg_addr();\n  ;; slice custom_payload = in_msg_body~load_dict();\n  balance -= jetton_amount;\n  throw_unless(705, equal_slices(owner_address, sender_address));\n  throw_unless(706, balance >= 0);\n  throw_unless(707, msg_value > fwd_fee + 2 * REQUIRED_GAS);\n\n  var msg_body = begin_cell()\n      .store_uint(burn_notification, 32)\n      .store_uint(query_id, 64)\n      .store_coins(jetton_amount)\n      .store_slice(owner_address)\n      .store_slice(response_address)\n      .end_cell();\n\n  var msg = begin_cell()\n    .store_uint(0x18, 6)\n    .store_slice(jetton_master_address)\n    .store_coins(0)\n    .store_uint(1, 1 + 4 + 4 + 64 + 32 + 1 + 1)\n    .store_ref(msg_body);\n\n  send_raw_message(msg.end_cell(), 64);\n\n  save_storage(balance, owner_address, jetton_master_address, jetton_wallet_code);\n}\n\n() on_bounce (slice in_msg_body) impure {\n  in_msg_body~skip_bits(32);\n  (int balance, slice owner_address, slice jetton_master_address, cell jetton_wallet_code) = load_storage();\n  int op = in_msg_body~load_uint(32);\n  throw_unless(709, (op == internal_transfer) | (op == burn_notification));\n  int query_id = in_msg_body~load_uint(64);\n  int jetton_amount = in_msg_body~load_coins();\n  balance += jetton_amount;\n  save_storage(balance, owner_address, jetton_master_address, jetton_wallet_code);\n}\n\n() recv_internal(int my_balance, int msg_value, cell in_msg_full, slice in_msg_body) impure {\n  if (in_msg_body.slice_empty?()) { \n    return ();\n  }\n\n  slice cs = in_msg_full.begin_parse();\n  int flags = cs~load_uint(4);\n  if (flags & 1) {\n    on_bounce(in_msg_body);\n    return ();\n  }\n  slice sender_address = cs~load_msg_addr();\n  cs~load_msg_addr();\n  cs~load_coins(); \n  cs~skip_bits(1); \n  cs~load_coins(); \n  int fwd_fee = cs~load_coins();\n\n  int op = in_msg_body~load_uint(32);\n\n  if (op == transfer) { \n    send_tokens(in_msg_body, sender_address, msg_value, fwd_fee);\n    return ();\n  }\n\n  if (op == internal_transfer) { \n    receive_tokens(in_msg_body, sender_address, my_balance, fwd_fee, msg_value);\n    return ();\n  }\n\n  if (op == burn) { \n    burn_tokens(in_msg_body, sender_address, msg_value, fwd_fee);\n    return ();\n  }\n\n  throw(WRONG_OP);\n}\n\n(int, slice, slice, cell) get_wallet_data() method_id { \n  return load_storage();\n}"
  },
  {
    "path": "contracts/pool/amm.func",
    "content": "(int, int, int) get_amount_out(int has_ref, int amount_in, int reserve_in, int reserve_out) inline {\n  int amount_in_with_fee = amount_in * (FEE_DIVIDER - storage::lp_fee);\n  int base_out = (amount_in_with_fee * reserve_out) / (reserve_in * FEE_DIVIDER + amount_in_with_fee);\n  \n  int protocol_fee_out = 0;\n  int ref_fee_out = 0;\n\n  if (storage::protocol_fee > 0) {\n    protocol_fee_out = divc(base_out * storage::protocol_fee, FEE_DIVIDER);\n  }\n  \n  if (has_ref & (storage::ref_fee > 0)) {\n    ref_fee_out = divc(base_out * storage::ref_fee, FEE_DIVIDER);\n  }\n  \n  base_out -= protocol_fee_out + ref_fee_out;\n  return (base_out, protocol_fee_out, ref_fee_out);\n}\n\n\n() _mint_lp(int query_id, slice to, int amount) impure inline {\n  cell state_init = calculate_jetton_lp_wallet_state_init(to, my_address(), storage::jetton_lp_wallet_code);\n  slice to_wallet_address = calculate_jetton_lp_wallet_address(state_init);\n  var body = begin_cell()\n    .store_uint(internal_transfer, 32)\n    .store_uint(query_id, 64)\n    .store_coins(amount)\n    .store_slice(my_address())\n    .store_slice(to)\n    .store_coins(0) \n    .store_uint(0, 1);\n  send_message_with_stateinit(0, to_wallet_address, state_init, body.end_cell(), CARRY_REMAINING_GAS);\n}\n\n"
  },
  {
    "path": "contracts/pool/errors.func",
    "content": "const NO_LIQUIDITY = 80;\nconst ZERO_OUTPUT = 81;\nconst INVALID_CALLER = 82;\nconst INSUFFICIENT_GAS = 83;\nconst FEE_OUT_RANGE = 85;\nconst INVALID_TOKEN = 86;\nconst LOW_AMOUNT = 87;\nconst LOW_LIQUIDITY = 88;\nconst WRONG_K = 89;\nconst MATH_ERROR = 90;\nconst INVALID_RECIPIENT = 91;\n\nconst WRONG_OP = 0xffff;"
  },
  {
    "path": "contracts/pool/get.func",
    "content": ";; get methods\n(int, int, slice, slice, int, int, int, slice, int, int) get_pool_data() method_id {\n    load_storage();\n    return (\n        storage::reserve0,\n        storage::reserve1,\n        storage::token0_address,\n        storage::token1_address,\n        storage::lp_fee,\n        storage::protocol_fee, \n        storage::ref_fee,\n        storage::protocol_fee_address,\n        storage::collected_token0_protocol_fee, \n        storage::collected_token1_protocol_fee\n    );\n}\n\n(int, int, int) get_expected_outputs(int amount, slice token_wallet) method_id {\n    load_storage();\n    throw_unless(NO_LIQUIDITY, storage::total_supply_lp > REQUIRED_MIN_LIQUIDITY);\n    int out = 0;\n    int protocol_fee_out = 0;\n    int ref_fee_out = 0;\n\n    if (equal_slices(token_wallet, storage::token0_address)) {\n            (out, protocol_fee_out, ref_fee_out) =  get_amount_out(\n            false, \n            amount, \n            storage::reserve0, \n            storage::reserve1\n        );\n    }\n    if (equal_slices(token_wallet, storage::token1_address)) {\n            (out, protocol_fee_out, ref_fee_out) =  get_amount_out(\n            false, \n            amount, \n            storage::reserve1, \n            storage::reserve0\n        );\n    }\n    return ((out < 0 ? 0 : out), protocol_fee_out, ref_fee_out);\n}\n\n;; estimate expected lp tokens minted when providing liquidity\n(int) get_expected_tokens(int amount0, int amount1) method_id {\n    load_storage();\n    return min(amount0 * storage::total_supply_lp / storage::reserve0, amount1 * storage::total_supply_lp / storage::reserve1);\n}\n\n(int, int) get_expected_liquidity(int jetton_amount) method_id {\n    load_storage();\n    throw_unless(ZERO_OUTPUT, jetton_amount > 0); \n\n    int amount0_out = (jetton_amount * storage::reserve0) / storage::total_supply_lp; \n    int amount1_out = (jetton_amount * storage::reserve1) / storage::total_supply_lp; \n    \n    throw_unless(ZERO_OUTPUT, (amount0_out > 0) & (amount1_out > 0));\n\n    return (amount0_out, amount1_out);\n}\n\nslice get_lp_account_address(slice owner_address) method_id {\n    load_storage();\n    return calculate_user_lp_account_address(owner_address, my_address(), storage::lp_account_code); \n}\n\n;; standard jetton 'get' methods \n(int, int, slice, cell, cell) get_jetton_data() method_id {\n    load_storage();\n    (_, int hashpart) = parse_std_addr(my_address());\n\n    cell content_lp = begin_cell()\n        .store_uint(0x01, 8)\n        .store_slice(URI_BASE)\n        .store_slice(address_to_hex_string(hashpart))\n        .store_slice(URI_END)\n    .end_cell();\n\n    return (storage::total_supply_lp, -1, storage::router_address, content_lp, storage::jetton_lp_wallet_code);\n}\n\nslice get_wallet_address(slice owner_address) method_id {\n    load_storage();\n    return calculate_user_jetton_lp_wallet_address(owner_address, my_address(), storage::jetton_lp_wallet_code); \n}"
  },
  {
    "path": "contracts/pool/getter.func",
    "content": ";; handle onchain 'get' calls\n\n(int) handle_getter_messages(int msg_value, int fwd_fee, int op, int query_id, slice sender_address, slice in_msg_body) impure inline {\n    raw_reserve(0, 4);\n\n    if (op == getter_pool_data) { \n        var payload = begin_cell()\n            .store_uint(getter_pool_data, 32)\n            .store_uint(query_id, 64)\n            .store_coins(storage::reserve0)\n            .store_coins(storage::reserve1)\n            .store_slice(storage::token0_address)\n            .store_slice(storage::token1_address)\n            .store_ref(begin_cell()\n                .store_uint(storage::lp_fee, 8)\n                .store_uint(storage::protocol_fee, 8)\n                .store_uint(storage::ref_fee, 8)\n                .store_slice(storage::protocol_fee_address)\n                .store_coins(storage::collected_token0_protocol_fee)\n                .store_coins(storage::collected_token1_protocol_fee)\n            .end_cell());\n        send_payload(sender_address, payload.end_cell());\n        return (true);\n    }\n\n    if (op == getter_expected_outputs) { \n        throw_unless(NO_LIQUIDITY, storage::total_supply_lp > REQUIRED_MIN_LIQUIDITY);\n        (int amount, slice token_wallet) = (in_msg_body~load_coins(), in_msg_body~load_msg_addr());\n\n        int out = 0;\n        int ok = false;\n        int protocol_fee_out = 0;\n        int ref_fee_out = 0;\n\n        if (equal_slices(token_wallet, storage::token0_address)) {\n            ok = true;\n            (out, protocol_fee_out, ref_fee_out) = get_amount_out(false, amount, storage::reserve0, storage::reserve1);\n        }\n        if (equal_slices(token_wallet, storage::token1_address)) {\n            ok = true;\n            (out, protocol_fee_out, ref_fee_out) = get_amount_out(false, amount, storage::reserve1, storage::reserve0);\n        }\n    \n        throw_unless(INVALID_TOKEN, ok);\n    \n        var payload = begin_cell()\n            .store_uint(getter_expected_outputs, 32)\n            .store_uint(query_id, 64)\n            .store_coins((out <= 0 ? 0 : out))\n            .store_coins(protocol_fee_out)\n            .store_coins(ref_fee_out);\n        send_payload(sender_address, payload.end_cell());\n        return (true);\n    }\n\n    if (op == getter_lp_account_address) { \n        slice user_address = in_msg_body~load_msg_addr();\n    \n        var payload = begin_cell()\n            .store_uint(getter_expected_outputs, 32)\n            .store_uint(query_id, 64)\n            .store_slice(calculate_user_lp_account_address(user_address, my_address(), storage::lp_account_code));\n        send_payload(sender_address, payload.end_cell());\n        return (true);\n    }\n\n    if (op == getter_expected_tokens) { \n        (slice user_address, int amount0, int amount1) = (in_msg_body~load_msg_addr(), in_msg_body~load_coins(), in_msg_body~load_coins());\n\n        int to_mint0 = (amount1 * storage::total_supply_lp) / storage::reserve0;\n        int to_mint1 = (amount0 * storage::total_supply_lp) / storage::reserve1;\n\n        int liquidity = min(to_mint0, to_mint1);\n    \n        var payload = begin_cell()\n            .store_uint(getter_expected_tokens, 32)\n            .store_uint(query_id, 64)\n            .store_coins(liquidity);\n        send_payload(sender_address, payload.end_cell());\n        return (true);\n    }\n\n    if (op == getter_expected_liquidity) { \n        int jetton_amount = in_msg_body~load_coins();\n\n        throw_unless(ZERO_OUTPUT, jetton_amount > 0); \n\n        int amount0_out = (jetton_amount * storage::reserve0) / storage::total_supply_lp; \n        int amount1_out = (jetton_amount * storage::reserve1) / storage::total_supply_lp; \n      \n        throw_unless(ZERO_OUTPUT, (amount0_out > 0) & (amount1_out > 0));\n\n        var payload = begin_cell()\n            .store_uint(getter_expected_liquidity, 32)\n            .store_uint(query_id, 64)\n            .store_coins(amount0_out)\n            .store_coins(amount1_out);\n        send_payload(sender_address, payload.end_cell());\n        return (true);\n    }\n\n    if (op == provide_wallet_address) {\n        ;; Reference implementation:\n        ;; https://github.com/ton-blockchain/token-contract/blob/920c5aa3a33ede6405b5653147895c9e27bfe535/ft/jetton-minter-discoverable.fc#L100\n        throw_unless(75, msg_value > fwd_fee + PROVIDE_ADD_GAS_CONSUMPTION);\n\n        (slice owner_address, int include_address?) = (in_msg_body~load_msg_addr(), in_msg_body~load_uint(1));\n\n        cell included_address = include_address? ? begin_cell().store_slice(owner_address).end_cell() : null();\n\n        var msg = begin_cell()\n            .store_uint(take_wallet_address, 32)\n            .store_uint(query_id, 64);\n\n        if (is_resolvable?(owner_address)) {\n            msg = msg.store_slice(calculate_user_jetton_lp_wallet_address(owner_address, my_address(), storage::jetton_lp_wallet_code));\n        } else {\n            msg = msg.store_uint(0, 2); ;; addr_none\n        }\n\n        send_payload(sender_address, msg.store_maybe_ref(included_address).end_cell());\n        return (true);\n    }\n    \n    return (false); ;; wrong op\n}"
  },
  {
    "path": "contracts/pool/jetton-utils.func",
    "content": "cell pack_jetton_lp_wallet_data(int balance, slice owner_address, slice jetton_master_address, cell jetton_wallet_code) inline {\n  return begin_cell()\n    .store_coins(balance)\n    .store_slice(owner_address)\n    .store_slice(jetton_master_address)\n    .store_ref(jetton_wallet_code)\n  .end_cell();\n}\n\ncell calculate_jetton_lp_wallet_state_init(slice owner_address, slice jetton_master_address, cell jetton_wallet_code) inline {\n  return begin_cell()\n    .store_uint(0, 2)\n    .store_dict(jetton_wallet_code)\n    .store_dict(pack_jetton_lp_wallet_data(0, owner_address, jetton_master_address, jetton_wallet_code))\n    .store_uint(0, 1)\n  .end_cell();\n}\n\nslice calculate_jetton_lp_wallet_address(cell state_init) inline {\n  return begin_cell().store_uint(4, 3)\n    .store_int(WORKCHAIN, 8)\n    .store_uint(cell_hash(state_init), 256)\n  .end_cell().begin_parse();\n}\n\nslice calculate_user_jetton_lp_wallet_address(slice owner_address, slice jetton_master_address, cell jetton_wallet_code) inline {\n  return calculate_jetton_lp_wallet_address(calculate_jetton_lp_wallet_state_init(owner_address, jetton_master_address, jetton_wallet_code));\n}"
  },
  {
    "path": "contracts/pool/lp_account-utils.func",
    "content": "cell pack_lp_account_data(slice user_address, slice pool_address, int amount0, int amount1) inline {\n  return begin_cell()\n    .store_slice(user_address)\n    .store_slice(pool_address)\n    .store_coins(amount0)\n    .store_coins(amount1)\n  .end_cell();\n}\n\ncell calculate_lp_account_state_init(slice user_address, slice pool_address, cell lp_account_code) inline {\n  return begin_cell()\n    .store_uint(0, 2)\n    .store_dict(lp_account_code)\n    .store_dict(pack_lp_account_data(user_address, pool_address, 0, 0))\n    .store_uint(0, 1)\n  .end_cell();\n}\n\nslice calculate_lp_account_address(cell state_init) inline {\n  return begin_cell().store_uint(4, 3)\n    .store_int(WORKCHAIN, 8)\n    .store_uint(cell_hash(state_init), 256)\n  .end_cell().begin_parse();\n}\n\nslice calculate_user_lp_account_address(slice user_address, slice pool_address, cell lp_account_code) inline {\n  return calculate_lp_account_address(calculate_lp_account_state_init(user_address, pool_address, lp_account_code));\n}\n"
  },
  {
    "path": "contracts/pool/op.func",
    "content": "const transfer = 0xf8a7ea5;\nconst transfer_notification = 0x7362d09c;\nconst internal_transfer = 0x178d4519;\nconst excesses = 0xd53276db;\nconst burn = 0x595f07bc;\nconst burn_notification = 0x7bdd97de;\n\nconst provide_wallet_address = 0x2c76b973;\nconst take_wallet_address = 0xd1735400;\n\n\nconst swap = \"swap\"c;\nconst provide_lp = \"provide_lp\"c;\nconst pay_to = \"pay_to\"c;\n\n;; swap callbacks opcodes\nconst swap_refund_no_liq = \"swap_refund_no_liq\"c;\nconst swap_refund_reserve_err = \"swap_refund_reserve_err\"c;\n\nconst swap_ok_ref = \"swap_ok_ref\"c;\nconst swap_ok = \"swap_ok\"c;\nconst burn_ok = \"burn_ok\"c;\nconst refund_ok = \"refund_ok\"c;\n\nconst collect_fees = \"collect_fees\"c;\nconst set_fees = \"set_fees\"c;\nconst reset_gas = \"reset_gas\"c;\nconst add_liquidity = \"add_liquidity\"c;\nconst cb_add_liquidity = \"cb_add_liquidity\"c;\nconst cb_refund_me = \"cb_refund_me\"c;\n\n;; async \"get\" calls\nconst getter_pool_data = \"getter_pool_data\"c;\nconst getter_expected_outputs = \"getter_expected_outputs\"c;\nconst getter_lp_account_address = \"getter_lp_account_address\"c;\nconst getter_expected_tokens = \"getter_expected_tokens\"c;\nconst getter_expected_liquidity = \"getter_expected_liquidity\"c;"
  },
  {
    "path": "contracts/pool/params.func",
    "content": "const WORKCHAIN = 0;\n\nconst REQUIRED_TON_RESERVE = 10000000;\nconst REQUIRED_FEES_MINT = 30000000;\nconst REQUIRED_MIN_LIQUIDITY = 1000;\nconst REQUIRED_MIN_COLLECT_FEES = 1000000;\n;; according to https://ton.org/docs/#/smart-contracts/tvm-instructions/instructions, coins are in the range 0...2^120 - 1\nconst MAX_COINS = 1329227995784915872903807060280344575; ;; 2^120 - 1\nconst PROVIDE_ADD_GAS_CONSUMPTION = 10000000;\nconst FEE_DIVIDER = 10000;\nconst MIN_FEE = 0; ;; 0%\nconst MAX_FEE = 100; ;; 1%\n\nconst HOLE_ADDRESS = \"EQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAM9c\"a;\nslice addr_none() asm \"<b b{00} s, b> <s PUSHSLICE\";\nconst URI_BASE = \"https://lp.ston.fi/0:\";\nconst URI_END = \".json\";\n"
  },
  {
    "path": "contracts/pool/router-calls.func",
    "content": "\n\n() handle_router_messages(int op, int query_id, int my_balance, int msg_value, slice in_msg_body) impure inline {\n    if (op == swap) {\n        (slice from_user_address, slice token_wallet, int amount, int min_out, int has_ref) = (in_msg_body~load_msg_addr(), in_msg_body~load_msg_addr(), in_msg_body~load_coins(), in_msg_body~load_coins(), in_msg_body~load_uint(1));\n        cell ref_bodycell = in_msg_body~load_ref(); \n        slice ref_body_slice = ref_bodycell.begin_parse();\n        slice from_real_user = ref_body_slice~load_msg_addr(); ;; parse who initialized the swap, always present\n\n        int out = 0;\n        int protocol_fee_out = 0;\n        int ref_fee_out = 0;\n        int tmp_am_0 = 0;\n        int tmp_am_1 = 0;\n        slice ref_address = addr_none();\n\n        int mode = CARRY_REMAINING_GAS;\n        int gas = 0;\n    \n        if (has_ref) {\n            mode = NORMAL;\n            gas = (msg_value - get_gas_fee(25000, WORKCHAIN)) / 2;\n            ref_address = ref_body_slice~load_msg_addr();\n        }\n\n        if (equal_slices(token_wallet, storage::token0_address)) { \n            (out, protocol_fee_out, ref_fee_out) = get_amount_out(has_ref, amount, storage::reserve0, storage::reserve1);\n            tmp_am_0 = amount;\n        } else {\n            (out, protocol_fee_out, ref_fee_out) = get_amount_out(has_ref, amount, storage::reserve1, storage::reserve0);\n            tmp_am_1 = amount;\n        }\n\n        ;; refund if not enough liquidity or not enough output or output less than min_out\n        if ((storage::total_supply_lp <= 0) | ((out <= 0) | (min_out >= out))) {\n            call_pay_to(0, CARRY_REMAINING_GAS, query_id, from_real_user, swap_refund_no_liq, tmp_am_0, tmp_am_1);\n            return ();\n        }\n\n        if (tmp_am_0) {\n            ;; swap token0 for token1\n            storage::reserve0 += amount;\n            storage::reserve1 -= (out + protocol_fee_out + ref_fee_out);\n            storage::collected_token1_protocol_fee += protocol_fee_out; \n\n            ;; refund if not enough balance or exceed max balance\n            if ((storage::reserve0 > MAX_COINS) | (storage::reserve1 <= 0)) {\n                call_pay_to(0, CARRY_REMAINING_GAS, query_id, from_real_user, swap_refund_reserve_err, tmp_am_0, tmp_am_1);\n                return ();\n            }\n\n            if (mode == NORMAL) { ;; 2 messages, pay referral\n                call_pay_to(gas, mode | IGNORE_ERRORS, query_id, ref_address, swap_ok_ref, 0, ref_fee_out); \n            }\n            call_pay_to(gas, mode, query_id, from_user_address, swap_ok, 0, out); \n        } else {    \n            ;; swap token1 for token0\n            storage::reserve0 -= (out + protocol_fee_out + ref_fee_out);\n            storage::reserve1 += amount;\n            storage::collected_token0_protocol_fee += protocol_fee_out; \n\n            ;; refund if not enough balance or exceed max balance\n            if ((storage::reserve1 > MAX_COINS) | (storage::reserve0 <= 0) ){\n                call_pay_to(0, CARRY_REMAINING_GAS, query_id, from_real_user, swap_refund_reserve_err, tmp_am_0, tmp_am_1);\n                return ();\n            }\n\n            if (mode == NORMAL) { ;; 2 messages, pay referral\n                call_pay_to(gas, mode | IGNORE_ERRORS, query_id, ref_address, swap_ok_ref, ref_fee_out, 0); \n            }\n            call_pay_to(gas, mode, query_id, from_user_address, swap_ok, out, 0); \n        }\n        save_storage();\n        return ();\n    }\n\n    if (op == provide_lp) { \n        (slice owner_addr, int min_lp_out, int amount0, int amount1) = (in_msg_body~load_msg_addr(), in_msg_body~load_coins(), in_msg_body~load_coins(), in_msg_body~load_coins());\n\n        cell state_init = calculate_lp_account_state_init(owner_addr, my_address(), storage::lp_account_code); \n        slice to_lp_account_address = calculate_lp_account_address(state_init);\n\n        ;; ruote to lp_account\n        var body = begin_cell()\n            .store_uint(add_liquidity, 32)\n            .store_uint(query_id, 64)\n            .store_coins(amount0)\n            .store_coins(amount1)\n            .store_coins(min_lp_out);\n        send_message_with_stateinit(0, to_lp_account_address, state_init, body.end_cell(), CARRY_REMAINING_GAS);\n        return ();\n    }\n\n\n    if (op == reset_gas) { \n        send_empty_message(my_balance - REQUIRED_TON_RESERVE, storage::router_address, NORMAL);\n        return ();\n    }\n\n    if (op == collect_fees) {\n        throw_unless(NO_LIQUIDITY, (storage::collected_token0_protocol_fee > 0) & (storage::collected_token1_protocol_fee > 0));\n        throw_unless(INVALID_RECIPIENT, ~ equal_slices(storage::protocol_fee_address, HOLE_ADDRESS));\n        call_pay_to(0, CARRY_REMAINING_GAS, query_id, storage::protocol_fee_address, 0, storage::collected_token0_protocol_fee, storage::collected_token1_protocol_fee);\n        storage::collected_token0_protocol_fee = 0;\n        storage::collected_token1_protocol_fee = 0;\n        save_storage();\n        return ();\n    }\n\n  \n    if (op == set_fees) { \n        (int new_lp_fee, int new_protocol_fee, int new_ref_fee, slice new_protocol_fee_address) = (in_msg_body~load_uint(8), in_msg_body~load_uint(8), in_msg_body~load_uint(8), in_msg_body~load_msg_addr());\n\n        throw_unless(FEE_OUT_RANGE, (MIN_FEE <= new_lp_fee) & (new_lp_fee <= MAX_FEE));\n        throw_unless(FEE_OUT_RANGE, (MIN_FEE <= new_protocol_fee) & (new_protocol_fee <= MAX_FEE));\n        throw_unless(FEE_OUT_RANGE, (MIN_FEE <= new_ref_fee) & (new_ref_fee <= MAX_FEE));\n\n        storage::lp_fee = new_lp_fee;\n        storage::protocol_fee = new_protocol_fee;\n        storage::ref_fee = new_ref_fee;\n        storage::protocol_fee_address = new_protocol_fee_address;\n        save_storage();\n        return ();\n    }\n\n    throw(WRONG_OP);\n}\n"
  },
  {
    "path": "contracts/pool/storage.func",
    "content": "global slice storage::router_address;\nglobal int storage::lp_fee;\nglobal int storage::protocol_fee;\nglobal int storage::ref_fee;\nglobal slice storage::token0_address;\nglobal slice storage::token1_address;\nglobal int storage::total_supply_lp; \nglobal int storage::collected_token0_protocol_fee;\nglobal int storage::collected_token1_protocol_fee; \nglobal slice storage::protocol_fee_address;\nglobal int storage::reserve0;\nglobal int storage::reserve1; \nglobal cell storage::jetton_lp_wallet_code;\nglobal cell storage::lp_account_code;\n\n\n\n() load_storage() impure inline {\n    slice ds = get_data().begin_parse();\n    storage::router_address = ds~load_msg_addr();\n    storage::lp_fee = ds~load_uint(8);\n    storage::protocol_fee = ds~load_uint(8);\n    storage::ref_fee = ds~load_uint(8);\n    storage::token0_address = ds~load_msg_addr();\n    storage::token1_address = ds~load_msg_addr();\n    storage::total_supply_lp = ds~load_coins(); \n\n    cell dc_0 = ds~load_ref(); slice ds_0 = dc_0.begin_parse();\n    storage::collected_token0_protocol_fee = ds_0~load_coins();\n    storage::collected_token1_protocol_fee = ds_0~load_coins(); \n    storage::protocol_fee_address = ds_0~load_msg_addr();\n    storage::reserve0 = ds_0~load_coins();\n    storage::reserve1 = ds_0~load_coins(); \n\n    storage::jetton_lp_wallet_code = ds~load_ref();\n    storage::lp_account_code = ds~load_ref();\n}\n\n() save_storage() impure inline {\n    set_data(begin_cell()\n        .store_slice(storage::router_address)\n        .store_uint(storage::lp_fee, 8) \n        .store_uint(storage::protocol_fee, 8) \n        .store_uint(storage::ref_fee, 8) \n        .store_slice(storage::token0_address)\n        .store_slice(storage::token1_address) \n        .store_coins(storage::total_supply_lp)\n        .store_ref(begin_cell()\n            .store_coins(storage::collected_token0_protocol_fee) \n            .store_coins(storage::collected_token1_protocol_fee) \n            .store_slice(storage::protocol_fee_address)\n            .store_coins(storage::reserve0) \n            .store_coins(storage::reserve1)\n        .end_cell())\n        .store_ref(storage::jetton_lp_wallet_code)\n        .store_ref(storage::lp_account_code)\n    .end_cell());\n}\n\n"
  },
  {
    "path": "contracts/pool/utils.func",
    "content": "int sqrt(int x) inline {\n  if (x == 0) { return x; }\n\n  int r = 181;\n  int xx = x;\n  if (xx >= 0x100000000000000000000000000000000) {\n    xx >>= 128;\n    r <<= 64;\n  }\n  if (xx >= 0x10000000000000000) {\n    xx >>= 64;\n    r <<= 32;\n  }\n  if (xx >= 0x100000000) {\n    xx >>= 32;\n    r <<= 16;\n  }\n  if (xx >= 0x10000) {\n    xx >>= 16;\n    r <<= 8;\n  }\n\n  r = (r * (xx + 65536)) >> 18;\n\n  repeat(7) {\n    r = (r + x / r) >> 1;\n  }\n\n  int r1 = x / r;\n\n  return (r < r1 ? r : r1);\n}\n\n() call_pay_to(int amount, int mode, int query_id, slice to_address, int exit_code, int amount0_out, int amount1_out) impure inline_ref {\n  var body = begin_cell()\n    .store_uint(pay_to, 32)\n    .store_uint(query_id, 64)\n    .store_slice(to_address)\n    .store_uint(exit_code, 32)\n    .store_uint(1, 1)\n    .store_ref(begin_cell()\n      .store_coins(amount0_out) \n      .store_slice(storage::token0_address)\n      .store_coins(amount1_out)\n      .store_slice(storage::token1_address)\n    .end_cell());\n  send_message_nobounce(amount, storage::router_address, body.end_cell(), mode);\n}\n\nint is_resolvable?(slice addr) inline {\n    (int wc, _) = parse_std_addr(addr);\n    return wc == WORKCHAIN;\n}\n\nslice address_to_hex_string(int value) inline {\n  if (value == 0) {\n    builder buffer = begin_cell();\n    int i = 0;\n    while (i < 64){\n      buffer = buffer.store_uint(\"0\"u, 8);\n      i += 1;\n    }\n    return buffer.end_cell().begin_parse().preload_bits(i * 8);\n  } else {\n\n    int j = value;\n    int length = 0;\n    while (j != 0) {\n      length += 1;\n      j = j >> 4;\n    }\n    \n    int mask = 15;\n    builder buffer = begin_cell();\n\n    while (value != 0) {\n      int curr = (value & mask);\n      if(curr > 9){\n        buffer = buffer.store_uint(55 + curr, 8);\n      } else {\n        buffer = buffer.store_uint(48 + curr, 8);\n      }\n      value = value >> 4;\n    }\n\n    builder final_cell = begin_cell();\n\n    slice reversed_buffer = buffer.end_cell().begin_parse();\n    int i = 64;\n    while(i > 0){\n      i -= 1;\n      slice chr = reversed_buffer.preload_bits_offset(i * 8, 8);\n      final_cell = final_cell.store_slice(chr);\n    }\n    return final_cell.end_cell().begin_parse().preload_bits(512);\n  }\n}"
  },
  {
    "path": "contracts/pool.func",
    "content": "#pragma version >=0.2.0;\n\n#include \"common/stdlib.func\";\n#include \"common/gas.func\";\n#include \"common/messages.func\";\n#include \"pool/op.func\";\n#include \"pool/params.func\";\n#include \"pool/errors.func\";\n#include \"common/utils.func\";\n#include \"pool/storage.func\";\n#include \"pool/utils.func\";\n#include \"pool/jetton-utils.func\";\n#include \"pool/lp_account-utils.func\";\n#include \"pool/amm.func\"; \n#include \"pool/get.func\"; \n#include \"pool/router-calls.func\"; \n#include \"pool/getter.func\"; \n\n() recv_internal(int my_balance, int msg_value, cell in_msg_full, slice in_msg_body) impure {\n  if (in_msg_body.slice_empty?()) {\n    return ();\n  }\n  slice cs = in_msg_full.begin_parse();\n  int flags = cs~load_uint(4);\n  \n  if (flags & 1) {\n    return ();\n  }\n\n  load_storage();\n\n  slice sender_address = cs~load_msg_addr();\n\n  (int op, int query_id) = (in_msg_body~load_uint(32), in_msg_body~load_uint(64));\n\n  if (op == burn_notification) { \n    ;; Sent by LP wallet after burning LP jettons to release liquidity\n    (int jetton_amount, slice from_address, slice response_address) = (in_msg_body~load_coins(), in_msg_body~load_msg_addr(), in_msg_body~load_msg_addr());\n    int gas_required = get_gas_fee(25000, WORKCHAIN);\n    cs~load_msg_addr(); \n    cs~load_coins(); \n    cs~skip_bits(1); \n    cs~load_coins(); \n    throw_unless(INSUFFICIENT_GAS, (msg_value > gas_required) & (msg_value > cs~load_coins() * 6)); ;; use fwd_fee to estimate messages\n\n    throw_unless(INVALID_CALLER, equal_slices(calculate_user_jetton_lp_wallet_address(from_address, my_address(), storage::jetton_lp_wallet_code), sender_address));\n    throw_unless(ZERO_OUTPUT, jetton_amount > 0); \n\n    ;; get shares\n    int amount0_out = (jetton_amount * storage::reserve0) / storage::total_supply_lp; \n    int amount1_out = (jetton_amount * storage::reserve1) / storage::total_supply_lp; \n    \n    ;; both are positive\n    throw_unless(ZERO_OUTPUT, (amount0_out > 0) & (amount1_out > 0));\n\n    storage::reserve0 -= amount0_out;\n    storage::reserve1 -= amount1_out;\n    storage::total_supply_lp -= jetton_amount;\n\n    int gas = 0;\n    int mode = CARRY_REMAINING_GAS;\n    if (response_address.preload_uint(2) != 0) {\n      gas = (msg_value - gas_required) / 2;\n      mode = NORMAL;\n      var body = begin_cell()\n        .store_uint(excesses, 32)\n        .store_uint(query_id, 64);\n      send_message_nobounce(gas, response_address, body.end_cell(), IGNORE_ERRORS);\n    }\n    call_pay_to(gas, mode, query_id, from_address, burn_ok, amount0_out, amount1_out);\n    save_storage();\n    return ();\n  }\n  \n  if (op == cb_add_liquidity) {\n    ;; Sent by user's lp_account after adding liquidity\n    ;; not throwable\n    (int tot_am0, int tot_am1, slice user_address, int min_lp_out) = (in_msg_body~load_coins(), in_msg_body~load_coins(), in_msg_body~load_msg_addr(), in_msg_body~load_coins());\n    cell acc_state_init = calculate_lp_account_state_init(user_address, my_address(), storage::lp_account_code); \n    throw_unless(INVALID_CALLER, equal_slices(calculate_lp_account_address(acc_state_init), sender_address));\n\n    int liquidity = 0;\n    slice to = \"\";\n\n    if (storage::total_supply_lp == 0) { \n      ;; handle initial liquidity\n      liquidity = sqrt(tot_am0 * tot_am1) / REQUIRED_MIN_LIQUIDITY;\n      to = addr_none(); ;; Lock the initial liquidity, so it will be impossible to fully drain the pool.\n    } else {\n      int to_mint0 = (tot_am0 * storage::total_supply_lp) / storage::reserve0;\n      int to_mint1 = (tot_am1 * storage::total_supply_lp) / storage::reserve1;\n      liquidity = min(to_mint0, to_mint1); ;; mint the minimum amount of liquidity, excesses will be shared proportionally across the pool\n\n      to = user_address;\n    }\n\n    storage::reserve0 += tot_am0;\n    storage::reserve1 += tot_am1;\n    storage::total_supply_lp += liquidity;\n\n    ;; checks if\n    ;; - the user will get less than the minimum amount of liquidity\n    ;; - reserves exceeds max supply\n    if ((liquidity < min_lp_out) | ((storage::reserve0 > MAX_COINS) | (storage::reserve1 > MAX_COINS))) {      \n      var body = begin_cell()\n        .store_uint(add_liquidity, 32)\n        .store_uint(query_id, 64)\n        .store_coins(tot_am0)\n        .store_coins(tot_am1)\n        .store_coins(0); ;; hardencode to zero to avoid minting loop between pool and lp_account\n      ;; state_init needed since lp_account might be already destroyed\n      send_message_with_stateinit(0, sender_address, acc_state_init, body.end_cell(), CARRY_REMAINING_GAS + IGNORE_ERRORS);\n    } else {\n      _mint_lp(query_id, to, liquidity);\n      save_storage();\n    }\n    return ();\n  }\n\n  if (op == cb_refund_me) {\n    ;; Sent by user's lp_account after adding liquidity\n    ;; throwable\n    (int tot_am0, int tot_am1, slice user_address) = (in_msg_body~load_coins(), in_msg_body~load_coins(), in_msg_body~load_msg_addr());\n    throw_unless(INVALID_CALLER, equal_slices(calculate_user_lp_account_address(user_address, my_address(), storage::lp_account_code), sender_address));\n    call_pay_to(0, CARRY_REMAINING_GAS, query_id, user_address, refund_ok, tot_am0, tot_am1);\n    return ();\n  }\n\n  ;; handle swap, provide_lp and governance messages\n  if (equal_slices(sender_address, storage::router_address)) {\n    handle_router_messages(op, query_id, my_balance, msg_value, in_msg_body);\n    return ();\n  }\n\n  ;; called by anyone\n  if (op == collect_fees) { ;; throwable\n    throw_unless(NO_LIQUIDITY, storage::total_supply_lp > REQUIRED_MIN_LIQUIDITY);\n    throw_unless(LOW_LIQUIDITY, (storage::collected_token0_protocol_fee > REQUIRED_MIN_COLLECT_FEES) & (storage::collected_token1_protocol_fee > REQUIRED_MIN_COLLECT_FEES));\n    throw_unless(INVALID_RECIPIENT, ~ equal_slices(storage::protocol_fee_address, HOLE_ADDRESS));\n    int gas_required = get_gas_fee(40000, WORKCHAIN);\n\n    throw_unless(INSUFFICIENT_GAS, (msg_value - gas_required) > 1000000000); ;; 1 ton\n    int gas = (msg_value - gas_required) / 4;\n    int reward0 = storage::collected_token0_protocol_fee / 1000;\n    int reward1 = storage::collected_token1_protocol_fee / 1000;\n    storage::collected_token0_protocol_fee -= reward0;\n    storage::collected_token1_protocol_fee -= reward1;\n\n    throw_unless(ZERO_OUTPUT, (reward0 > 0) & (reward1 > 0));\n    throw_unless(ZERO_OUTPUT, (storage::collected_token0_protocol_fee > 0) & (storage::collected_token1_protocol_fee > 0));\n\n    call_pay_to(gas * 3, NORMAL, query_id, storage::protocol_fee_address, 0, storage::collected_token0_protocol_fee, storage::collected_token1_protocol_fee); ;; revert if fails\n    call_pay_to(gas, IGNORE_ERRORS, query_id, sender_address, 0, reward0, reward1);\n\n    storage::collected_token0_protocol_fee = 0;\n    storage::collected_token1_protocol_fee = 0;\n    save_storage();\n    return ();\n  }\n\n  cs~load_msg_addr(); \n  cs~load_coins(); \n  cs~skip_bits(1); \n  cs~load_coins(); \n  ;; make sure that the message has a valid opcode\n  if (handle_getter_messages(msg_value, cs~load_coins(), op, query_id, sender_address, in_msg_body)) {\n    return (); \n  }\n\n  throw(WRONG_OP);\n}\n"
  },
  {
    "path": "contracts/pool.ts",
    "content": "import BN from \"bn.js\";\nimport { Cell, beginCell, Address } from \"ton\";\nimport { beginMessage } from \"./helpers\";\n\nexport function data(params: {\n  routerAddress: Address;\n  lpFee: BN;\n  protocolFee: BN;\n  refFee: BN;\n  protocolFeesAddress: Address;\n  collectedTokenAProtocolFees: BN;\n  collectedTokenBProtocolFees: BN;\n  reserve0: BN;\n  reserve1: BN;\n  wallet0: Address;\n  wallet1: Address;\n  supplyLP: BN;\n  LPWalletCode: Cell;\n  LPAccountCode: Cell;\n}): Cell {\n  return beginCell()\n    .storeAddress(params.routerAddress)\n    .storeUint(params.lpFee, 8)\n    .storeUint(params.protocolFee, 8)\n    .storeUint(params.refFee, 8)\n    .storeAddress(params.wallet0)\n    .storeAddress(params.wallet1)\n    .storeCoins(params.supplyLP)\n    .storeRef(\n      beginCell()\n        .storeCoins(params.collectedTokenAProtocolFees)\n        .storeCoins(params.collectedTokenBProtocolFees)\n        .storeAddress(params.protocolFeesAddress)\n        .storeCoins(params.reserve0)\n        .storeCoins(params.reserve1)\n        .endCell()\n    )\n    .storeRef(params.LPWalletCode)\n    .storeRef(params.LPAccountCode)\n    .endCell();\n}\n\nexport function setFees(params: { newLPFee: BN; newProtocolFees: BN; newRefFee: BN; newProtocolFeeAddress: Address }): Cell {\n  return beginMessage({ op: new BN(0x355423e5) })\n    .storeUint(params.newLPFee, 8)\n    .storeUint(params.newProtocolFees, 8)\n    .storeUint(params.newRefFee, 8)\n    .storeAddress(params.newProtocolFeeAddress)\n    .endCell();\n}\n\nexport function burnTokensNotification(params: { jettonAmount: BN; fromAddress: Address; responseAddress: Address | null }): Cell {\n  return beginMessage({ op: new BN(0x7bdd97de) })\n    .storeCoins(params.jettonAmount)\n    .storeAddress(params.fromAddress)\n    .storeAddress(params.responseAddress)\n    .endCell();\n}\n\nexport function collectFees(): Cell {\n  return beginMessage({ op: new BN(0x1fcb7d3d) }).endCell();\n}\n\nexport function resetGas(): Cell {\n  return beginMessage({ op: new BN(0x42a0fb43) }).endCell();\n}\n\nexport function swap(params: { fromAddress: Address; tokenWallet: Address; jettonAmount: BN; toAddress: Address; minOutput: BN; hasRef?: boolean; refAddress?: Address; }): Cell {\n  return beginMessage({ op: new BN(0x25938561) })\n    .storeAddress(params.fromAddress)\n    .storeAddress(params.tokenWallet)\n    .storeCoins(params.jettonAmount)\n    .storeCoins(params.minOutput)\n    .storeBit(!!params.hasRef)\n    .storeBit(true)\n    .storeRef(beginCell()\n      .storeAddress(params.fromAddress)\n      .storeAddress(params.refAddress || null)\n      .endCell())\n    .endCell();\n}\n\nexport function provideLiquidity(params: { fromAddress: Address; jettonAmount0: BN; jettonAmount1: BN; minLPOut: BN }): Cell {\n  return beginMessage({ op: new BN(0xfcf9e58f) })\n    .storeAddress(params.fromAddress)\n    .storeCoins(params.minLPOut)\n    .storeCoins(params.jettonAmount0)\n    .storeCoins(params.jettonAmount1)\n    .endCell();\n}\n\nexport function getPoolData(): Cell {\n  return beginMessage({ op: new BN(0x43c034e6) })\n    .endCell();\n}\n\nexport function getExpectedOutputs(params: { jettonAmount: BN, tokenSent: Address }): Cell {\n  return beginMessage({ op: new BN(0xed4d8b67) })\n    .storeCoins(params.jettonAmount)\n    .storeAddress(params.tokenSent)\n    .endCell();\n}\n\nexport function getCachedLPByAddress(params: { userAddress: Address }): Cell {\n  return beginMessage({ op: new BN(0x0c0671db) })\n    .storeAddress(params.userAddress)\n    .endCell();\n}\n"
  },
  {
    "path": "contracts/router/admin-calls.func",
    "content": ";; messages from admin\n\n() handle_admin_messages(int op, int query_id, int my_balance, int msg_value, slice in_msg_body) impure inline {\n    if (op == set_fees) { \n        (int new_lp_fee, int new_protocol_fee, int new_ref_fee, slice new_protocol_fee_address) = (in_msg_body~load_uint(8), in_msg_body~load_uint(8), in_msg_body~load_uint(8), in_msg_body~load_msg_addr());\n        cell ref_cs = in_msg_body~load_ref(); \n        slice ref_ds = ref_cs.begin_parse();\n        (slice jetton_wallet0, slice jetton_wallet1) = (ref_ds~load_msg_addr(), ref_ds~load_msg_addr());\n        (_, slice pool_address) = get_pool_state_init_and_address(jetton_wallet0, jetton_wallet1);\n        var body = begin_cell()\n            .store_uint(set_fees, 32)\n            .store_uint(query_id, 64)\n            .store_uint(new_lp_fee, 8)\n            .store_uint(new_protocol_fee, 8)\n            .store_uint(new_ref_fee, 8)\n            .store_slice(new_protocol_fee_address);\n        send_simple_message(0, pool_address, body.end_cell(), CARRY_REMAINING_GAS);\n        return ();\n    }\n\n    if (op == collect_fees){ \n        (slice jetton_wallet0, slice jetton_wallet1) = (in_msg_body~load_msg_addr(), in_msg_body~load_msg_addr());\n        (_, slice pool_address) = get_pool_state_init_and_address(jetton_wallet0, jetton_wallet1);\n        var body = begin_cell()\n            .store_uint(collect_fees, 32)\n            .store_uint(query_id, 64);\n        send_simple_message(0, pool_address, body.end_cell(), CARRY_REMAINING_GAS);\n        return ();\n    }\n\n    if (op == lock) { \n        storage::is_locked = 1; ;; true = -1 but is_locked is uint\n        save_storage();\n        return ();\n    }\n\n    if (op == unlock) { \n        storage::is_locked = false;\n        save_storage();\n        return ();\n    }\n    \n    if (op == init_code_upgrade) { \n        (int end_code, _, int end_admin, slice admin) = unpack_temp_upgrade(storage::temp_upgrade);\n        throw_unless(INVALID_CALL, end_code == 0); ;; upgrade already in progress\n        storage::temp_upgrade = pack_temp_upgrade(now() + SEVENDAYS,  in_msg_body~load_ref(), end_admin, admin);\n        save_storage();\n        return ();\n    }\n\n    if (op == init_admin_upgrade) { \n        (int end_code, cell new_code, int end_admin, _) = unpack_temp_upgrade(storage::temp_upgrade);\n        throw_unless(INVALID_CALL, end_admin == 0); ;; upgrade already in progress\n        storage::temp_upgrade = pack_temp_upgrade(end_code, new_code, now() + TWODAYS, in_msg_body~load_msg_addr());\n        save_storage();\n        return ();\n    }\n    \n    if (op == cancel_admin_upgrade) { \n        (int end_code, cell code, int end_admin, _) = unpack_temp_upgrade(storage::temp_upgrade);\n        throw_unless(INVALID_CALL, end_admin > 0); \n        storage::temp_upgrade = pack_temp_upgrade(end_code, code, 0, HOLE_ADDRESS);\n        save_storage();\n        return ();\n    }\n\n    if (op == cancel_code_upgrade) { \n        (int end_code, _, int end_admin, slice admin) = unpack_temp_upgrade(storage::temp_upgrade);\n        throw_unless(INVALID_CALL, end_code > 0); \n        storage::temp_upgrade = pack_temp_upgrade(0, empty_cell(), end_admin, admin);\n        save_storage();\n        return ();\n    }\n\n    ;; valid for both upgrades\n    if (op == finalize_upgrades) { \n        (int end_code, cell new_code, int end_admin, slice new_admin) = unpack_temp_upgrade(storage::temp_upgrade);\n        throw_unless(INVALID_CALL, (end_code + end_admin) > 0); ;; make sure at least one upgrade process is in progress\n\n        if ((end_code > 0) & (now() >= end_code)) {\n            set_code(new_code);\n            end_code = 0;\n            new_code = empty_cell();\n        }\n\n        if ((end_admin > 0) & (now() >= end_admin)) {\n            storage::admin_address = new_admin;\n            end_admin = 0;\n            new_admin = HOLE_ADDRESS;\n        }\n\n        storage::temp_upgrade = pack_temp_upgrade(end_code, new_code, end_admin, new_admin);\n        save_storage();\n        return ();\n    }\n\n    if (op == reset_gas) { \n        send_empty_message(my_balance - REQUIRED_TON_RESERVE, storage::admin_address, NORMAL);\n        return ();\n    }\n\n    if (op == reset_pool_gas) { \n        (slice jetton_wallet0, slice jetton_wallet1) = (in_msg_body~load_msg_addr(), in_msg_body~load_msg_addr());\n        (_, slice pool_address) = get_pool_state_init_and_address(jetton_wallet0, jetton_wallet1);\n        var body = begin_cell().store_uint(reset_gas, 32).store_uint(query_id, 64);\n        send_simple_message(0, pool_address, body.end_cell(), CARRY_REMAINING_GAS);\n        return ();\n    }\n\n    throw(WRONG_OP);\n}"
  },
  {
    "path": "contracts/router/errors.func",
    "content": "const ZERO_OUTPUT = 81;\nconst INVALID_CALLER = 82;\nconst INSUFFICIENT_GAS = 83;\nconst WRONG_WORKCHAIN = 85;\nconst WRONG_ADDRESS = 86;\nconst INVALID_AMOUNT = 87;\nconst INVALID_CALL = 88;\n\nconst WRONG_OP = 0xffff;"
  },
  {
    "path": "contracts/router/get.func",
    "content": ";; get methods\n\n\n(slice) get_pool_address(slice token0, slice token1) method_id {\n    load_storage();\n    throw_if(WRONG_ADDRESS, equal_slices(token0, token1)); \n    force_chain(WORKCHAIN, token0, WRONG_WORKCHAIN);\n    force_chain(WORKCHAIN, token1, WRONG_WORKCHAIN);\n    (_, slice pool_address) = get_pool_state_init_and_address(token0, token1);\n    return pool_address;\n}\n\n(int, slice, cell, cell, cell, cell) get_router_data() method_id {\n    load_storage();\n    return (\n        storage::is_locked == 1,\n        storage::admin_address,\n        storage::temp_upgrade,\n        storage::pool_code,\n        storage::jetton_lp_wallet_code,\n        storage::lp_account_code\n    );\n}"
  },
  {
    "path": "contracts/router/getter.func",
    "content": ";; onchain get methods\n\n(int) handle_getter_messages(int op, int query_id, slice sender_address, slice in_msg_body) impure inline {\n    raw_reserve(0, 4);\n\n    if(op == getter_pool_address){ \n        (slice token0, slice token1) = (in_msg_body~load_msg_addr(), in_msg_body~load_msg_addr());\n\n        throw_if(WRONG_ADDRESS, equal_slices(token0, token1)); \n        force_chain(WORKCHAIN, token0, WRONG_WORKCHAIN);\n        force_chain(WORKCHAIN, token1, WRONG_WORKCHAIN);\n\n        (_, slice pool_address) = get_pool_state_init_and_address(token0, token1);\n        \n        cell payload = begin_cell()\n            .store_uint(getter_pool_address, 32)\n            .store_uint(query_id, 64)\n            .store_slice(pool_address)\n        .end_cell();\n        send_payload(sender_address, payload);\n        return (true);\n    }\n\n    return (false); ;; wrong op\n}"
  },
  {
    "path": "contracts/router/op.func",
    "content": "const transfer = 0xf8a7ea5;\nconst transfer_notification = 0x7362d09c;\n\nconst swap = \"swap\"c;\nconst provide_lp = \"provide_lp\"c;\nconst pay_to = \"pay_to\"c;\nconst collect_fees = \"collect_fees\"c;\nconst set_fees = \"set_fees\"c;\nconst reset_gas = \"reset_gas\"c;\nconst reset_pool_gas = \"reset_pool_gas\"c;\nconst lock = \"lock\"c;\nconst unlock = \"unlock\"c;\n\nconst init_code_upgrade = \"init_code_upgrade\"c;\nconst init_admin_upgrade = \"init_admin_upgrade\"c;\nconst cancel_code_upgrade = \"cancel_code_upgrade\"c;\nconst cancel_admin_upgrade = \"cancel_admin_upgrade\"c;\nconst finalize_upgrades = \"finalize_upgrades\"c;\n\n;; async \"get\" calls\nconst getter_pool_address = \"getter_pool_address\"c;\n\n;; transfer refund statuses\nconst transfer_bounce_locked = \"transfer_bounce_locked\"c;\nconst transfer_bounce_invalid_request = \"transfer_bounce_invalid_request\"c;\n"
  },
  {
    "path": "contracts/router/params.func",
    "content": "const WORKCHAIN = 0;\nconst REQUIRED_TON_RESERVE = 100000;\nconst REQUIRED_FEES_WITHDRAW = 10;\nconst REQUIRED_MIN_TON_PAYTO = 30000000;\nconst BASE_FEE = 10000;\nconst MIN_TON_REQUIRED_FOR_FEES_COLLECTOR = 200000000; ;; 50000000 * 4\nconst TWODAYS = 172800; ;; 24 * 60 * 60 * 2\nconst SEVENDAYS = 604800; ;; 24 * 60 * 60 * 7\n\nconst HOLE_ADDRESS = \"EQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAM9c\"a;\nconst BASE_URI = \"https://lp.ston.fi/\"u;\n(cell) empty_cell() asm \"<b b> PUSHREF\";"
  },
  {
    "path": "contracts/router/storage.func",
    "content": "global int storage::is_locked;\nglobal slice storage::admin_address; \nglobal cell storage::jetton_lp_wallet_code; \nglobal cell storage::pool_code;\nglobal cell storage::lp_account_code; \nglobal cell storage::temp_upgrade;\n\n() load_storage() impure inline {\n    slice ds = get_data().begin_parse();\n    storage::is_locked = ds~load_uint(1);\n    storage::admin_address = ds~load_msg_addr();\n    storage::jetton_lp_wallet_code = ds~load_ref();\n    storage::pool_code = ds~load_ref();\n    storage::lp_account_code = ds~load_ref();\n    storage::temp_upgrade = ds~load_ref();\n}\n\n() save_storage() impure inline {\n    set_data(begin_cell()\n        .store_uint(storage::is_locked, 1)\n        .store_slice(storage::admin_address)\n        .store_ref(storage::jetton_lp_wallet_code)\n        .store_ref(storage::pool_code)\n        .store_ref(storage::lp_account_code)\n        .store_ref(storage::temp_upgrade)\n    .end_cell());\n}\n\n"
  },
  {
    "path": "contracts/router/utils.func",
    "content": "(slice) get_serialized_address(int workchain, int address) inline {\n    return (begin_cell()\n        .store_uint(4, 3)\n        .store_uint(workchain, 8)\n        .store_uint(address, 256)\n    ).end_cell().begin_parse();\n}\n\ncell pack_pool_data(slice token0_address, slice token1_address, cell jetton_lp_wallet_code, cell lp_account_code) inline_ref {\n    return begin_cell()\n        .store_slice(my_address())      ;; storage::router_address\n        .store_uint(20, 8)              ;; storage::lp_fee        (0.2% * FEE_DIVIDER)\n        .store_uint(10, 8)               ;; storage::protocol_fee (0.1% * FEE_DIVIDER)\n        .store_uint(10, 8)              ;; storage::ref_fee       (0.1% * FEE_DIVIDER)\n        .store_slice(token0_address)    ;; storage::token0_address\n        .store_slice(token1_address)    ;; storage::token1_address\n        .store_coins(0)                 ;; storage::total_supply_lp\n        .store_ref(begin_cell()\n            .store_coins(0)             ;; storage::collected_token0_protocol_fee\n            .store_coins(0)             ;; storage::collected_token1_protocol_fee\n            .store_slice(HOLE_ADDRESS)  ;; storage::protocol_fee_address\n            .store_coins(0)             ;; storage::reserve0\n            .store_coins(0)             ;; storage::reserve1\n        .end_cell())\n        .store_ref(jetton_lp_wallet_code)   ;; storage::jetton_lp_wallet_code\n        .store_ref(lp_account_code)         ;; storage::lp_account_code\n    .end_cell();\n}\n\n(cell, slice) get_pool_state_init_and_address(slice token0_address, slice token1_address) inline {\n    builder state_init_builder = begin_cell()\n        .store_uint(0, 2)\n        .store_dict(storage::pool_code);\n\n    if (slice_hash(token0_address) > slice_hash(token1_address)) {\n        state_init_builder = state_init_builder.store_dict(pack_pool_data(token0_address, token1_address, storage::jetton_lp_wallet_code, storage::lp_account_code));\n    } else {\n        state_init_builder = state_init_builder.store_dict(pack_pool_data(token1_address, token0_address, storage::jetton_lp_wallet_code, storage::lp_account_code));\n    }\n\n    cell state_init = state_init_builder\n        .store_uint(0, 1)\n        .end_cell();\n    \n    return (state_init, get_serialized_address(WORKCHAIN, cell_hash(state_init)));\n}\n\n(cell) pack_temp_upgrade(int end_code, cell code, int end_admin, slice admin) inline {\n    cell data = begin_cell()\n        .store_uint(end_code, 64)\n        .store_uint(end_admin, 64)\n        .store_slice(admin)\n        .store_ref(code)\n    .end_cell();\n    return data;\n}\n\n(int, cell, int, slice) unpack_temp_upgrade(cell c_data) inline {\n    slice s_data = c_data.begin_parse();\n    (int end_code, int end_admin, slice admin, cell code) = (s_data~load_uint(64), s_data~load_uint(64), s_data~load_msg_addr(), s_data~load_ref());\n    return (end_code, code, end_admin, admin);\n}\n"
  },
  {
    "path": "contracts/router.func",
    "content": "#pragma version >=0.2.0;\n\n#include \"common/stdlib.func\";\n#include \"common/gas.func\";\n#include \"common/jetton-utils.func\";\n#include \"common/messages.func\";\n#include \"router/op.func\";\n#include \"router/params.func\";\n#include \"router/errors.func\";\n#include \"router/storage.func\";\n#include \"router/utils.func\";\n#include \"common/utils.func\";\n#include \"router/get.func\"; \n#include \"router/admin-calls.func\"; \n#include \"router/getter.func\"; \n\n() recv_internal(int my_balance, int msg_value, cell in_msg_full, slice in_msg_body) impure {\n    if (in_msg_body.slice_empty?()) { ;; ignore empty messages\n        return ();\n    }\n\n    var cs = in_msg_full.begin_parse();\n    var flags = cs~load_uint(4);\n    \n    load_storage();\n\n    if (flags & 1) {\n        return ();\n    }\n    \n    slice sender_address = cs~load_msg_addr();\n    cs~load_msg_addr(); ;; skip dst\n    cs~load_coins(); ;; skip value\n    cs~skip_bits(1); ;; skip extracurrency collection\n    cs~load_coins(); ;; skip ihr_fee\n    int fwd_fee = cs~load_coins();\n\n    force_chain(WORKCHAIN, sender_address, WRONG_WORKCHAIN);\n\n    (int op, int query_id) = (in_msg_body~load_uint(32), in_msg_body~load_uint(64));\n\n    ;; send tokens, called from pools (on swap, liquidity providing, refund etc)\n    if (op == pay_to) { \n        int gas_required = get_gas_fee(20000, WORKCHAIN);\n        throw_unless(INSUFFICIENT_GAS, msg_value > gas_required);\n        (slice owner, int exit_code, cell cs_d) = (in_msg_body~load_msg_addr(), in_msg_body~load_uint(32), in_msg_body~load_ref()); \n        \n        ;; parse ref cell\n        slice psd = cs_d.begin_parse();\n        (int amount0_out, slice token0_address, int amount1_out, slice token1_address) = (psd~load_coins(), psd~load_msg_addr(), psd~load_coins(), psd~load_msg_addr());\n\n        (_, slice pool_address) = get_pool_state_init_and_address(token0_address, token1_address);\n        throw_unless(INVALID_CALLER, equal_slices(pool_address, sender_address)); ;; check if its a valid pool\n        \n        int ton_amount = 0;\n        int mode = CARRY_REMAINING_GAS;\n\n        ;; Either one or both amounts must be non-zero\n        if ((amount0_out > 0) & (amount1_out > 0)) {\n            ;; Divide remaining ton_amount between two transactions\n            ton_amount = (msg_value - gas_required) / 2;\n            mode = NORMAL;\n        }\n\n        if (amount0_out > 0) {\n            var body0 = create_simple_transfer_body(query_id, 0, amount0_out, owner);\n            body0 = body0.store_uint(exit_code, 32); ;; append exit code\n            send_simple_message(ton_amount, token0_address, body0.end_cell(), mode | IGNORE_ERRORS);\n        }\n\n        if (amount1_out > 0) {\n            var body1 = create_simple_transfer_body(query_id, 0, amount1_out, owner);\n            body1 = body1.store_uint(exit_code, 32); ;; append exit code\n            send_simple_message(ton_amount, token1_address, body1.end_cell(), mode | IGNORE_ERRORS);\n        }\n\n        return ();\n    }\n\n    if (op == transfer_notification) {\n        (int jetton_amount, slice from_user) = (in_msg_body~load_coins(), in_msg_body~load_msg_addr());\n        cell ref_cs = in_msg_body~load_ref(); \n        slice ref_ds = ref_cs.begin_parse();\n        \n        throw_unless(INVALID_AMOUNT, jetton_amount > 0);\n        \n        (int transferred_op, slice token_wallet1) = (ref_ds~load_uint(32), ref_ds~load_msg_addr());\n        force_chain(WORKCHAIN, token_wallet1, WRONG_WORKCHAIN);\n\n        ;; check if the call is valid\n        if ((fwd_fee * 6 >  msg_value) | equal_slices(sender_address, token_wallet1) | storage::is_locked) {\n            ;; refund jettons\n            var body = create_simple_transfer_body(query_id, 0, jetton_amount, from_user);\n            if (storage::is_locked) {\n                body = body.store_uint(transfer_bounce_locked, 32);\n            } else {\n                body = body.store_uint(transfer_bounce_invalid_request, 32);\n            }\n            send_simple_message(0, sender_address, body.end_cell(), CARRY_REMAINING_GAS);\n        } else {\n            ;; route call to the correct pool\n            if (transferred_op == swap) {\n                (int min_out, slice to_address, int has_ref) = (ref_ds~load_coins(), ref_ds~load_msg_addr(), ref_ds~load_uint(1));\n                (_, slice pool_address) = get_pool_state_init_and_address(sender_address, token_wallet1);\n                \n                builder body = begin_cell()\n                    .store_uint(swap, 32)\n                    .store_uint(query_id, 64)\n                    .store_slice(to_address)\n                    .store_slice(sender_address)\n                    .store_coins(jetton_amount)\n                    .store_coins(min_out)\n                    .store_uint(has_ref, 1);\n\n                builder body_ref = begin_cell()\n                    .store_slice(from_user); ;; real caller\n                \n                if (has_ref) {\n                    slice ref_address = ref_ds~load_msg_addr();\n                    body_ref = body_ref.store_slice(ref_address);\n                }\n\n                body = body.store_ref(body_ref.end_cell());\n\n                send_simple_message(0, pool_address, body.end_cell(), CARRY_REMAINING_GAS);\n                return ();\n            }\n\n            if (transferred_op == provide_lp) {\n                int min_lp_out = ref_ds~load_coins();\n                (cell state_init, slice pool_address) = get_pool_state_init_and_address(sender_address, token_wallet1);\n\n                builder msg_body = begin_cell()\n                    .store_uint(provide_lp, 32)\n                    .store_uint(query_id, 64)\n                    .store_slice(from_user)\n                    .store_coins(min_lp_out);\n\n                if (slice_hash(sender_address) > slice_hash(token_wallet1)) {\n                    msg_body = msg_body.store_coins(jetton_amount);\n                    msg_body = msg_body.store_coins(0);\n                } else {\n                    msg_body = msg_body.store_coins(0);\n                    msg_body = msg_body.store_coins(jetton_amount);\n                }\n\n                send_message_with_stateinit(0, pool_address, state_init, msg_body.end_cell(), CARRY_REMAINING_GAS);\n                return ();\n            }\n        }\n        return ();\n    }\n\n    ;; handle governance message from admin to change pool parameters\n    if (equal_slices(sender_address, storage::admin_address)) {\n        handle_admin_messages(op, query_id, my_balance, msg_value, in_msg_body);\n        return ();\n    }\n\n    ;; make sure that the message has been processed\n    if (handle_getter_messages(op, query_id, sender_address, in_msg_body)) {\n        return (); \n    }\n\n    throw(WRONG_OP);\n}\n"
  },
  {
    "path": "contracts/router.ts",
    "content": "import BN from \"bn.js\";\nimport { Cell, beginCell, Address } from \"ton\";\nimport { beginMessage } from \"./helpers\";\n\nexport function data(params: { isLocked: boolean; adminAddress: Address; LPWalletCode: Cell; poolCode: Cell; LPAccountCode: Cell; }): Cell {\n  return beginCell()\n    .storeUint(params.isLocked ? 1 : 0, 1)\n    .storeAddress(params.adminAddress)\n    .storeRef(params.LPWalletCode)\n    .storeRef(params.poolCode)\n    .storeRef(params.LPAccountCode)\n    .storeRef(beginCell()\n      .storeUint(0, 64)\n      .storeUint(0, 64)\n      .storeAddress(null)\n      .storeRef(beginCell().endCell())\n      .endCell())\n    .endCell();\n}\n\nexport function setFees(params: {\n  jetton0Address: Address;\n  jetton1Address: Address;\n  newLPFee: BN;\n  newProtocolFee: BN;\n  newRefFee: BN;\n  newProtocolFeeAddress: Address;\n}): Cell {\n  return beginMessage({ op: new BN(0x355423e5) })\n    .storeUint(params.newLPFee, 8)\n    .storeUint(params.newProtocolFee, 8)\n    .storeUint(params.newRefFee, 8)\n    .storeAddress(params.newProtocolFeeAddress)\n    .storeRef(beginCell()\n      .storeAddress(params.jetton0Address)\n      .storeAddress(params.jetton1Address)\n      .endCell())\n    .endCell();\n}\n\nexport function initCodeUpgrade(params: { newCode: Cell; }): Cell {\n  return beginMessage({ op: new BN(0xdf1e233d) })\n    .storeRef(params.newCode)\n    .endCell();\n}\n\nexport function initAdminUpgrade(params: { newAdmin: Address; }): Cell {\n  return beginMessage({ op: new BN(0x2fb94384) })\n    .storeAddress(params.newAdmin)\n    .endCell();\n}\n\nexport function cancelCodeUpgrade(): Cell {\n  return beginMessage({ op: new BN(0x357ccc67) })\n    .endCell();\n}\n\nexport function cancelAdminUpgrade(): Cell {\n  return beginMessage({ op: new BN(0xa4ed9981) })\n    .endCell();\n}\n\n\nexport function finalizeUpgrades(): Cell {\n  return beginMessage({ op: new BN(0x6378509f) })\n    .endCell();\n}\n\nexport function resetGas(): Cell {\n  return beginMessage({ op: new BN(0x42a0fb43) }).endCell();\n}\n\nexport function lock(): Cell {\n  return beginMessage({ op: new BN(0x878f9b0e) })\n    .endCell();\n}\n\nexport function unlock(): Cell {\n  return beginMessage({ op: new BN(0x6ae4b0ef) })\n    .endCell();\n}\n\nexport function collectFees(params: {\n  jetton0Address: Address;\n  jetton1Address: Address;\n}): Cell {\n  return beginMessage({ op: new BN(0x1fcb7d3d) })\n    .storeAddress(params.jetton0Address)\n    .storeAddress(params.jetton1Address)\n    .endCell();\n}\n\nexport function payTo(params: { owner: Address; tokenAAmount: BN; walletTokenAAddress: Address; tokenBAmount: BN; walletTokenBAddress: Address }): Cell {\n  return beginMessage({ op: new BN(0xf93bb43f) })\n    .storeAddress(params.owner)\n    .storeUint(new BN(0), 32)\n    .storeRef(\n      beginCell()\n        .storeCoins(params.tokenAAmount)\n        .storeAddress(params.walletTokenAAddress)\n        .storeCoins(params.tokenBAmount)\n        .storeAddress(params.walletTokenBAddress)\n        .endCell()\n    )\n    .endCell();\n}\n\nexport function swap(params: { jettonAmount: BN; fromAddress: Address; walletTokenBAddress: Address; toAddress: Address; expectedOutput: BN; refAddress?: Address; }): Cell {\n  let swapPayload = beginCell()\n    .storeUint(new BN(0x25938561), 32)\n    .storeAddress(params.walletTokenBAddress)\n    .storeCoins(params.expectedOutput)\n    .storeAddress(params.toAddress)\n    .storeBit(!!params.refAddress);\n\n  if (!!params.refAddress)\n    swapPayload.storeAddress(params.refAddress || null);\n\n  return beginMessage({ op: new BN(0x7362d09c) })\n    .storeCoins(params.jettonAmount)\n    .storeAddress(params.fromAddress)\n    .storeBit(true)\n    .storeRef(swapPayload.endCell())\n    .endCell();\n}\n\nexport function provideLiquidity(params: { jettonAmount: BN; fromAddress: Address; walletTokenBAddress: Address; minLPOut: BN }): Cell {\n  return beginMessage({ op: new BN(0x7362d09c) })\n    .storeCoins(params.jettonAmount)\n    .storeAddress(params.fromAddress)\n    .storeBit(true)\n    .storeRef(beginCell()\n      .storeUint(new BN(0xfcf9e58f), 32)\n      .storeAddress(params.walletTokenBAddress)\n      .storeCoins(params.minLPOut)\n      .endCell())\n    .endCell();\n}\n\nexport function getPoolAddress(params: { walletTokenAAddress: Address; walletTokenBAddress: Address }): Cell {\n  return beginMessage({ op: new BN(0xd1db969b) })\n    .storeAddress(params.walletTokenAAddress)\n    .storeAddress(params.walletTokenBAddress)\n    .endCell();\n}\n"
  },
  {
    "path": "package.json",
    "content": "{\n    \"name\": \"@ston-fi/dex-core\",\n    \"description\": \"Core contracts for the STON.fi DEX protocol\",\n    \"version\": \"1.0.0\",\n    \"homepage\": \"https://ston.fi\",\n    \"license\": \"GPL-3.0\",\n    \"keywords\": [\n        \"dex\",\n        \"core\",\n        \"defi\"\n    ],\n    \"repository\": {\n        \"type\": \"git\",\n        \"url\": \"https://github.com/ston-fi/dex-core\"\n    },\n    \"scripts\": {\n        \"prettier\": \"npx prettier --write '{test,contracts,build}/**/*.{ts,js,json}'\",\n        \"test\": \"mocha --exit test/**/*.spec.ts\",\n        \"build\": \"ts-node ./build/_build.ts\",\n        \"deploy\": \"ts-node ./build/_deploy.ts\",\n        \"deploy:testnet\": \"ts-node ./build/_deploy.ts\"\n    },\n    \"devDependencies\": {\n        \"@swc/core\": \"^1.2.177\",\n        \"@types/bn.js\": \"^5.1.0\",\n        \"@types/chai\": \"^4.3.0\",\n        \"@types/mocha\": \"^9.0.0\",\n        \"axios-request-throttle\": \"^1.0.0\",\n        \"chai\": \"^4.3.4\",\n        \"chai-bn\": \"^0.3.1\",\n        \"dotenv\": \"^16.0.0\",\n        \"fast-glob\": \"^3.2.11\",\n        \"mocha\": \"^9.1.3\",\n        \"prando\": \"^6.0.1\",\n        \"prettier\": \"^2.6.2\",\n        \"ton\": \"^12.2.8\",\n        \"ton-contract-executor\": \"^0.4.8\",\n        \"ton-crypto\": \"^3.2.0\",\n        \"ts-node\": \"^10.4.0\",\n        \"typescript\": \"^4.5.4\",\n        \"@ton-community/func-js\": \"^0.1.5\",\n        \"ton-compiler\": \"^2.0.0\"\n    },\n    \"prettier\": {\n        \"printWidth\": 180\n    },\n    \"mocha\": {\n        \"require\": [\n            \"chai\",\n            \"ts-node/register\"\n        ],\n        \"timeout\": 20000\n    },\n    \"engines\": {\n        \"node\": \">=16.0.0\"\n    }\n}"
  },
  {
    "path": "test/account.spec.ts",
    "content": "import chai, { expect, use } from \"chai\";\nimport chaiBN from \"chai-bn\";\nimport BN from \"bn.js\";\nchai.use(chaiBN(BN));\n\nimport * as fs from \"fs\";\nimport { Cell, beginCell, Address, toNano, Slice } from \"ton\";\nimport { SmartContract, buildC7, SendMsgAction } from \"ton-contract-executor\";\nimport * as lp_account from \"../contracts/lp_account\";\nimport { internalMessage, randomAddress, setBalance, parseUri } from \"./helpers\";\n\ndescribe(\"lp_account tests\", () => {\n    let contract: SmartContract,\n        pool: Address,\n        user: Address;\n\n    beforeEach(async () => {\n        pool = randomAddress(\"pool\");\n        user = randomAddress(\"user\");\n        contract = await SmartContract.fromCell(\n            Cell.fromBoc(fs.readFileSync(\"build/lp_account.cell\"))[0],\n            lp_account.data({\n                user: user,\n                pool: pool,\n                stored0: toNano(0),\n                stored1: toNano(0),\n            })\n        );\n    });\n\n    it(\"should reset gas\", async () => {\n        setBalance(contract, toNano(5));\n\n        const sendWrongAddress = await contract.sendInternalMessage(\n            internalMessage({\n                from: randomAddress(\"someone\"),\n                value: toNano(7000000000),\n                body: lp_account.resetGas(),\n            })\n        );\n\n        expect(sendWrongAddress.type).to.be.equal(\"failed\");\n        expect(sendWrongAddress.actionList.length).to.equal(0);\n\n        const send = await contract.sendInternalMessage(\n            internalMessage({\n                from: user,\n                value: toNano(7000000000),\n                body: lp_account.resetGas(),\n            })\n        );\n\n        expect(send.type).to.be.equal(\"success\");\n        expect(send.actionList.length).to.equal(1);\n    });\n\n    it(\"should store new liquidity and ask for minting\", async () => {\n        const sendWrongSender = await contract.sendInternalMessage(\n            internalMessage({\n                from: user,\n                value: toNano(7000000000),\n                body: lp_account.addLiquidity({\n                    newAmount0: toNano(1),\n                    newAmount1: toNano(0),\n                    minLPOut: toNano(1),\n                }),\n            })\n        );\n        expect(sendWrongSender.type).to.be.equal(\"failed\");\n\n        const send = await contract.sendInternalMessage(\n            internalMessage({\n                from: pool,\n                value: toNano(7000000000),\n                body: lp_account.addLiquidity({\n                    newAmount0: toNano(1),\n                    newAmount1: toNano(0),\n                    minLPOut: toNano(1),\n                }),\n            })\n        );\n\n        expect(send.type).to.be.equal(\"success\");\n        expect(send.actionList.length).to.equal(0);\n\n\n        const sendCB = await contract.sendInternalMessage(\n            internalMessage({\n                from: pool,\n                value: toNano(7000000000),\n                body: lp_account.addLiquidity({\n                    newAmount0: toNano(0),\n                    newAmount1: toNano(10),\n                    minLPOut: toNano(1),\n                }),\n            })\n        );\n\n        expect(sendCB.type).to.be.equal(\"success\");\n        expect(sendCB.actionList.length).to.equal(1);\n\n        const sendRefund = await contract.sendInternalMessage(\n            internalMessage({\n                from: pool,\n                value: toNano(7000000000),\n                body: lp_account.addLiquidity({\n                    newAmount0: toNano(0),\n                    newAmount1: toNano(10),\n                    minLPOut: toNano(0),\n                }),\n            })\n        );\n\n        expect(sendRefund.type).to.be.equal(\"success\");\n        expect(sendRefund.actionList.length).to.equal(0);\n\n    });\n\n    it(\"should ask for minting new liquidity directly\", async () => {\n        const sendWrongSender = await contract.sendInternalMessage(\n            internalMessage({\n                from: randomAddress(\"someone\"),\n                value: toNano(7000000000),\n                body: lp_account.directAddLiquidity({\n                    amount0: toNano(1),\n                    amount1: toNano(0),\n                    minLPOut: toNano(1),\n                }),\n            })\n        );\n        expect(sendWrongSender.type).to.be.equal(\"failed\");\n\n        const sendLowBalances = await contract.sendInternalMessage(\n            internalMessage({\n                from: user,\n                value: toNano(7000000000),\n                body: lp_account.directAddLiquidity({\n                    amount0: toNano(1),\n                    amount1: toNano(0),\n                    minLPOut: toNano(1),\n                }),\n            })\n        );\n        expect(sendLowBalances.type).to.be.equal(\"failed\");\n\n        setBalance(contract, toNano(5));\n        contract.setDataCell(\n            lp_account.data({\n                stored0: toNano(10),\n                stored1: toNano(10),\n                user: user,\n                pool: pool,\n            })\n        );\n\n        const send = await contract.sendInternalMessage(\n            internalMessage({\n                from: user,\n                value: toNano(7000000000),\n                body: lp_account.directAddLiquidity({\n                    amount0: toNano(1),\n                    amount1: toNano(3),\n                    minLPOut: toNano(1),\n                }),\n            })\n        );\n\n        expect(send.type).to.be.equal(\"success\");\n        expect(send.actionList.length).to.equal(1);\n    });\n\n\n    it(\"should refund user\", async () => {\n        const sendWrongSender = await contract.sendInternalMessage(\n            internalMessage({\n                from: randomAddress(\"someone\"),\n                value: toNano(7000000000),\n                body: lp_account.refundMe(),\n            })\n        );\n        expect(sendWrongSender.type).to.be.equal(\"failed\");\n\n        const sendLowBalances = await contract.sendInternalMessage(\n            internalMessage({\n                from: user,\n                value: toNano(7000000000),\n                body: lp_account.refundMe(),\n            })\n        );\n        expect(sendLowBalances.type).to.be.equal(\"failed\");\n\n        setBalance(contract, toNano(5));\n        contract.setDataCell(\n            lp_account.data({\n                stored0: toNano(10),\n                stored1: toNano(10),\n                user: user,\n                pool: pool,\n            })\n        );\n\n        const send = await contract.sendInternalMessage(\n            internalMessage({\n                from: user,\n                value: toNano(7000000000),\n                body: lp_account.refundMe(),\n            })\n        );\n\n        expect(send.type).to.be.equal(\"success\");\n        expect(send.actionList.length).to.equal(1);\n    });\n});"
  },
  {
    "path": "test/helpers.ts",
    "content": "import BN from \"bn.js\";\nimport { Address, Cell, CellMessage, InternalMessage, CommonMessageInfo, WalletContract, SendMode, Wallet, Builder, beginCell, beginDict } from \"ton\";\nimport { SmartContract } from \"ton-contract-executor\";\nimport Prando from \"prando\";\n\nconst CHUNK_DATA_PREFIX = 0x01;\nconst OFFCHAIN_CONTENT_PREFIX = 0x01;\n\nexport const zeroAddress = new Address(0, Buffer.alloc(32, 0));\n\nexport function randomAddress(seed: string, workchain?: number) {\n  const random = new Prando(seed);\n  const hash = Buffer.alloc(32);\n  for (let i = 0; i < hash.length; i++) {\n    hash[i] = random.nextInt(0, 255);\n  }\n  return new Address(workchain ?? 0, hash);\n}\n\nexport function internalMessage(params: { from?: Address; to?: Address; value?: BN; bounce?: boolean; bounced?: boolean; body?: Cell }) {\n  const message = params.body ? new CellMessage(params.body) : undefined;\n  return new InternalMessage({\n    from: params.from ?? randomAddress(\"sender\"),\n    to: params.to ?? zeroAddress,\n    value: params.value ?? 0,\n    bounce: params.bounce ?? true,\n    bounced: params.bounced ?? false,\n    body: new CommonMessageInfo({ body: message }),\n  });\n}\n\nexport function setBalance(contract: SmartContract, balance: BN) {\n  contract.setC7Config({\n    balance: balance.toNumber(),\n  });\n}\n\nexport function setNetworkConfig(contract: SmartContract) {\n  // this is a hack to set network config\n  // it's a dump of the real network config, it's enough for testing\n  let configDump = 'te6cckICA/0AAQAAntoAAAIBIAAGAAECAvUABAACAQOncwADAYHdJMSh8riPi3BTUTtcxsWjG8RLKnLctNjAM4rw8NN+xStXhEPsEP6P8L5ey7wUE70E447AhKM09sELy1yrrzwZwAAMAQOkMwAFAEDLudEGKVRDmoOpHyeDX7nS4+eYkQNWZQw8STyUYjRkaAIC2AAdAAcCAWIACgAIAQHcAAkBwU1cAhCzXa3aohn6xFnboP3vsfrk6XoNB5dzn+BQ1pTKDr1/+cpw4G6eIqiSL1rnUhGp1qNKgJTo4Vh7YGvbtmKAAAAAAAAAAAAAAAA7U8vSzdFgu5NEtLtb2bo9/o6RB8AADAEB/AALAcHdJMSh8riPi3BTUTtcxsWjG8RLKnLctNjAM4rw8NN+xTubv9CtUzi5cA8IMzgO4X1GPlHBrmce5vCJAb3ombICgAAAAAAAAAAAAAAALBbDlQ2Ep+JHrvGOnbn5bN8j73jAAAwCASAAFAANAgFYABMADgIBSAASAA8CAVgAEQAQAIG+RKqaadCnje9HfxNfNLilT0+K2YZrFOUkt8Mve5SRAGAAAAAAAAAAAAAAAABz6dEMhlep55agxfMMPf3n7VtFEACBvmmMMnQNMca8fZIP+x0yN8gWr6U5ByGQu8VgDeEvwxEgAAAAAAAAAAAAAAAP5XdVgp4eMGnNoEM/EKtL7DP8WJAAgb7Sh7LpRZwVdThtIdwoxok0VwOBgOviYK5sYcUz2FIYmAAAAAAAAAAAAAAAAEmbnDTO45niNQamX17RfCFw1j7MAIG/X7BE4d+cHa1Ku+INz+IhIOcCQYgWeItfGbthwsz7nP4AAAAAAAAAAAAAAAGJk3sG1XFojKMubCzSM8esSSPAgwIBIAAYABUCAW4A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MzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMBASAD/ABAVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVXnpsUz';\n\n  const dataBuffer = Buffer.from(configDump, 'base64');\n  const state = Cell.fromBoc(dataBuffer)[0];\n  contract.setC7Config({\n    globalConfig: state,\n  });\n}\n\n\nexport async function sendInternalMessageWithWallet(params: { walletContract: WalletContract; secretKey: Buffer; to: Address; value: BN; bounce?: boolean; body?: Cell }) {\n  const message = params.body ? new CellMessage(params.body) : undefined;\n  const seqno = await params.walletContract.getSeqNo();\n  const transfer = params.walletContract.createTransfer({\n    secretKey: params.secretKey,\n    seqno: seqno,\n    sendMode: SendMode.PAY_GAS_SEPARATLY + SendMode.IGNORE_ERRORS,\n    order: new InternalMessage({\n      to: params.to,\n      value: params.value,\n      bounce: params.bounce ?? false,\n      body: new CommonMessageInfo({\n        body: message,\n      }),\n    }),\n  });\n  await params.walletContract.client.sendExternalMessage(params.walletContract, transfer);\n  for (let attempt = 0; attempt < 10; attempt++) {\n    await sleep(2000);\n    const seqnoAfter = await params.walletContract.getSeqNo();\n    if (seqnoAfter > seqno) return;\n  }\n}\n\nexport function parseUri(cell: Cell) {\n  return new TextDecoder().decode(cell.beginParse().readRemainingBytes().slice(1)); // skip prefix\n}\nexport function createOffchainUriCell(uri: string) {\n  return beginCell()\n    .storeUint(OFFCHAIN_CONTENT_PREFIX, 8)\n    .storeBitArray([].slice.call(serializeUri(uri)))\n    .endCell();\n}\n\nexport function serializeUri(uri: string) {\n  return new TextEncoder().encode(encodeURI(uri));\n}\n\nfunction sleep(ms: number) {\n  return new Promise((resolve) => setTimeout(resolve, ms));\n}\n"
  },
  {
    "path": "test/pool.spec.ts",
    "content": "import chai, { expect } from \"chai\";\nimport chaiBN from \"chai-bn\";\nimport BN from \"bn.js\";\nchai.use(chaiBN(BN));\n\nimport * as fs from \"fs\";\nimport { Cell, beginCell, Address, toNano, Slice } from \"ton\";\nimport { SmartContract, buildC7, SendMsgAction } from \"ton-contract-executor\";\nimport * as pool from \"../contracts/pool\";\nimport { internalMessage, randomAddress, setBalance, parseUri, setNetworkConfig, zeroAddress } from \"./helpers\";\n\ndescribe(\"pool tests\", () => {\n  let contract: SmartContract, routerAddress: Address;\n\n  beforeEach(async () => {\n    routerAddress = randomAddress(\"a valid pool\");\n    contract = await SmartContract.fromCell(\n      Cell.fromBoc(fs.readFileSync(\"build/pool.cell\"))[0],\n      pool.data({\n        routerAddress: routerAddress,\n        lpFee: new BN(20),\n        protocolFee: new BN(0),\n        refFee: new BN(10),\n        protocolFeesAddress: randomAddress(\"a valid protocol fee address\"),\n        collectedTokenAProtocolFees: new BN(0),\n        collectedTokenBProtocolFees: new BN(0),\n        wallet0: randomAddress(\"wallet0\"),\n        wallet1: randomAddress(\"wallet1\"),\n        reserve0: new BN(0),\n        reserve1: new BN(0),\n        supplyLP: new BN(0),\n        LPWalletCode: Cell.fromBoc(fs.readFileSync(\"build/lp_wallet.cell\"))[0],\n        LPAccountCode: Cell.fromBoc(fs.readFileSync(\"build/lp_account.cell\"))[0],\n      })\n    );\n  });\n\n  it(\"should mint lp tokens\", async () => {\n    setBalance(contract, toNano(5));\n    contract = await SmartContract.fromCell(\n      Cell.fromBoc(fs.readFileSync(\"build/pool.cell\"))[0],\n      pool.data({\n        routerAddress: routerAddress,\n        lpFee: new BN(20),\n        protocolFee: new BN(0),\n        refFee: new BN(10),\n        protocolFeesAddress: randomAddress(\"a valid protocol fee address\"),\n        collectedTokenAProtocolFees: new BN(0),\n        collectedTokenBProtocolFees: new BN(0),\n        wallet0: randomAddress(\"wallet0\"),\n        wallet1: randomAddress(\"wallet1\"),\n        reserve0: new BN(0),\n        reserve1: new BN(0),\n        supplyLP: new BN(0),\n        LPWalletCode: Cell.fromBoc(fs.readFileSync(\"build/lp_wallet.cell\"))[0],\n        LPAccountCode: Cell.fromBoc(fs.readFileSync(\"build/lp_account.cell\"))[0],\n      })\n    );\n\n    const sendToken0 = await contract.sendInternalMessage(\n      internalMessage({\n        from: routerAddress,\n        value: toNano(7000000000),\n        body: pool.provideLiquidity({\n          fromAddress: randomAddress(\"user\"),\n          jettonAmount0: new BN(0),\n          jettonAmount1: new BN(1000001),\n          minLPOut: new BN(1),\n        }),\n      })\n    );\n    expect(sendToken0.type).to.be.equal(\"success\");\n    expect(sendToken0.actionList.length).to.equal(1);\n\n    const sendToken1 = await contract.sendInternalMessage(\n      internalMessage({\n        from: routerAddress,\n        value: toNano(7000000000),\n        body: pool.provideLiquidity({\n          fromAddress: randomAddress(\"user\"),\n          jettonAmount0: new BN(100000001),\n          jettonAmount1: new BN(0),\n          minLPOut: new BN(1),\n        }),\n      })\n    );\n    expect(sendToken1.type).to.be.equal(\"success\");\n    expect(sendToken1.actionList.length).to.equal(1);\n  });\n\n  it(\"should reset gas\", async () => {\n    setBalance(contract, toNano(5));\n    const send = await contract.sendInternalMessage(\n      internalMessage({\n        from: routerAddress,\n        value: toNano(70000000),\n        body: pool.resetGas(),\n      })\n    );\n    expect(send.type).to.be.equal(\"success\");\n    expect(send.actionList.length).to.be.equal(1);\n  });\n\n  it(\"should allow burning\", async () => {\n    setBalance(contract, toNano(5));\n    setNetworkConfig(contract);\n    contract.setDataCell(\n      pool.data({\n        routerAddress: routerAddress,\n        lpFee: new BN(20),\n        protocolFee: new BN(0),\n        refFee: new BN(10),\n        protocolFeesAddress: randomAddress(\"a valid protocol fee address\"),\n        collectedTokenAProtocolFees: new BN(0),\n        collectedTokenBProtocolFees: new BN(0),\n        wallet0: randomAddress(\"wallet0\"),\n        wallet1: randomAddress(\"wallet1\"),\n        reserve0: new BN(10000),\n        reserve1: new BN(204030300),\n        supplyLP: new BN(1000),\n        LPWalletCode: Cell.fromBoc(fs.readFileSync(\"build/lp_wallet.cell\"))[0],\n        LPAccountCode: Cell.fromBoc(fs.readFileSync(\"build/lp_account.cell\"))[0],\n      })\n    );\n\n    const userAddress = beginCell().storeAddress(randomAddress(\"user1\")).endCell();\n    const callWalletAddress = await contract.invokeGetMethod(\"get_wallet_address\", [{ type: \"cell_slice\", value: userAddress.toBoc({ idx: false }).toString(\"base64\") }]);\n\n    expect(callWalletAddress.type).to.equal(\"success\");\n    const userWalletAddress = (callWalletAddress.result[0] as Slice).readAddress() as Address;\n\n    const sendWrongAmount = await contract.sendInternalMessage(\n      internalMessage({\n        from: userWalletAddress,\n        value: toNano(70000000),\n        body: pool.burnTokensNotification({\n          fromAddress: randomAddress(\"user1\"),\n          jettonAmount: new BN(0),\n          responseAddress: null,\n        }),\n      })\n    );\n    expect(sendWrongAmount.type).to.be.equal(\"failed\");\n    expect(sendWrongAmount.actionList.length).to.be.equal(0);\n\n    const send = await contract.sendInternalMessage(\n      internalMessage({\n        from: userWalletAddress,\n        value: toNano(1),\n        body: pool.burnTokensNotification({\n          fromAddress: randomAddress(\"user1\"),\n          jettonAmount: new BN(100),\n          responseAddress: userWalletAddress,\n        }),\n      })\n    );\n    expect(send.type).to.be.equal(\"success\");\n    expect(send.actionList.length).to.be.equal(2);\n    expect((send.actionList[1] as SendMsgAction).message.info.dest?.toString()).to.be.equal(routerAddress.toString());\n\n    const callPoolData = await contract.invokeGetMethod(\"get_pool_data\", []);\n    // @ts-ignore\n    expect(callPoolData.result[0] as BN).to.be.a.bignumber.that.is.lessThan(new BN(10000));\n    // @ts-ignore\n    expect(callPoolData.result[1] as BN).to.be.a.bignumber.that.is.lessThan(new BN(204030300));\n\n  });\n\n  it(\"should allow collecting fees\", async () => {\n    setBalance(contract, toNano(5));\n    setNetworkConfig(contract);\n\n    contract.setDataCell(\n      pool.data({\n        routerAddress: routerAddress,\n        lpFee: new BN(20),\n        protocolFee: new BN(0),\n        refFee: new BN(10),\n        protocolFeesAddress: zeroAddress,\n        collectedTokenAProtocolFees: new BN(110),\n        collectedTokenBProtocolFees: new BN(440),\n        wallet0: randomAddress(\"wallet0\"),\n        wallet1: randomAddress(\"wallet1\"),\n        reserve0: new BN(1310),\n        reserve1: new BN(203333),\n        supplyLP: new BN(10000000),\n        LPWalletCode: Cell.fromBoc(fs.readFileSync(\"build/lp_wallet.cell\"))[0],\n        LPAccountCode: Cell.fromBoc(fs.readFileSync(\"build/lp_account.cell\"))[0],\n      })\n    );\n\n    const sendCollectFeesNoFeeAddress = await contract.sendInternalMessage(\n      internalMessage({\n        from: routerAddress,\n        value: toNano(0.5),\n        body: pool.collectFees(),\n      })\n    );\n    expect(sendCollectFeesNoFeeAddress.type).to.be.equal(\"failed\");\n\n    contract.setDataCell(\n      pool.data({\n        routerAddress: routerAddress,\n        lpFee: new BN(20),\n        protocolFee: new BN(0),\n        refFee: new BN(10),\n        protocolFeesAddress: randomAddress(\"a valid protocol fee address\"),\n        collectedTokenAProtocolFees: new BN(110),\n        collectedTokenBProtocolFees: new BN(440),\n        wallet0: randomAddress(\"wallet0\"),\n        wallet1: randomAddress(\"wallet1\"),\n        reserve0: new BN(1310),\n        reserve1: new BN(203333),\n        supplyLP: new BN(10000000),\n        LPWalletCode: Cell.fromBoc(fs.readFileSync(\"build/lp_wallet.cell\"))[0],\n        LPAccountCode: Cell.fromBoc(fs.readFileSync(\"build/lp_account.cell\"))[0],\n      })\n    );\n\n    const sendCollectFees = await contract.sendInternalMessage(\n      internalMessage({\n        from: routerAddress,\n        value: toNano(0.5),\n        body: pool.collectFees(),\n      })\n    );\n    expect(sendCollectFees.type).to.be.equal(\"success\");\n    expect(sendCollectFees.actionList.length).to.be.equal(1);\n    expect(sendCollectFees.actionList[0].type).to.be.equal(\"send_msg\");\n\n    const sendGetPoolData = await contract.sendInternalMessage(\n      internalMessage({\n        from: randomAddress(\"wallet0\"),\n        value: toNano(0.5),\n        body: pool.getPoolData(),\n      })\n    );\n\n    expect(sendGetPoolData.actionList[1].type).to.be.equal(\"send_msg\");\n    let msgOut = (sendGetPoolData.actionList[1] as SendMsgAction).message;\n    expect(msgOut.info.dest?.toString()).to.be.equal(randomAddress(\"wallet0\").toString());\n    let msgOutBody = msgOut.body.beginParse().readRef();\n    msgOutBody.skip(4 + 4 + 4);\n    msgOutBody.readAddress();\n    expect(msgOutBody.readCoins().toNumber()).to.be.equal(0);\n\n    contract.setDataCell(\n      pool.data({\n        routerAddress: routerAddress,\n        lpFee: new BN(20),\n        protocolFee: new BN(0),\n        refFee: new BN(10),\n        protocolFeesAddress: randomAddress(\"a valid protocol fee address\"),\n        collectedTokenAProtocolFees: new BN(11000000000000),\n        collectedTokenBProtocolFees: new BN(4400000000000000),\n        wallet0: randomAddress(\"wallet0\"),\n        wallet1: randomAddress(\"wallet1\"),\n        reserve0: new BN(1310),\n        reserve1: new BN(203333),\n        supplyLP: new BN(10000000),\n        LPWalletCode: Cell.fromBoc(fs.readFileSync(\"build/lp_wallet.cell\"))[0],\n        LPAccountCode: Cell.fromBoc(fs.readFileSync(\"build/lp_account.cell\"))[0],\n      })\n    );\n\n    const sendCollectFeesLowGas = await contract.sendInternalMessage(\n      internalMessage({\n        from: randomAddress(\"user\"),\n        value: toNano(0.5),\n        body: pool.collectFees(),\n      })\n    );\n    expect(sendCollectFeesLowGas.type).to.be.equal(\"failed\");\n\n    const sendCollectFeesWithRewards = await contract.sendInternalMessage(\n      internalMessage({\n        from: randomAddress(\"user\"),\n        value: toNano(1.2),\n        body: pool.collectFees(),\n      })\n    );\n\n    expect(sendCollectFeesWithRewards.type).to.be.equal(\"success\");\n    expect(sendCollectFeesWithRewards.actionList.length).to.be.equal(2);\n  });\n\n  it(\"should allow swapping\", async () => {\n    let protocolFeesAddress = randomAddress(\"another valid protocol address\");\n    setBalance(contract, toNano(5));\n    contract.setDataCell(\n      pool.data({\n        routerAddress: routerAddress,\n        lpFee: new BN(20),\n        protocolFee: new BN(0),\n        refFee: new BN(10),\n        protocolFeesAddress: randomAddress(\"a valid protocol fee address\"),\n        collectedTokenAProtocolFees: new BN(0),\n        collectedTokenBProtocolFees: new BN(0),\n        wallet0: randomAddress(\"wallet0\"),\n        wallet1: randomAddress(\"wallet1\"),\n        reserve0: new BN(1000000000000000),\n        reserve1: new BN(1000000000000000),\n        supplyLP: new BN(10000000),\n        LPWalletCode: Cell.fromBoc(fs.readFileSync(\"build/lp_wallet.cell\"))[0],\n        LPAccountCode: Cell.fromBoc(fs.readFileSync(\"build/lp_account.cell\"))[0],\n      })\n    );\n\n    const sendChangeFees = await contract.sendInternalMessage(\n      internalMessage({\n        from: routerAddress,\n        value: toNano(0.1),\n        body: pool.setFees({\n          newLPFee: new BN(100),\n          newProtocolFees: new BN(0),\n          newRefFee: new BN(10),\n          newProtocolFeeAddress: protocolFeesAddress,\n        }),\n      })\n    );\n    expect(sendChangeFees.type).to.be.equal(\"success\");\n\n    const callGetFees = await contract.invokeGetMethod(\"get_pool_data\", []);\n\n    expect(callGetFees.result[4] as BN).to.be.a.bignumber.that.is.equal(new BN(100));\n    expect(callGetFees.result[5] as BN).to.be.a.bignumber.that.is.equal(new BN(0));\n    expect(callGetFees.result[6] as BN).to.be.a.bignumber.that.is.equal(new BN(10));\n\n    const callGetOutputs = await contract.invokeGetMethod(\"get_expected_outputs\", [\n      { type: \"int\", value: \"20000000000\" },\n      { type: \"cell_slice\", value: (beginCell().storeAddress(randomAddress(\"wallet0\")).endCell()).toBoc({ idx: false }).toString(\"base64\") },\n    ]);\n\n    expect(callGetOutputs.result[0] as BN).to.be.a.bignumber.that.is.equal(new BN(19799607967));\n\n    const sendSwapWrongSender = await contract.sendInternalMessage(\n      internalMessage({\n        from: randomAddress(\"\"),\n        value: toNano(0.1),\n        body: pool.swap({\n          fromAddress: randomAddress(\"user1\"),\n          jettonAmount: new BN(\"20000000000\"),\n          tokenWallet: randomAddress(\"wallet1\"),\n          toAddress: randomAddress(\"user1\"),\n          minOutput: new BN(\"200\"),\n        }),\n      })\n    );\n    expect(sendSwapWrongSender.type).to.be.equal(\"failed\");\n\n    const sendSwap = await contract.sendInternalMessage(\n      internalMessage({\n        from: routerAddress,\n        value: toNano(0.1),\n        body: pool.swap({\n          fromAddress: randomAddress(\"user1\"),\n          jettonAmount: new BN(\"20000000000\"),\n          tokenWallet: randomAddress(\"wallet0\"),\n          toAddress: randomAddress(\"user1\"),\n          minOutput: new BN(\"200\"),\n        }),\n      })\n    );\n\n    expect(sendSwap.type).to.be.equal(\"success\");\n    expect(sendSwap.actionList.length).to.be.equal(1);\n    expect(sendSwap.actionList[0].type).to.be.equal(\"send_msg\");\n    let msgOutSwap = (sendSwap.actionList[0] as SendMsgAction).message;\n    expect(msgOutSwap.info.dest?.toString()).to.be.equal(routerAddress.toString());\n\n    let msgOutSwapBody = msgOutSwap.body.beginParse().readRef();\n    msgOutSwapBody.readCoins();\n    msgOutSwapBody.readAddress();\n    let receivedToken = msgOutSwapBody.readCoins();\n    // @ts-ignore\n    expect(receivedToken).to.be.a.bignumber.that.is.equal(callGetOutputs.result[0] as BN);\n\n    const sendGetExpectedAfterSwap = await contract.sendInternalMessage(\n      internalMessage({\n        from: randomAddress(\"someone\"),\n        value: toNano(0.1),\n        body: pool.getExpectedOutputs({\n          jettonAmount: new BN(20000000000),\n          tokenSent: randomAddress(\"wallet0\"),\n        })\n      })\n    );\n\n    expect(sendGetExpectedAfterSwap.type).to.be.equal(\"success\");\n    let msgOut = (sendGetExpectedAfterSwap.actionList[1] as SendMsgAction).message;\n    expect(msgOut.info.dest?.toString()).to.be.equal(randomAddress(\"someone\").toString());\n    let msgOutBody = msgOut.body.beginParse();\n    msgOutBody.skip(32 + 64);\n    // @ts-ignore\n    expect(msgOutBody.readCoins()).to.be.a.bignumber.that.is.below(receivedToken);\n  });\n\n  it(\"should send back token when reject swap\", async () => {\n    setBalance(contract, toNano(5));\n    contract.setDataCell(\n      pool.data({\n        routerAddress: routerAddress,\n        lpFee: new BN(20),\n        protocolFee: new BN(0),\n        refFee: new BN(10),\n        protocolFeesAddress: randomAddress(\"a valid protocol fee address\"),\n        collectedTokenAProtocolFees: new BN(0),\n        collectedTokenBProtocolFees: new BN(0),\n        wallet0: randomAddress(\"wallet0\"),\n        wallet1: randomAddress(\"wallet1\"),\n        reserve0: new BN(1000),\n        reserve1: new BN(10000),\n        supplyLP: new BN(0),\n        LPWalletCode: Cell.fromBoc(fs.readFileSync(\"build/lp_wallet.cell\"))[0],\n        LPAccountCode: Cell.fromBoc(fs.readFileSync(\"build/lp_account.cell\"))[0],\n      })\n    );\n\n    const send = await contract.sendInternalMessage(\n      internalMessage({\n        from: routerAddress,\n        value: toNano(0.1),\n        body: pool.swap({\n          fromAddress: randomAddress(\"user1\"),\n          jettonAmount: new BN(\"20\"),\n          tokenWallet: randomAddress(\"wallet1\"),\n          minOutput: new BN(\"20000000\"),\n          toAddress: randomAddress(\"to\"),\n        }),\n      })\n    );\n\n    expect(send.type).to.be.equal(\"success\");\n    expect(send.actionList.length).to.be.equal(1);\n    expect(send.actionList[0].type).to.be.equal(\"send_msg\");\n\n    let msgOut = (send.actionList[0] as SendMsgAction).message;\n    expect(msgOut.info.dest?.toString()).to.be.equal(routerAddress.toString());\n\n    let tokenOut = msgOut.body.beginParse().readRef();\n    expect(tokenOut.readCoins().toString()).to.be.equal(\"0\");\n    expect(tokenOut.readAddress()?.toString()).to.be.equal(randomAddress(\"wallet0\").toString());\n    expect(tokenOut.readCoins().toString()).to.be.equal(\"20\");\n    expect(tokenOut.readAddress()?.toString()).to.be.equal(randomAddress(\"wallet1\").toString());\n\n  });\n\n  it(\"should swap with referall\", async () => {\n    setBalance(contract, toNano(5));\n    setNetworkConfig(contract);\n    contract.setDataCell(\n      pool.data({\n        routerAddress: routerAddress,\n        lpFee: new BN(20),\n        protocolFee: new BN(0),\n        refFee: new BN(10),\n        protocolFeesAddress: randomAddress(\"a valid protocol fee address\"),\n        collectedTokenAProtocolFees: new BN(0),\n        collectedTokenBProtocolFees: new BN(0),\n        wallet0: randomAddress(\"wallet0\"),\n        wallet1: randomAddress(\"wallet1\"),\n        reserve0: new BN(\"1000000000000000000000000000000000\"),\n        reserve1: new BN(\"1000000000000000000000000000000000\"),\n        supplyLP: new BN(100000),\n        LPWalletCode: Cell.fromBoc(fs.readFileSync(\"build/lp_wallet.cell\"))[0],\n        LPAccountCode: Cell.fromBoc(fs.readFileSync(\"build/lp_account.cell\"))[0],\n      })\n    );\n\n    const sendWithRef = await contract.sendInternalMessage(\n      internalMessage({\n        from: routerAddress,\n        value: toNano(1),\n        body: pool.swap({\n          fromAddress: randomAddress(\"user1\"),\n          jettonAmount: new BN(\"20000\"),\n          tokenWallet: randomAddress(\"wallet1\"),\n          minOutput: new BN(\"0\"),\n          toAddress: randomAddress(\"user1\"),\n          hasRef: true,\n          refAddress: randomAddress(\"ref\"),\n        }),\n      })\n    );\n    expect(sendWithRef.type).to.be.equal(\"success\");\n    expect(sendWithRef.actionList.length).to.be.equal(2);\n    expect(sendWithRef.actionList[0].type).to.be.equal(\"send_msg\");\n    expect(sendWithRef.actionList[1].type).to.be.equal(\"send_msg\");\n\n    let msgOutUser = (sendWithRef.actionList[1] as SendMsgAction).message;\n    expect(msgOutUser.info.dest?.toString()).to.be.equal(routerAddress.toString());\n\n    let tokenOutUser = msgOutUser.body.beginParse().readRef();\n    expect(tokenOutUser.readCoins()).to.be.a.bignumber.that.is.equal(new BN(19939));\n    expect(tokenOutUser.readAddress()?.toString()).to.be.equal(randomAddress(\"wallet0\").toString());\n\n    let msgOutRef = (sendWithRef.actionList[0] as SendMsgAction).message;\n    expect(msgOutRef.info.dest?.toString()).to.be.equal(routerAddress.toString());\n\n    let tokenOutRef = msgOutRef.body.beginParse().readRef();\n    expect(tokenOutRef.readCoins()).to.be.a.bignumber.that.is.equal(new BN(20));\n    expect(tokenOutRef.readAddress()?.toString()).to.be.equal(randomAddress(\"wallet0\").toString());\n  });\n\n  it(\"should generate a valid jetton URI\", async () => {\n    let anotherAddress = randomAddress(\"another address\");\n    contract.setC7(\n      buildC7({\n        myself: anotherAddress,\n      })\n    );\n    const call2 = await contract.invokeGetMethod(\"get_jetton_data\", []);\n    expect(parseUri(call2.result[3] as Cell)).to.be.equal(\"https://lp.ston.fi/\" + anotherAddress.toString().toUpperCase() + \".json\");\n  });\n});\n"
  },
  {
    "path": "test/router.spec.ts",
    "content": "import chai, { expect } from \"chai\";\nimport chaiBN from \"chai-bn\";\nimport BN from \"bn.js\";\nchai.use(chaiBN(BN));\n\nimport * as fs from \"fs\";\nimport { Cell, beginCell, Address, Slice, toNano } from \"ton\";\nimport { SmartContract, SendMsgAction } from \"ton-contract-executor\";\nimport * as router from \"../contracts/router\";\nimport { internalMessage, randomAddress, setBalance, setNetworkConfig } from \"./helpers\";\n\ndescribe(\"router tests\", () => {\n  let contract: SmartContract;\n\n  beforeEach(async () => {\n    contract = await SmartContract.fromCell(\n      Cell.fromBoc(fs.readFileSync(\"build/router.cell\"))[0],\n      router.data({\n        isLocked: false,\n        adminAddress: randomAddress(\"admin\"),\n        poolCode: Cell.fromBoc(fs.readFileSync(\"build/pool.cell\"))[0],\n        LPWalletCode: Cell.fromBoc(fs.readFileSync(\"build/lp_wallet.cell\"))[0],\n        LPAccountCode: Cell.fromBoc(fs.readFileSync(\"build/lp_account.cell\"))[0],\n      })\n    );\n  });\n\n  it(\"should get a valid pool address\", async () => {\n    const poolAddr1 = beginCell().storeAddress(randomAddress(\"token wallet 1\")).endCell();\n    const poolAddr2 = beginCell().storeAddress(randomAddress(\"token wallet 2\")).endCell();\n    const call = await contract.invokeGetMethod(\"get_pool_address\", [\n      { type: \"cell_slice\", value: poolAddr1.toBoc({ idx: false }).toString(\"base64\") },\n      { type: \"cell_slice\", value: poolAddr2.toBoc({ idx: false }).toString(\"base64\") },\n    ]);\n\n    const poolAddr = call.result[0];\n    expect(call.type).to.equal(\"success\");\n  });\n\n  it(\"should reset gas\", async () => {\n    setBalance(contract, toNano(5));\n    const send = await contract.sendInternalMessage(\n      internalMessage({\n        from: randomAddress(\"admin\"),\n        value: toNano(70000000),\n        body: router.resetGas(),\n      })\n    );\n    expect(send.type).to.be.equal(\"success\");\n    expect(send.actionList.length).to.be.equal(1);\n  });\n\n  it(\"should pay if caller is valid\", async () => {\n    setNetworkConfig(contract);\n    const tokenWallet1 = beginCell().storeAddress(randomAddress(\"token wallet 1\")).endCell();\n    const tokenWallet2 = beginCell().storeAddress(randomAddress(\"token wallet 2\")).endCell();\n    const call = await contract.invokeGetMethod(\"get_pool_address\", [\n      { type: \"cell_slice\", value: tokenWallet1.toBoc({ idx: false }).toString(\"base64\") },\n      { type: \"cell_slice\", value: tokenWallet2.toBoc({ idx: false }).toString(\"base64\") },\n    ]);\n    const send = await contract.sendInternalMessage(\n      internalMessage({\n        from: (call.result[0] as Slice).readAddress() as Address,\n        value: toNano(\"20\"),\n        body: router.payTo({\n          owner: randomAddress(\"owner\"),\n          tokenAAmount: new BN(100),\n          walletTokenAAddress: randomAddress(\"token wallet 1\"),\n          tokenBAmount: new BN(200),\n          walletTokenBAddress: randomAddress(\"token wallet 2\"),\n        }),\n      })\n    );\n    expect(send.type).to.equal(\"success\");\n    expect(send.actionList.length).to.equal(2);\n  });\n\n  it(\"should always get the same pool\", async () => {\n    const tokenWallet1 = beginCell().storeAddress(randomAddress(\"token wallet 1\")).endCell();\n    const tokenWallet2 = beginCell().storeAddress(randomAddress(\"token wallet 2\")).endCell();\n    const call = await contract.invokeGetMethod(\"get_pool_address\", [\n      { type: \"cell_slice\", value: tokenWallet1.toBoc({ idx: false }).toString(\"base64\") },\n      { type: \"cell_slice\", value: tokenWallet2.toBoc({ idx: false }).toString(\"base64\") },\n    ]);\n    let result1 = (call.result[0] as Slice).readAddress()?.toString();\n    const call2 = await contract.invokeGetMethod(\"get_pool_address\", [\n      { type: \"cell_slice\", value: tokenWallet2.toBoc({ idx: false }).toString(\"base64\") },\n      { type: \"cell_slice\", value: tokenWallet1.toBoc({ idx: false }).toString(\"base64\") },\n    ]);\n\n    expect(result1).to.be.equal((call2.result[0] as Slice).readAddress()?.toString());\n\n    const send = await contract.sendInternalMessage(\n      internalMessage({\n        from: randomAddress(\"someone\"),\n        value: new BN(\"300000000\"),\n        body: router.getPoolAddress({\n          walletTokenAAddress: randomAddress(\"token wallet 1\"),\n          walletTokenBAddress: randomAddress(\"token wallet 2\"),\n        }),\n      })\n    );\n    expect(send.type).to.equal(\"success\");\n    expect(send.actionList.length).to.equal(2);\n\n    expect(send.actionList[1].type).to.be.equal(\"send_msg\");\n    let msgOut = (send.actionList[1] as SendMsgAction).message;\n    expect(msgOut.info.dest?.toString()).to.be.equal(randomAddress(\"someone\").toString());\n    let msgOutBody = msgOut.body.beginParse();\n    msgOutBody.skip(32 + 64);\n    let address2 = msgOutBody.readAddress()?.toString();\n    expect(address2).to.be.equal(result1)\n  });\n\n  it(\"should refuse to pay if caller is not valid\", async () => {\n    setNetworkConfig(contract);\n    const send = await contract.sendInternalMessage(\n      internalMessage({\n        from: randomAddress(\"a random address\"),\n        value: toNano(\"2\"),\n        body: router.payTo({\n          owner: randomAddress(\"owner\"),\n          tokenAAmount: new BN(100),\n          walletTokenAAddress: randomAddress(\"token wallet 1\"),\n          tokenBAmount: new BN(200),\n          walletTokenBAddress: randomAddress(\"token wallet 2\"),\n        }),\n      })\n    );\n    expect(send.type).to.not.equal(\"success\");\n    expect(send.actionList.length).to.equal(0);\n  });\n\n  it(\"should route a swap request\", async () => {\n    let tokenWallet0 = randomAddress(\"a random token wallet\"),\n      tokenWallet1 = randomAddress(\"token wallet 2\");\n    const sendWithoutRef = await contract.sendInternalMessage(\n      internalMessage({\n        from: tokenWallet0,\n        value: new BN(\"300000000\"),\n        body: router.swap({\n          jettonAmount: new BN(100),\n          fromAddress: randomAddress(\"from\"),\n          walletTokenBAddress: tokenWallet1,\n          toAddress: randomAddress(\"from\"),\n          expectedOutput: new BN(100),\n        }),\n      })\n    );\n    expect(sendWithoutRef.type).to.equal(\"success\");\n    expect(sendWithoutRef.actionList.length).to.equal(1);\n\n    let msgOut = (sendWithoutRef.actionList[0] as SendMsgAction).message;\n    expect(msgOut.info.dest?.toString()).to.not.be.equal(tokenWallet0.toString()); // not bounced back\n\n    const sendWithRef = await contract.sendInternalMessage(\n      internalMessage({\n        from: tokenWallet0,\n        value: new BN(\"300000000\"),\n        body: router.swap({\n          jettonAmount: new BN(100),\n          fromAddress: randomAddress(\"from\"),\n          walletTokenBAddress: tokenWallet1,\n          toAddress: randomAddress(\"from\"),\n          expectedOutput: new BN(100),\n          hasRef: true,\n          refAddress: randomAddress(\"ref\"),\n        }),\n      })\n    );\n    expect(sendWithRef.type).to.equal(\"success\");\n    expect(sendWithRef.actionList.length).to.equal(1);\n\n    let msgOut2 = (sendWithRef.actionList[0] as SendMsgAction).message;\n    expect(msgOut2.info.dest?.toString()).to.not.be.equal(tokenWallet0.toString()); // not bounced back\n\n  });\n\n  it(\"should route a lp request\", async () => {\n    const send = await contract.sendInternalMessage(\n      internalMessage({\n        from: randomAddress(\"a random token wallet\"),\n        value: new BN(\"300000000\"),\n        body: router.provideLiquidity({\n          jettonAmount: new BN(100),\n          fromAddress: randomAddress(\"from\"),\n          walletTokenBAddress: randomAddress(\"token wallet 2\"),\n          minLPOut: new BN(100),\n        }),\n      })\n    );\n    expect(send.type).to.equal(\"success\");\n    expect(send.actionList.length).to.equal(1);\n  });\n\n  it(\"should allow pool upgrades\", async () => {\n    contract.setUnixTime(+new Date());\n    const sendUpdateAdminOk = await contract.sendInternalMessage(\n      internalMessage({\n        from: randomAddress(\"admin\"),\n        value: new BN(\"300000000\"),\n        body: router.initAdminUpgrade({\n          newAdmin: randomAddress(\"new admin\"),\n        }),\n      })\n    );\n    expect(sendUpdateAdminOk.type).to.equal(\"success\");\n    // two days passed\n    contract.setUnixTime(+new Date() + (24 * 60 * 60 * 2));\n\n    const sendFinalizeUpgradeAdminOk = await contract.sendInternalMessage(\n      internalMessage({\n        from: randomAddress(\"admin\"), // old admin\n        value: new BN(\"300000000\"),\n        body: router.finalizeUpgrades(),\n      })\n    );\n\n    expect(sendFinalizeUpgradeAdminOk.type).to.equal(\"success\");\n    expect(sendFinalizeUpgradeAdminOk.actionList.length).to.equal(0);\n\n    contract.setUnixTime(+new Date());\n\n    const sendInitUpgradeWrongSender = await contract.sendInternalMessage(\n      internalMessage({\n        from: randomAddress(\"admin\"), // old admin\n        value: new BN(\"300000000\"),\n        body: router.initCodeUpgrade({\n          newCode: beginCell().storeInt(new BN(\"10\"), 32).endCell(),\n        }),\n      })\n    );\n    expect(sendInitUpgradeWrongSender.type).to.equal(\"failed\");\n    expect(sendInitUpgradeWrongSender.exit_code).to.equal(65535);\n\n    const sendInitCodeUpgradeOk = await contract.sendInternalMessage(\n      internalMessage({\n        from: randomAddress(\"new admin\"),\n        value: new BN(\"300000000\"),\n        body: router.initCodeUpgrade({\n          newCode: beginCell().storeInt(new BN(\"10\"), 32).endCell(),\n        }),\n      })\n    );\n    expect(sendInitCodeUpgradeOk.type).to.equal(\"success\");\n    expect(sendInitCodeUpgradeOk.actionList.length).to.equal(0);\n\n    // zero days passed\n    const sendFinalizeUpgradeFailed = await contract.sendInternalMessage(\n      internalMessage({\n        from: randomAddress(\"new admin\"),\n        value: new BN(\"300000000\"),\n        body: router.finalizeUpgrades(),\n      })\n    );\n\n    expect(sendFinalizeUpgradeFailed.type).to.equal(\"success\");\n    expect(sendFinalizeUpgradeFailed.actionList.length).to.equal(0);\n\n    contract.setUnixTime(+new Date() + (24 * 60 * 60 * 7));\n\n    const sendFinalizeUpgradeOk = await contract.sendInternalMessage(\n      internalMessage({\n        from: randomAddress(\"new admin\"),\n        value: new BN(\"300000000\"),\n        body: router.finalizeUpgrades(),\n      })\n    );\n\n    expect(sendFinalizeUpgradeOk.type).to.equal(\"success\");\n    expect(sendFinalizeUpgradeOk.actionList[0].type).to.equal(\"set_code\");\n  });\n\n  it(\"should collect fees from pool\", async () => {\n    let poolAddress = randomAddress(\"a pool\");\n    const send = await contract.sendInternalMessage(\n      internalMessage({\n        from: randomAddress(\"admin\"),\n        value: new BN(\"300000000\"),\n        body: router.collectFees({\n          jetton0Address: randomAddress(\"a jetton\"),\n          jetton1Address: randomAddress(\"another jetton\"),\n        }),\n      })\n    );\n    expect(send.type).to.equal(\"success\");\n  });\n\n  it(\"should set fees\", async () => {\n    let admin = randomAddress(\"admin\");\n    const sendOk = await contract.sendInternalMessage(\n      internalMessage({\n        from: admin,\n        value: new BN(\"300000000\"),\n        body: router.setFees({\n          jetton0Address: randomAddress(\"a jetton\"),\n          jetton1Address: randomAddress(\"another jetton\"),\n          newLPFee: new BN(2),\n          newProtocolFee: new BN(1),\n          newRefFee: new BN(1),\n          newProtocolFeeAddress: randomAddress(\"partner\"),\n        }),\n      })\n    );\n    expect(sendOk.type).to.equal(\"success\");\n    expect(sendOk.actionList.length).to.equal(1);\n  });\n\n  it(\"should lock/unlock trades\", async () => {\n    const sendWrongSender = await contract.sendInternalMessage(\n      internalMessage({\n        from: randomAddress(\"\"),\n        value: new BN(\"300000000\"),\n        body: router.lock(),\n      })\n    );\n    expect(sendWrongSender.type).to.equal(\"failed\");\n\n    const send = await contract.sendInternalMessage(\n      internalMessage({\n        from: randomAddress(\"admin\"),\n        value: new BN(\"300000000\"),\n        body: router.lock(),\n      })\n    );\n    expect(send.type).to.equal(\"success\");\n\n    const callGetData1 = await contract.invokeGetMethod(\"get_router_data\", []);\n    let newStatus = (callGetData1.result[0] as BN).toNumber() == 0 ? \"unlocked\" : \"locked\";\n    expect(newStatus).to.equal(\"locked\");\n\n    let tokenWallet0 = randomAddress(\"a random token wallet\"),\n      tokenWallet1 = randomAddress(\"token wallet 2\");\n    const sendWithoutRef = await contract.sendInternalMessage(\n      internalMessage({\n        from: tokenWallet0,\n        value: new BN(\"300000000\"),\n        body: router.swap({\n          jettonAmount: new BN(100),\n          fromAddress: randomAddress(\"from\"),\n          walletTokenBAddress: tokenWallet1,\n          toAddress: randomAddress(\"from\"),\n          expectedOutput: new BN(100),\n        }),\n      })\n    );\n    expect(sendWithoutRef.type).to.equal(\"success\");\n    expect(sendWithoutRef.actionList.length).to.equal(1);\n\n    let msgOut = (sendWithoutRef.actionList[0] as SendMsgAction).message;\n    expect(msgOut.info.dest?.toString()).to.be.equal(tokenWallet0.toString()); // bounced back\n    // skip everything expet last exit code\n    let msgOutBody = msgOut.body.beginParse();\n    msgOutBody.skip(msgOutBody.remaining - 32);\n    expect(msgOutBody.readUint(32).toNumber()).to.equal(0xA0DBDCB);\n    const send2 = await contract.sendInternalMessage(\n      internalMessage({\n        from: randomAddress(\"admin\"),\n        value: new BN(\"300000000\"),\n        body: router.unlock(),\n      })\n    );\n    expect(send2.type).to.equal(\"success\");\n\n    const callGetData2 = await contract.invokeGetMethod(\"get_router_data\", []);\n    newStatus = (callGetData2.result[0] as BN).toNumber() == 0 ? \"unlocked\" : \"locked\";\n    expect(newStatus).to.equal(\"unlocked\");\n  });\n\n\n  it(\"should return contracts codes\", async () => {\n    const callGetRouterData = await contract.invokeGetMethod(\"get_router_data\", []);\n    let poolCodeHash = (callGetRouterData.result[3] as Cell).hash();\n    let jettonLPWalletCodeHash = (callGetRouterData.result[4] as Cell).hash();\n    let LPAccountCodeHash = (callGetRouterData.result[5] as Cell).hash();\n\n    expect(poolCodeHash).to.deep.equal(Cell.fromBoc(fs.readFileSync(\"build/pool.cell\"))[0].hash());\n    expect(jettonLPWalletCodeHash).to.deep.equal(Cell.fromBoc(fs.readFileSync(\"build/lp_wallet.cell\"))[0].hash());\n    expect(LPAccountCodeHash).to.deep.equal(Cell.fromBoc(fs.readFileSync(\"build/lp_account.cell\"))[0].hash());\n  });\n});\n"
  },
  {
    "path": "tsconfig.json",
    "content": "{\n  \"compilerOptions\": {\n    \"target\": \"es2021\",\n    \"module\": \"commonjs\",\n    \"esModuleInterop\": true,\n    \"forceConsistentCasingInFileNames\": true,\n    \"strict\": true,\n    \"skipLibCheck\": true\n  },\n  \"ts-node\": {\n    \"transpileOnly\": true,\n    \"transpiler\": \"ts-node/transpilers/swc\"\n  }\n}"
  }
]